+
diff --git a/app/controllers/api/availabilities_controller.rb b/app/controllers/api/availabilities_controller.rb
index cec87315d..bc9215379 100644
--- a/app/controllers/api/availabilities_controller.rb
+++ b/app/controllers/api/availabilities_controller.rb
@@ -80,7 +80,7 @@ class API::AvailabilitiesController < API::ApiController
end
def machine
- @current_user_role = current_user.admin? ? 'admin' : 'user'
+ @current_user_role = current_user.role
service = Availabilities::AvailabilitiesService.new(current_user, other: @visi_max_other, year: @visi_max_year)
@slots = service.machines(params[:machine_id], user)
@@ -92,7 +92,7 @@ class API::AvailabilitiesController < API::ApiController
end
def spaces
- @current_user_role = current_user.admin? ? 'admin' : 'user'
+ @current_user_role = current_user.role
service = Availabilities::AvailabilitiesService.new(current_user, other: @visi_max_other, year: @visi_max_year)
@slots = service.spaces(params[:space_id], user)
@@ -147,7 +147,7 @@ class API::AvailabilitiesController < API::ApiController
def availability_params
params.require(:availability).permit(:start_at, :end_at, :available_type, :machine_ids, :training_ids, :nb_total_places,
- :is_recurrent, :period, :nb_periods, :end_date,
+ :is_recurrent, :period, :nb_periods, :end_date, :slot_duration,
machine_ids: [], training_ids: [], space_ids: [], tag_ids: [], plan_ids: [],
machines_attributes: %i[id _destroy], plans_attributes: %i[id _destroy])
end
diff --git a/app/controllers/api/members_controller.rb b/app/controllers/api/members_controller.rb
index 6a772e706..9d7ea4afb 100644
--- a/app/controllers/api/members_controller.rb
+++ b/app/controllers/api/members_controller.rb
@@ -3,7 +3,7 @@
# API Controller for resources of type User with role 'member'
class API::MembersController < API::ApiController
before_action :authenticate_user!, except: [:last_subscribed]
- before_action :set_member, only: %i[update destroy merge complete_tour]
+ before_action :set_member, only: %i[update destroy merge complete_tour update_role]
respond_to :json
def index
@@ -38,7 +38,7 @@ class API::MembersController < API::ApiController
end
def create
- authorize User
+ authorize :user, :create_member?
@member = User.new(user_params.permit!)
members_service = Members::MembersService.new(@member)
@@ -202,6 +202,35 @@ class API::MembersController < API::ApiController
end
end
+ def update_role
+ authorize @member
+
+ # we do not allow dismissing a user to a lower role
+ if params[:role] == 'member'
+ render 403 and return if @member.role == 'admin' || @member.role == 'manager'
+ elsif params[:role] == 'manager'
+ render 403 and return if @member.role == 'admin'
+ end
+
+ # do nothing if the role does not change
+ render json: @member and return if params[:role] == @member.role
+
+ ex_role = @member.role.to_sym
+ @member.remove_role ex_role
+ @member.add_role params[:role]
+
+ NotificationCenter.call type: 'notify_user_role_update',
+ receiver: @member,
+ attached_object: @member
+
+ NotificationCenter.call type: 'notify_admins_role_update',
+ receiver: User.admins_and_managers,
+ attached_object: @member,
+ meta_data: { ex_role: ex_role }
+
+ render json: @member
+ end
+
private
def set_member
@@ -222,7 +251,7 @@ class API::MembersController < API::ApiController
],
statistic_profile_attributes: %i[id gender birthday])
- elsif current_user.admin?
+ elsif current_user.admin? || current_user.manager?
params.require(:user).permit(:username, :email, :password, :password_confirmation, :is_allow_contact, :is_allow_newsletter, :group_id,
tag_ids: [],
profile_attributes: [:id, :first_name, :last_name, :phone, :interest, :software_mastered, :website, :job,
diff --git a/app/controllers/api/payments_controller.rb b/app/controllers/api/payments_controller.rb
index c4ebf3613..11b4a7582 100644
--- a/app/controllers/api/payments_controller.rb
+++ b/app/controllers/api/payments_controller.rb
@@ -12,7 +12,12 @@ class API::PaymentsController < API::ApiController
def confirm_payment
render(json: { error: 'Online payment is disabled' }, status: :unauthorized) and return if Rails.application.secrets.fablab_without_online_payments
+ amount = nil # will contains the amount and the details of each invoice lines
+ intent = nil # stripe's payment intent
+ res = nil # json of the API answer
+
begin
+ amount = card_amount
if params[:payment_method_id].present?
check_coupon
check_plan
@@ -20,7 +25,7 @@ class API::PaymentsController < API::ApiController
# Create the PaymentIntent
intent = Stripe::PaymentIntent.create(
payment_method: params[:payment_method_id],
- amount: card_amount,
+ amount: amount[:amount],
currency: Rails.application.secrets.stripe_currency,
confirmation_method: 'manual',
confirm: true,
@@ -40,7 +45,7 @@ class API::PaymentsController < API::ApiController
if intent&.status == 'succeeded'
if params[:cart_items][:reservation]
- res = on_reservation_success(intent)
+ res = on_reservation_success(intent, amount[:details])
elsif params[:cart_items][:subscription]
res = on_subscription_success(intent)
end
@@ -51,10 +56,10 @@ class API::PaymentsController < API::ApiController
private
- def on_reservation_success(intent)
+ def on_reservation_success(intent, details)
@reservation = Reservation.new(reservation_params)
is_reserve = Reservations::Reserve.new(current_user.id, current_user.invoicing_profile.id)
- .pay_and_save(@reservation, coupon: coupon_params[:coupon_code], payment_intent_id: intent.id)
+ .pay_and_save(@reservation, payment_details: details, payment_intent_id: intent.id)
Stripe::PaymentIntent.update(
intent.id,
description: "Invoice reference: #{@reservation.invoice.reference}"
@@ -142,7 +147,7 @@ class API::PaymentsController < API::ApiController
# Subtract wallet amount from total
total = price_details[:total]
wallet_debit = get_wallet_debit(current_user, total)
- total - wallet_debit
+ { amount: total - wallet_debit, details: price_details }
end
def check_coupon
diff --git a/app/controllers/api/prices_controller.rb b/app/controllers/api/prices_controller.rb
index d23f0624d..af2dafe0e 100644
--- a/app/controllers/api/prices_controller.rb
+++ b/app/controllers/api/prices_controller.rb
@@ -45,7 +45,7 @@ class API::PricesController < API::ApiController
@amount = { elements: nil, total: 0, before_coupon: 0 }
else
reservable = price_parameters[:reservable_type].constantize.find(price_parameters[:reservable_id])
- @amount = Price.compute(current_user.admin?,
+ @amount = Price.compute(current_user.admin? || (current_user.manager? && current_user.id != user.id),
user,
reservable,
price_parameters[:slots_attributes] || [],
diff --git a/app/controllers/api/reservations_controller.rb b/app/controllers/api/reservations_controller.rb
index 333dc3534..e5460fe1c 100644
--- a/app/controllers/api/reservations_controller.rb
+++ b/app/controllers/api/reservations_controller.rb
@@ -9,13 +9,13 @@ class API::ReservationsController < API::ApiController
def index
if params[:reservable_id] && params[:reservable_type] && params[:user_id]
- params[:user_id] = current_user.id unless current_user.admin?
+ params[:user_id] = current_user.id unless current_user.admin? || current_user.manager?
where_clause = params.permit(:reservable_id, :reservable_type).to_h
where_clause[:statistic_profile_id] = StatisticProfile.find_by!(user_id: params[:user_id])
@reservations = Reservation.where(where_clause)
- elsif params[:reservable_id] && params[:reservable_type] && current_user.admin?
+ elsif params[:reservable_id] && params[:reservable_type] && (current_user.admin? || current_user.manager?)
@reservations = Reservation.where(params.permit(:reservable_id, :reservable_type))
else
@reservations = []
@@ -25,16 +25,17 @@ class API::ReservationsController < API::ApiController
def show; end
# Admins can create any reservations. Members can directly create reservations if total = 0,
- # otherwise, they must use payments_controller#confirm_payment
+ # otherwise, they must use payments_controller#confirm_payment.
+ # Managers can create reservations for other users
def create
- user_id = current_user.admin? ? params[:reservation][:user_id] : current_user.id
- amount = transaction_amount(current_user.admin?, user_id)
+ user_id = current_user.admin? || current_user.manager? ? params[:reservation][:user_id] : current_user.id
+ price = transaction_amount(current_user.admin? || (current_user.manager? && current_user.id != user_id), user_id)
- authorize ReservationContext.new(Reservation, amount)
+ authorize ReservationContext.new(Reservation, price[:amount], user_id)
@reservation = Reservation.new(reservation_params)
is_reserve = Reservations::Reserve.new(user_id, current_user.invoicing_profile.id)
- .pay_and_save(@reservation, coupon: coupon_params[:coupon_code])
+ .pay_and_save(@reservation, payment_details: price[:price_details])
if is_reserve
SubscriptionExtensionAfterReservation.new(@reservation).extend_subscription_if_eligible
@@ -72,7 +73,8 @@ class API::ReservationsController < API::ApiController
# Subtract wallet amount from total
total = price_details[:total]
wallet_debit = get_wallet_debit(user, total)
- total - wallet_debit
+
+ { price_details: price_details, amount: (total - wallet_debit) }
end
def get_wallet_debit(user, total_amount)
diff --git a/app/controllers/api/slots_controller.rb b/app/controllers/api/slots_controller.rb
index 9efff2509..f3d4a52ea 100644
--- a/app/controllers/api/slots_controller.rb
+++ b/app/controllers/api/slots_controller.rb
@@ -1,7 +1,8 @@
# frozen_string_literal: true
# API Controller for resources of type Slot
-# Slots are used to cut Availabilities into reservable slots of ApplicationHelper::SLOT_DURATION minutes
+# Slots are used to cut Availabilities into reservable slots. The duration of these slots is configured per
+# availability by Availability.slot_duration, or otherwise globally by ApplicationHelper::SLOT_DURATION minutes
class API::SlotsController < API::ApiController
before_action :authenticate_user!
before_action :set_slot, only: %i[update cancel]
diff --git a/app/controllers/api/subscriptions_controller.rb b/app/controllers/api/subscriptions_controller.rb
index 536c1faf2..de406730b 100644
--- a/app/controllers/api/subscriptions_controller.rb
+++ b/app/controllers/api/subscriptions_controller.rb
@@ -10,12 +10,13 @@ class API::SubscriptionsController < API::ApiController
end
# Admins can create any subscriptions. Members can directly create subscriptions if total = 0,
- # otherwise, they must use payments_controller#confirm_payment
+ # otherwise, they must use payments_controller#confirm_payment.
+ # Managers can create subscriptions for other users
def create
- user_id = current_user.admin? ? params[:subscription][:user_id] : current_user.id
- amount = transaction_amount(current_user.admin?, user_id)
+ user_id = current_user.admin? || current_user.manager? ? params[:subscription][:user_id] : current_user.id
+ amount = transaction_amount(current_user.admin? || (current_user.manager? && current_user.id != user_id), user_id)
- authorize SubscriptionContext.new(Subscription, amount)
+ authorize SubscriptionContext.new(Subscription, amount, user_id)
@subscription = Subscription.new(subscription_params)
is_subscribe = Subscriptions::Subscribe.new(current_user.invoicing_profile.id, user_id)
diff --git a/app/controllers/api/trainings_controller.rb b/app/controllers/api/trainings_controller.rb
index e7ef567f9..c0ba04b19 100644
--- a/app/controllers/api/trainings_controller.rb
+++ b/app/controllers/api/trainings_controller.rb
@@ -41,7 +41,8 @@ class API::TrainingsController < API::ApiController
end
head :no_content
- elsif @training.update(training_params)
+ elsif current_user.admin? && @training.update(training_params)
+ # only admins can fully update a training, not managers
render :show, status: :ok, location: @training
else
render json: @training.errors, status: :unprocessable_entity
diff --git a/app/controllers/api/users_controller.rb b/app/controllers/api/users_controller.rb
index 09d29f96f..4aad2ed4a 100644
--- a/app/controllers/api/users_controller.rb
+++ b/app/controllers/api/users_controller.rb
@@ -1,12 +1,15 @@
# frozen_string_literal: true
-# API Controller for resources of type Users with role :partner
+# API Controller for resources of type Users with role :partner or :manager
class API::UsersController < API::ApiController
before_action :authenticate_user!
+ before_action :set_user, only: %i[destroy]
def index
- if current_user.admin? && params[:role] == 'partner'
- @users = User.with_role(:partner).includes(:profile)
+ authorize User
+
+ if %w[partner manager].include?(params[:role])
+ @users = User.with_role(params[:role].to_sym).includes(:profile)
else
head 403
end
@@ -14,7 +17,13 @@ class API::UsersController < API::ApiController
def create
authorize User
- res = UserService.create_partner(partner_params)
+ res = if !params[:user].empty?
+ UserService.create_partner(partner_params)
+ elsif !params[:manager].empty?
+ UserService.create_manager(manager_params)
+ else
+ nil
+ end
if res[:saved]
@user = res[:user]
@@ -24,9 +33,29 @@ class API::UsersController < API::ApiController
end
end
+ def destroy
+ authorize User
+ @user.destroy
+ head :no_content
+ end
+
private
+ def set_user
+ @user = User.find(params[:id])
+ end
+
def partner_params
params.require(:user).permit(:email, :first_name, :last_name)
end
+
+ def manager_params
+ params.require(:manager).permit(
+ :username, :email, :group_id,
+ tag_ids: [],
+ profile_attributes: %i[first_name last_name phone],
+ invoicing_profile_attributes: [address_attributes: [:address]],
+ statistic_profile_attributes: %i[gender birthday]
+ )
+ end
end
diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb
index 2aeb6930f..a2a1a3405 100644
--- a/app/controllers/confirmations_controller.rb
+++ b/app/controllers/confirmations_controller.rb
@@ -1,3 +1,6 @@
+# frozen_string_literal: true
+
+# Devise controller to handle validation of email addresses
class ConfirmationsController < Devise::ConfirmationsController
# The path used after confirmation.
def after_confirmation_path_for(resource_name, resource)
diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb
index 644421379..a397e4396 100644
--- a/app/controllers/passwords_controller.rb
+++ b/app/controllers/passwords_controller.rb
@@ -1,5 +1,8 @@
+# frozen_string_literal: true
+
+# Devise controller used for the "forgotten password" feature
class PasswordsController < Devise::PasswordsController
- # POST /resource/password
+ # POST /users/password.json
def create
self.resource = resource_class.send_reset_password_instructions(resource_params)
yield resource if block_given?
diff --git a/app/controllers/social_bot_controller.rb b/app/controllers/social_bot_controller.rb
index 96666a18d..67bf8da77 100644
--- a/app/controllers/social_bot_controller.rb
+++ b/app/controllers/social_bot_controller.rb
@@ -1,17 +1,20 @@
+# frozen_string_literal: true
+
+# Handle requests originated by indexer bots of social networks
class SocialBotController < ActionController::Base
def share
case request.original_fullpath
- when /(=%2F|\/)projects(%2F|\/)([\-0-9a-z_]+)/
- @project = Project.friendly.find("#{$3}")
- render :project, status: :ok
- when /(=%2F|\/)events(%2F|\/)([0-9]+)/
- @event = Event.find("#{$3}".to_i)
- render :event, status: :ok
- when /(=%2F|\/)trainings(%2F|\/)([\-0-9a-z_]+)/
- @training = Training.friendly.find("#{$3}")
+ when %r{(=%2F|/)projects(%2F|/)([\-0-9a-z_]+)}
+ @project = Project.friendly.find(Regexp.last_match(3).to_s)
+ render :project, status: :ok
+ when %r{(=%2F|/)events(%2F|/)([0-9]+)}
+ @event = Event.find(Regexp.last_match(3).to_s.to_i)
+ render :event, status: :ok
+ when %r{(=%2F|/)trainings(%2F|/)([\-0-9a-z_]+)}
+ @training = Training.friendly.find(Regexp.last_match(3).to_s)
render :training, status: :ok
- else
- puts "unknown bot request : #{request.original_url}"
+ else
+ puts "unknown bot request : #{request.original_url}"
end
end
diff --git a/app/exceptions/locked_error.rb b/app/exceptions/locked_error.rb
index a9f5e6110..468cea4ec 100644
--- a/app/exceptions/locked_error.rb
+++ b/app/exceptions/locked_error.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Raised when reserving on a locked availability
class LockedError < StandardError
end
diff --git a/app/models/accounting_period.rb b/app/models/accounting_period.rb
index 5402781f9..4a5824221 100644
--- a/app/models/accounting_period.rb
+++ b/app/models/accounting_period.rb
@@ -30,7 +30,7 @@ class AccountingPeriod < ApplicationRecord
def invoices_with_vat(invoices)
vat_service = VatHistoryService.new
invoices.map do |i|
- { invoice: i, vat_rate: vat_service.invoice_vat(i) }
+ { invoice: i, vat_rate: vat_service.invoice_vat(i) / 100.0 }
end
end
diff --git a/app/models/availability.rb b/app/models/availability.rb
index d9a7f458c..6cc51bfe3 100644
--- a/app/models/availability.rb
+++ b/app/models/availability.rb
@@ -89,7 +89,8 @@ class Availability < ApplicationRecord
def available_space_places
return unless available_type == 'space'
- ((end_at - start_at) / ApplicationHelper::SLOT_DURATION.minutes).to_i * nb_total_places
+ duration = slot_duration || ApplicationHelper::SLOT_DURATION
+ ((end_at - start_at) / duration.minutes).to_i * nb_total_places
end
def title(filter = {})
@@ -159,9 +160,12 @@ class Availability < ApplicationRecord
private
def length_must_be_slot_multiple
- return unless end_at < (start_at + ApplicationHelper::SLOT_DURATION.minutes)
+ return unless available_type == 'machines' || available_type == 'space'
- errors.add(:end_at, I18n.t('availabilities.length_must_be_slot_multiple', MIN: ApplicationHelper::SLOT_DURATION))
+ duration = slot_duration || ApplicationHelper::SLOT_DURATION
+ return unless end_at < (start_at + duration.minutes)
+
+ errors.add(:end_at, I18n.t('availabilities.length_must_be_slot_multiple', MIN: duration))
end
def should_be_associated
diff --git a/app/models/avoir.rb b/app/models/avoir.rb
index 641a80ce9..ff8e69bc2 100644
--- a/app/models/avoir.rb
+++ b/app/models/avoir.rb
@@ -23,7 +23,7 @@ class Avoir < Invoice
def notify_admins_refund_created
NotificationCenter.call type: 'notify_admin_refund_created',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: self
end
end
diff --git a/app/models/event_price_category.rb b/app/models/event_price_category.rb
index 13a51c672..47b6e8558 100644
--- a/app/models/event_price_category.rb
+++ b/app/models/event_price_category.rb
@@ -15,7 +15,7 @@ class EventPriceCategory < ApplicationRecord
protected
def verify_no_associated_tickets
- throw(:abort) if tickets.count.zero?
+ throw(:abort) unless tickets.count.zero?
end
end
diff --git a/app/models/notification_type.rb b/app/models/notification_type.rb
index 6b01b9104..ba6a20ba6 100644
--- a/app/models/notification_type.rb
+++ b/app/models/notification_type.rb
@@ -51,6 +51,8 @@ class NotificationType
notify_privacy_policy_changed
notify_admin_import_complete
notify_admin_refund_created
+ notify_admins_role_update
+ notify_user_role_update
]
# deprecated:
# - notify_member_subscribed_plan_is_changed
diff --git a/app/models/price.rb b/app/models/price.rb
index 7132fd2dd..023c981d6 100644
--- a/app/models/price.rb
+++ b/app/models/price.rb
@@ -1,5 +1,8 @@
# frozen_string_literal: true
+MINUTES_PER_HOUR = 60.0
+SECONDS_PER_MINUTE = 60.0
+
# Store customized price for various items (Machine, Space), depending on the group and on the plan
# Also provides a static helper method to compute the price details of a shopping cart
class Price < ApplicationRecord
@@ -48,20 +51,20 @@ class Price < ApplicationRecord
when Machine
base_amount = reservable.prices.find_by(group_id: user.group_id, plan_id: plan.try(:id)).amount
if plan
- space_credit = plan.machine_credits.select { |credit| credit.creditable_id == reservable.id }.first
- if space_credit
- hours_available = credits_hours(space_credit, user, new_plan_being_bought)
+ machine_credit = plan.machine_credits.select { |credit| credit.creditable_id == reservable.id }.first
+ if machine_credit
+ hours_available = credits_hours(machine_credit, user, new_plan_being_bought)
slots.each_with_index do |slot, index|
- total_amount += get_slot_price(base_amount, slot, admin, all_elements, (index < hours_available))
+ total_amount += get_slot_price(base_amount, slot, admin, elements: all_elements, has_credits: (index < hours_available))
end
else
slots.each do |slot|
- total_amount += get_slot_price(base_amount, slot, admin, all_elements)
+ total_amount += get_slot_price(base_amount, slot, admin, elements: all_elements)
end
end
else
slots.each do |slot|
- total_amount += get_slot_price(base_amount, slot, admin, all_elements)
+ total_amount += get_slot_price(base_amount, slot, admin, elements: all_elements)
end
end
@@ -83,7 +86,7 @@ class Price < ApplicationRecord
end
end
slots.each do |slot|
- total_amount += get_slot_price(amount, slot, admin, all_elements)
+ total_amount += get_slot_price(amount, slot, admin, elements: all_elements, is_division: false)
end
# Event reservation
@@ -93,7 +96,7 @@ class Price < ApplicationRecord
amount += ticket[:booked] * EventPriceCategory.find(ticket[:event_price_category_id]).amount
end
slots.each do |slot|
- total_amount += get_slot_price(amount, slot, admin, all_elements)
+ total_amount += get_slot_price(amount, slot, admin, elements: all_elements, is_division: false)
end
# Space reservation
@@ -105,16 +108,16 @@ class Price < ApplicationRecord
if space_credit
hours_available = credits_hours(space_credit, user, new_plan_being_bought)
slots.each_with_index do |slot, index|
- total_amount += get_slot_price(base_amount, slot, admin, all_elements, (index < hours_available))
+ total_amount += get_slot_price(base_amount, slot, admin, elements: all_elements, has_credits: (index < hours_available))
end
else
slots.each do |slot|
- total_amount += get_slot_price(base_amount, slot, admin, all_elements)
+ total_amount += get_slot_price(base_amount, slot, admin, elements: all_elements)
end
end
else
slots.each do |slot|
- total_amount += get_slot_price(base_amount, slot, admin, all_elements)
+ total_amount += get_slot_price(base_amount, slot, admin, elements: all_elements)
end
end
@@ -135,29 +138,48 @@ class Price < ApplicationRecord
# === apply Coupon if any ===
_amount_no_coupon = total_amount
- total_amount = CouponService.new.apply(total_amount, coupon_code)
+ cs = CouponService.new
+ cp = cs.validate(coupon_code, user.id)
+ total_amount = cs.apply(total_amount, cp)
# return result
- { elements: all_elements, total: total_amount.to_i, before_coupon: _amount_no_coupon.to_i }
+ { elements: all_elements, total: total_amount.to_i, before_coupon: _amount_no_coupon.to_i, coupon: cp }
end
private
+ GET_SLOT_PRICE_DEFAULT_OPTS = { has_credits: false, elements: nil, is_division: true }.freeze
##
# Compute the price of a single slot, according to the base price and the ability for an admin
# to offer the slot.
- # @param base_amount {Number} base price of a slot
+ # @param hourly_rate {Number} base price of a slot
# @param slot {Hash} Slot object
# @param is_admin {Boolean} true if the current user has the 'admin' role
- # @param [elements] {Array} optional, if provided the resulting price will be append into elements.slots
- # @param [has_credits] {Boolean} true if the user still has credits for the given slot
+ # @param [options] {Hash} optional parameters, allowing the following options:
+ # - elements {Array} if provided the resulting price will be append into elements.slots
+ # - has_credits {Boolean} true if the user still has credits for the given slot, false if not provided
+ # - is_division {boolean} false if the slot covers an full availability, true if it is a subdivision (default)
# @return {Number} price of the slot
##
- def get_slot_price(base_amount, slot, is_admin, elements = nil, has_credits = false)
- ii_amount = has_credits || (slot[:offered] && is_admin) ? 0 : base_amount
- elements[:slots].push(start_at: slot[:start_at], price: ii_amount, promo: (ii_amount != base_amount)) unless elements.nil?
- ii_amount
+ def get_slot_price(hourly_rate, slot, is_admin, options = {})
+ options = GET_SLOT_PRICE_DEFAULT_OPTS.merge(options)
+
+ slot_rate = options[:has_credits] || (slot[:offered] && is_admin) ? 0 : hourly_rate
+ real_price = if options[:is_division]
+ (slot_rate / MINUTES_PER_HOUR) * ((slot[:end_at].to_time - slot[:start_at].to_time) / SECONDS_PER_MINUTE)
+ else
+ slot_rate
+ end
+
+ unless options[:elements].nil?
+ options[:elements][:slots].push(
+ start_at: slot[:start_at],
+ price: real_price,
+ promo: (slot_rate != hourly_rate)
+ )
+ end
+ real_price
end
##
diff --git a/app/models/project.rb b/app/models/project.rb
index c3ad73f78..84aae3fa9 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -144,7 +144,7 @@ class Project < ApplicationRecord
def notify_admin_when_project_published
NotificationCenter.call type: 'notify_admin_when_project_published',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: self
end
diff --git a/app/models/reservation.rb b/app/models/reservation.rb
index cd9ff8d76..bbf9c7bcf 100644
--- a/app/models/reservation.rb
+++ b/app/models/reservation.rb
@@ -33,75 +33,17 @@ class Reservation < ApplicationRecord
##
# Generate an array of {Stripe::InvoiceItem} with the elements in the current reservation, price included.
- # The training/machine price is depending of the member's group, subscription and credits already used
- # @param on_site {Boolean} true if an admin triggered the call
- # @param coupon_code {String} pass a valid code to appy a coupon
+ # @param payment_details {Hash} as generated by Price.compute
##
- def generate_invoice_items(on_site = false, coupon_code = nil)
- # prepare the plan
- plan = if user.subscribed_plan
- user.subscribed_plan
- elsif plan_id
- Plan.find(plan_id)
- else
- nil
- end
-
+ def generate_invoice_items(payment_details = nil)
# check that none of the reserved availabilities was locked
slots.each do |slot|
raise LockedError if slot.availability.lock
end
case reservable
-
- # === Machine reservation ===
- when Machine
- base_amount = reservable.prices.find_by(group_id: user.group_id, plan_id: plan.try(:id)).amount
- users_credits_manager = UsersCredits::Manager.new(reservation: self, plan: plan)
-
- slots.each_with_index do |slot, index|
- description = reservable.name +
- " #{I18n.l slot.start_at, format: :long} - #{I18n.l slot.end_at, format: :hour_minute}"
-
- ii_amount = base_amount # ii_amount default to base_amount
-
- if users_credits_manager.will_use_credits?
- ii_amount = index < users_credits_manager.free_hours_count ? 0 : base_amount
- end
-
- ii_amount = 0 if slot.offered && on_site # if it's a local payment and slot is offered free
-
- invoice.invoice_items.push InvoiceItem.new(
- amount: ii_amount,
- description: description
- )
- end
-
- # === Training reservation ===
- when Training
- base_amount = reservable.amount_by_group(user.group_id).amount
-
- # be careful, variable plan can be the user's plan OR the plan user is currently purchasing
- users_credits_manager = UsersCredits::Manager.new(reservation: self, plan: plan)
- base_amount = 0 if users_credits_manager.will_use_credits?
-
- slots.each do |slot|
- description = reservable.name +
- " #{I18n.l slot.start_at, format: :long} - #{I18n.l slot.end_at, format: :hour_minute}"
- ii_amount = base_amount
- ii_amount = 0 if slot.offered && on_site
- invoice.invoice_items.push InvoiceItem.new(
- amount: ii_amount,
- description: description
- )
- end
-
# === Event reservation ===
when Event
- amount = reservable.amount * nb_reserve_places
- tickets.each do |ticket|
- amount += ticket.booked * ticket.event_price_category.amount
- end
slots.each do |slot|
description = "#{reservable.name}\n"
description += if slot.start_at.to_date != slot.end_at.to_date
@@ -115,69 +57,32 @@ class Reservation < ApplicationRecord
"#{I18n.l slot.start_at.to_date, format: :long} #{I18n.l slot.start_at, format: :hour_minute}" \
" - #{I18n.l slot.end_at, format: :hour_minute}"
end
- ii_amount = amount
- ii_amount = 0 if slot.offered && on_site
+
+ price_slot = payment_details[:elements][:slots].detect { |p_slot| p_slot[:start_at].to_time.in_time_zone == slot[:start_at] }
invoice.invoice_items.push InvoiceItem.new(
- amount: ii_amount,
+ amount: price_slot[:price],
description: description
)
end
-
- # === Space reservation ===
- when Space
- base_amount = reservable.prices.find_by(group_id: user.group_id, plan_id: plan.try(:id)).amount
- users_credits_manager = UsersCredits::Manager.new(reservation: self, plan: plan)
-
- slots.each_with_index do |slot, index|
- description = reservable.name + " #{I18n.l slot.start_at, format: :long} - #{I18n.l slot.end_at, format: :hour_minute}"
-
- ii_amount = base_amount # ii_amount default to base_amount
-
- if users_credits_manager.will_use_credits?
- ii_amount = index < users_credits_manager.free_hours_count ? 0 : base_amount
- end
-
- ii_amount = 0 if slot.offered && on_site # if it's a local payment and slot is offered free
-
- invoice.invoice_items.push InvoiceItem.new(
- amount: ii_amount,
- description: description
- )
- end
-
- # === Unknown reservation type ===
+ # === Space|Machine|Training reservation ===
else
- raise NotImplementedError
+ slots.each do |slot|
+ description = reservable.name +
+ " #{I18n.l slot.start_at, format: :long} - #{I18n.l slot.end_at, format: :hour_minute}"
+ price_slot = payment_details[:elements][:slots].detect { |p_slot| p_slot[:start_at].to_time.in_time_zone == slot[:start_at] }
+ invoice.invoice_items.push InvoiceItem.new(
+ amount: price_slot[:price],
+ description: description
+ )
+ end
end
# === Coupon ===
- unless coupon_code.nil?
- @coupon = Coupon.find_by(code: coupon_code)
- raise InvalidCouponError if @coupon.nil? || @coupon.status(user.id) != 'active'
-
- total = cart_total
-
- discount = if @coupon.type == 'percent_off'
- (total * @coupon.percent_off / 100).to_i
- elsif @coupon.type == 'amount_off'
- @coupon.amount_off
- else
- raise InvalidCouponError
- end
- end
+ @coupon = payment_details[:coupon]
+ # === Wallet ===
@wallet_amount_debit = wallet_amount_debit
- # if @wallet_amount_debit != 0 && !on_site
- # invoice_items << Stripe::InvoiceItem.create(
- # customer: user.stp_customer_id,
- # amount: -@wallet_amount_debit.to_i,
- # currency: Rails.application.secrets.stripe_currency,
- # description: "wallet -#{@wallet_amount_debit / 100.0}"
- # )
- # end
-
- true
end
# check reservation amount total and strip invoice total to pay is equal
@@ -211,8 +116,9 @@ class Reservation < ApplicationRecord
pending_invoice_items.each(&:delete)
end
- def save_with_payment(operator_profile_id, coupon_code = nil, payment_intent_id = nil)
- method = InvoicingProfile.find(operator_profile_id)&.user&.admin? ? nil : 'stripe'
+ def save_with_payment(operator_profile_id, payment_details, payment_intent_id = nil)
+ operator = InvoicingProfile.find(operator_profile_id)&.user
+ method = operator&.admin? || (operator&.manager? && operator != user) ? nil : 'stripe'
build_invoice(
invoicing_profile: user.invoicing_profile,
@@ -221,7 +127,7 @@ class Reservation < ApplicationRecord
stp_payment_intent_id: payment_intent_id,
payment_method: method
)
- generate_invoice_items(true, coupon_code)
+ generate_invoice_items(payment_details)
return false unless valid?
@@ -230,18 +136,18 @@ class Reservation < ApplicationRecord
subscription.attributes = { plan_id: plan_id, statistic_profile_id: statistic_profile_id, expiration_date: nil }
if subscription.save_with_payment(operator_profile_id, false)
invoice.invoice_items.push InvoiceItem.new(
- amount: subscription.plan.amount,
+ amount: payment_details[:elements][:plan],
description: subscription.plan.name,
subscription_id: subscription.id
)
- set_total_and_coupon(coupon_code)
+ set_total_and_coupon(payment_details[:coupon])
save!
else
errors[:card] << subscription.errors[:card].join
return false
end
else
- set_total_and_coupon(coupon_code)
+ set_total_and_coupon(payment_details[:coupon])
save!
end
@@ -306,7 +212,7 @@ class Reservation < ApplicationRecord
def notify_admin_member_create_reservation
NotificationCenter.call type: 'notify_admin_member_create_reservation',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: self
end
@@ -354,17 +260,14 @@ class Reservation < ApplicationRecord
##
# Set the total price to the reservation's invoice, summing its whole items.
# Additionally a coupon may be applied to this invoice to make a discount on the total price
- # @param [coupon_code] {String} optional coupon code to apply to the invoice
+ # @param [coupon] {Coupon} optional coupon to apply to the invoice
##
- def set_total_and_coupon(coupon_code = nil)
+ def set_total_and_coupon(coupon = nil)
total = invoice.invoice_items.map(&:amount).map(&:to_i).reduce(:+)
- unless coupon_code.nil?
- cp = Coupon.find_by(code: coupon_code)
- raise InvalidCouponError unless !cp.nil? && cp.status(user.id) == 'active'
-
- total = CouponService.new.apply(total, cp, user.id)
- invoice.coupon_id = cp.id
+ unless coupon.nil?
+ total = CouponService.new.apply(total, coupon, user.id)
+ invoice.coupon_id = coupon.id
end
invoice.total = total
diff --git a/app/models/slot.rb b/app/models/slot.rb
index b44e30775..9341d52ea 100644
--- a/app/models/slot.rb
+++ b/app/models/slot.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
-# Time range of duration defined by ApplicationHelper::SLOT_DURATION, slicing an Availability.
+# Time range, slicing an Availability.
+# Its duration is defined by globally by ApplicationHelper::SLOT_DURATION but can be overridden per availability
# During a slot a Reservation is possible
# Only reserved slots are persisted in DB, others are instantiated on the fly
class Slot < ApplicationRecord
@@ -39,7 +40,7 @@ class Slot < ApplicationRecord
receiver: reservation.user,
attached_object: self
NotificationCenter.call type: 'notify_admin_slot_is_modified',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: self
end
@@ -48,7 +49,7 @@ class Slot < ApplicationRecord
receiver: reservation.user,
attached_object: self
NotificationCenter.call type: 'notify_admin_slot_is_canceled',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: self
end
diff --git a/app/models/stylesheet.rb b/app/models/stylesheet.rb
index aceeab8de..6f9f9ecf2 100644
--- a/app/models/stylesheet.rb
+++ b/app/models/stylesheet.rb
@@ -4,9 +4,14 @@
# a picture for the background of the user's profile.
# There's only one stylesheet record in the database, which is updated on each colour change.
class Stylesheet < ApplicationRecord
+
+ # brightness limits to change the font color to black or white
+ BRIGHTNESS_HIGH_LIMIT = 160
+ BRIGHTNESS_LOW_LIMIT = 40
+
validates_presence_of :contents
- ## ===== THEME =====
+ ## ===== COMMON =====
def rebuild!
if Stylesheet.primary && Stylesheet.secondary && name == 'theme'
@@ -16,7 +21,9 @@ class Stylesheet < ApplicationRecord
end
end
- def self.build_sheet!
+ ## ===== THEME =====
+
+ def self.build_theme!
return unless Stylesheet.primary && Stylesheet.secondary
if Stylesheet.theme
@@ -58,45 +65,59 @@ class Stylesheet < ApplicationRecord
Stylesheet.find_by(name: 'theme')
end
+ def self.primary_text_color
+ Stylesheet.primary.paint.brightness >= BRIGHTNESS_HIGH_LIMIT ? 'black' : 'white'
+ end
+
+ def self.primary_decoration_color
+ Stylesheet.primary.paint.brightness <= BRIGHTNESS_LOW_LIMIT ? 'white' : 'black'
+ end
+
+ def self.secondary_text_color
+ Stylesheet.secondary.paint.brightness <= BRIGHTNESS_LOW_LIMIT ? 'white' : 'black'
+ end
+
def self.css # rubocop:disable Metrics/AbcSize
<<~CSS
.bg-red { background-color: #{Stylesheet.primary}; }
.bg-red-dark { background-color: #{Stylesheet.primary}; }
#nav .nav { background-color: #{Stylesheet.primary}; }
- #nav .nav > li > a { color: white; }
- #nav .nav > li > a:hover, #nav .nav > li > a:focus { background-color: #{Stylesheet.primary_light}; }
- #nav .nav > li > a.active { border-left: 3px solid #{Stylesheet.primary_dark}; background-color: #{Stylesheet.primary_light}; }
- #nav .nav > li > a.active { border-left: 3px solid #{Stylesheet.primary_dark}; background-color: #{Stylesheet.primary_light}; }
- .btn-theme { background-color: #{Stylesheet.primary}; color: white; }
- .btn-theme:active, .btn-theme:hover { background-color: #{Stylesheet.primary_dark}; }
- .label-theme { background-color: #{Stylesheet.primary} }
+ #nav .nav > li > a { color: #{Stylesheet.primary_text_color}; }
+ #nav .nav > li > a:hover, #nav .nav > li > a:focus { background-color: #{Stylesheet.primary_light}; color: #{Stylesheet.primary_text_color}; }
+ #nav .nav > li > a.active { border-left: 3px solid #{Stylesheet.primary_dark}; background-color: #{Stylesheet.primary_light}; color: #{Stylesheet.primary_text_color}; }
+ .nav-primary ul.nav > li.menu-spacer { background: linear-gradient(45deg, #{Stylesheet.primary_decoration_color}, transparent); }
+ .nav-primary .text-bordeau { color: #{Stylesheet.primary_decoration_color}; }
+ .btn-theme { background-color: #{Stylesheet.primary}; color: #{Stylesheet.primary_text_color}; }
+ .btn-theme:active, .btn-theme:hover { background-color: #{Stylesheet.primary_dark}; color: #{Stylesheet.primary_text_color}; }
+ .label-theme { background-color: #{Stylesheet.primary}; color: #{Stylesheet.primary_text_color}; }
.btn-link { color: #{Stylesheet.primary} !important; }
.btn-link:hover { color: #{Stylesheet.primary_dark} !important; }
a { color: #{Stylesheet.primary}; }
a:hover, a:focus { color: #{Stylesheet.primary_dark}; }
h2, h3, h5 { color: #{Stylesheet.primary}; }
h5:after { background-color: #{Stylesheet.primary}; }
- .bg-yellow { background-color: #{Stylesheet.secondary} !important; }
- .event:hover { background-color: #{Stylesheet.primary}; }
+ .bg-yellow { background-color: #{Stylesheet.secondary} !important; color: #{Stylesheet.secondary_text_color}; }
+ .event:hover { background-color: #{Stylesheet.primary}; color: #{Stylesheet.secondary_text_color}; }
.widget h3 { color: #{Stylesheet.primary}; }
.modal-header h1, .custom-invoice .modal-header h1 { color: #{Stylesheet.primary}; }
- .block-link:hover, .fc-toolbar .fc-button:hover, .fc-toolbar .fc-button:active, .fc-toolbar .fc-button.fc-state-active { background-color: #{Stylesheet.secondary}; }
+ .block-link:hover, .fc-toolbar .fc-button:hover, .fc-toolbar .fc-button:active, .fc-toolbar .fc-button.fc-state-active { background-color: #{Stylesheet.secondary}; color: #{Stylesheet.secondary_text_color} !important; }
+ .block-link:hover .user-name { color: #{Stylesheet.secondary_text_color} !important; }
.carousel-control:hover, .carousel-control:focus, .carousel-caption .title a:hover { color: #{Stylesheet.secondary}; }
- .well.well-warning { border-color: #{Stylesheet.secondary}; background-color: #{Stylesheet.secondary}; }
+ .well.well-warning { border-color: #{Stylesheet.secondary}; background-color: #{Stylesheet.secondary}; color: #{Stylesheet.secondary_text_color}; }
.text-yellow { color: #{Stylesheet.secondary} !important; }
.red { color: #{Stylesheet.primary} !important; }
- .btn-warning, .editable-buttons button[type=submit].btn-primary { background-color: #{Stylesheet.secondary} !important; border-color: #{Stylesheet.secondary} !important; }
- .btn-warning:hover, .editable-buttons button[type=submit].btn-primary:hover, .btn-warning:focus, .editable-buttons button[type=submit].btn-primary:focus, .btn-warning.focus, .editable-buttons button.focus[type=submit].btn-primary, .btn-warning:active, .editable-buttons button[type=submit].btn-primary:active, .btn-warning.active, .editable-buttons button.active[type=submit].btn-primary, .open > .btn-warning.dropdown-toggle, .editable-buttons .open > button.dropdown-toggle[type=submit].btn-primary { background-color: #{Stylesheet.secondary_dark} !important; border-color: #{Stylesheet.secondary_dark} !important; }
- .btn-warning-full { border-color: #{Stylesheet.secondary}; background-color: #{Stylesheet.secondary}; }
- .heading .heading-btn a:hover { background-color: #{Stylesheet.secondary}; }
+ .btn-warning, .editable-buttons button[type=submit].btn-primary { background-color: #{Stylesheet.secondary} !important; border-color: #{Stylesheet.secondary} !important; color: #{Stylesheet.secondary_text_color}; }
+ .btn-warning:hover, .editable-buttons button[type=submit].btn-primary:hover, .btn-warning:focus, .editable-buttons button[type=submit].btn-primary:focus, .btn-warning.focus, .editable-buttons button.focus[type=submit].btn-primary, .btn-warning:active, .editable-buttons button[type=submit].btn-primary:active, .btn-warning.active, .editable-buttons button.active[type=submit].btn-primary, .open > .btn-warning.dropdown-toggle, .editable-buttons .open > button.dropdown-toggle[type=submit].btn-primary { background-color: #{Stylesheet.secondary_dark} !important; border-color: #{Stylesheet.secondary_dark} !important; color: #{Stylesheet.secondary_text_color}; }
+ .btn-warning-full { border-color: #{Stylesheet.secondary}; background-color: #{Stylesheet.secondary}; color: #{Stylesheet.secondary_text_color} !important; }
+ .heading .heading-btn a:hover { background-color: #{Stylesheet.secondary}; color: #{Stylesheet.secondary_text_color}; }
.pricing-panel .content .wrap { border-color: #{Stylesheet.secondary}; }
- .pricing-panel .cta-button .btn:hover, .pricing-panel .cta-button .custom-invoice .modal-body .elements li:hover, .custom-invoice .modal-body .elements .pricing-panel .cta-button li:hover { background-color: #{Stylesheet.secondary} !important; }
+ .pricing-panel .cta-button .btn:hover, .pricing-panel .cta-button .custom-invoice .modal-body .elements li:hover, .custom-invoice .modal-body .elements .pricing-panel .cta-button li:hover { background-color: #{Stylesheet.secondary} !important; color: #{Stylesheet.secondary_text_color}; }
a.label:hover, .form-control.form-control-ui-select .select2-choices a.select2-search-choice:hover, a.label:focus, .form-control.form-control-ui-select .select2-choices a.select2-search-choice:focus { color: #{Stylesheet.primary}; }
.about-picture { background: linear-gradient( rgba(255,255,255,0.12), rgba(255,255,255,0.13) ), linear-gradient( #{Stylesheet.primary_with_alpha(0.78)}, #{Stylesheet.primary_with_alpha(0.82)} ), url('/about-fablab.jpg') no-repeat; }
- .social-icons > div:hover { background-color: #{Stylesheet.secondary}; }
+ .social-icons > div:hover { background-color: #{Stylesheet.secondary}; color: #{Stylesheet.secondary_text_color}; }
.profile-top { background: linear-gradient( rgba(255,255,255,0.12), rgba(255,255,255,0.13) ), linear-gradient(#{Stylesheet.primary_with_alpha(0.78)}, #{Stylesheet.primary_with_alpha(0.82)} ), url('#{CustomAsset.get_url('profile-image-file') || '/about-fablab.jpg'}') no-repeat; }
- .profile-top .social-links a:hover { background-color: #{Stylesheet.secondary} !important; border-color: #{Stylesheet.secondary} !important; }
- section#cookies-modal div.cookies-consent .cookies-actions button.accept { background-color: #{Stylesheet.secondary}; }
+ .profile-top .social-links a:hover { background-color: #{Stylesheet.secondary} !important; border-color: #{Stylesheet.secondary} !important; color: #{Stylesheet.secondary_text_color}; }
+ section#cookies-modal div.cookies-consent .cookies-actions button.accept { background-color: #{Stylesheet.secondary}; color: #{Stylesheet.secondary_text_color}; }
CSS
end
diff --git a/app/models/subscription.rb b/app/models/subscription.rb
index 0bc6e93c3..fcd0fa327 100644
--- a/app/models/subscription.rb
+++ b/app/models/subscription.rb
@@ -46,7 +46,8 @@ class Subscription < ApplicationRecord
def generate_invoice(operator_profile_id, coupon_code = nil, payment_intent_id = nil)
coupon_id = nil
total = plan.amount
- method = InvoicingProfile.find(operator_profile_id)&.user&.admin? ? nil : 'stripe'
+ operator = InvoicingProfile.find(operator_profile_id)&.user
+ method = operator&.admin? || (operator&.manager? && operator != user) ? nil : 'stripe'
unless coupon_code.nil?
@coupon = Coupon.find_by(code: coupon_code)
@@ -148,7 +149,7 @@ class Subscription < ApplicationRecord
def notify_admin_subscription_canceled
NotificationCenter.call type: 'notify_admin_subscription_canceled',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: self
end
@@ -173,7 +174,7 @@ class Subscription < ApplicationRecord
meta_data: meta_data
NotificationCenter.call type: :notify_admin_subscription_extended,
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: self,
meta_data: meta_data
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 9f580e3e1..9be269857 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -97,6 +97,22 @@ class User < ApplicationRecord
User.with_role(:member)
end
+ def self.partners
+ User.with_role(:partner)
+ end
+
+ def self.managers
+ User.with_role(:manager)
+ end
+
+ def self.admins_and_managers
+ User.with_any_role(:admin, :manager)
+ end
+
+ def self.online_payers
+ User.with_any_role(:manager, :member)
+ end
+
def self.superadmin
return unless Rails.application.secrets.superadmin_email.present?
@@ -104,7 +120,7 @@ class User < ApplicationRecord
end
def training_machine?(machine)
- return true if admin?
+ return true if admin? || manager?
trainings.map(&:machines).flatten.uniq.include?(machine)
end
@@ -131,6 +147,26 @@ class User < ApplicationRecord
has_role? :member
end
+ def manager?
+ has_role? :manager
+ end
+
+ def partner?
+ has_role? :partner
+ end
+
+ def role
+ if admin?
+ 'admin'
+ elsif manager?
+ 'manager'
+ elsif member?
+ 'member'
+ else
+ 'other'
+ end
+ end
+
def all_projects
my_projects.to_a.concat projects
end
@@ -160,7 +196,7 @@ class User < ApplicationRecord
auth.info.mapping.each do |key, value|
user.set_data_from_sso_mapping(key, value)
end
- user.password = Devise.friendly_token[0,20]
+ user.password = Devise.friendly_token[0, 20]
end
end
@@ -285,7 +321,7 @@ class User < ApplicationRecord
protected
- # remove projets drafts that are not linked to another user
+ # remove projects drafts that are not linked to another user
def remove_orphan_drafts
orphans = my_projects
.joins('LEFT JOIN project_users ON projects.id = project_users.project_id')
@@ -332,19 +368,19 @@ class User < ApplicationRecord
attached_object: self
else
NotificationCenter.call type: 'notify_admin_when_user_is_created',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: self
end
end
def notify_group_changed
- return if changes[:group_id].first.nil?
+ return unless changes[:group_id]&.first
ex_group = Group.find(changes[:group_id].first)
meta_data = { ex_group_name: ex_group.name }
NotificationCenter.call type: :notify_admin_user_group_changed,
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: self,
meta_data: meta_data
diff --git a/app/policies/accounting_period_policy.rb b/app/policies/accounting_period_policy.rb
index 158ee8dc8..bd153c5ef 100644
--- a/app/policies/accounting_period_policy.rb
+++ b/app/policies/accounting_period_policy.rb
@@ -2,9 +2,13 @@
# Check the access policies for API::AccountingPeriodsController
class AccountingPeriodPolicy < ApplicationPolicy
- %w[index show create last_closing_end download_archive].each do |action|
+ %w[index show create download_archive].each do |action|
define_method "#{action}?" do
user.admin?
end
end
+
+ def last_closing_end?
+ user.admin? || user.manager?
+ end
end
diff --git a/app/policies/admin_policy.rb b/app/policies/admin_policy.rb
index 7f0175238..3d76f15fe 100644
--- a/app/policies/admin_policy.rb
+++ b/app/policies/admin_policy.rb
@@ -1,6 +1,6 @@
class AdminPolicy < ApplicationPolicy
def index?
- user.admin?
+ user.admin? || user.manager?
end
def create?
diff --git a/app/policies/availability_policy.rb b/app/policies/availability_policy.rb
index 54587757e..7f2736070 100644
--- a/app/policies/availability_policy.rb
+++ b/app/policies/availability_policy.rb
@@ -1,7 +1,14 @@
+# frozen_string_literal: true
+
+# Check the access policies for API::AvailabilitiesController
class AvailabilityPolicy < ApplicationPolicy
- %w(index? show? create? update? destroy? reservations? export? lock?).each do |action|
+ %w[index? show? create? update? destroy? reservations? lock?].each do |action|
define_method action do
- user.admin?
+ user.admin? || user.manager?
end
end
+
+ def export?
+ user.admin?
+ end
end
diff --git a/app/policies/event_policy.rb b/app/policies/event_policy.rb
index c6855ba0b..4db834236 100644
--- a/app/policies/event_policy.rb
+++ b/app/policies/event_policy.rb
@@ -18,7 +18,7 @@ class EventPolicy < ApplicationPolicy
end
def create?
- user.admin?
+ user.admin? || user.manager?
end
def update?
diff --git a/app/policies/i_calendar_policy.rb b/app/policies/i_calendar_policy.rb
index fd4021814..93e3fcc60 100644
--- a/app/policies/i_calendar_policy.rb
+++ b/app/policies/i_calendar_policy.rb
@@ -3,10 +3,10 @@
# Check the access policies for API::ICalendarController
class ICalendarPolicy < ApplicationPolicy
def create?
- user.admin?
+ user.admin? || user.manager?
end
def destroy?
- user.admin?
+ user.admin? || user.manager?
end
end
diff --git a/app/policies/invoice_policy.rb b/app/policies/invoice_policy.rb
index 4f22a18e6..0575c16c5 100644
--- a/app/policies/invoice_policy.rb
+++ b/app/policies/invoice_policy.rb
@@ -1,18 +1,21 @@
+# frozen_string_literal: true
+
+# Check the access policies for API::InvoicesController
class InvoicePolicy < ApplicationPolicy
def index?
user.admin?
end
def download?
- user.admin? or (record.invoicing_profile.user_id == user.id)
+ user.admin? || user.manager? || (record.invoicing_profile.user_id == user.id)
end
def create?
- user.admin?
+ user.admin? || user.manager?
end
def list?
- user.admin?
+ user.admin? || user.manager?
end
def first?
diff --git a/app/policies/reservation_context.rb b/app/policies/reservation_context.rb
index 22a309e94..d5db15422 100644
--- a/app/policies/reservation_context.rb
+++ b/app/policies/reservation_context.rb
@@ -2,11 +2,12 @@
# Pundit Additional context to validate the price of a reservation
class ReservationContext
- attr_reader :reservation, :price
+ attr_reader :reservation, :price, :user_id
- def initialize(reservation, price)
+ def initialize(reservation, price, user_id)
@reservation = reservation
@price = price
+ @user_id = user_id
end
def policy_class
diff --git a/app/policies/reservation_policy.rb b/app/policies/reservation_policy.rb
index 79004d3c9..61b7c145a 100644
--- a/app/policies/reservation_policy.rb
+++ b/app/policies/reservation_policy.rb
@@ -3,10 +3,10 @@
# Check the access policies for API::ReservationsController
class ReservationPolicy < ApplicationPolicy
def create?
- user.admin? || record.price.zero?
+ user.admin? || (user.manager? && record.user_id != user.id) || record.price.zero?
end
def update?
- user.admin? || record.user == user
+ user.admin? || user.manager? || record.user == user
end
end
diff --git a/app/policies/slot_policy.rb b/app/policies/slot_policy.rb
index 3ec6819b9..a7240c230 100644
--- a/app/policies/slot_policy.rb
+++ b/app/policies/slot_policy.rb
@@ -1,15 +1,18 @@
+# frozen_string_literal: true
+
+# Check the access policies for API::SlotsController
class SlotPolicy < ApplicationPolicy
def update?
# check that the update is allowed and the prevention delay has not expired
- delay = Setting.find_by( name: 'booking_move_delay').value.to_i
- enabled = (Setting.find_by( name: 'booking_move_enable').value == 'true')
+ delay = Setting.find_by(name: 'booking_move_delay').value.to_i
+ enabled = (Setting.find_by(name: 'booking_move_enable').value == 'true')
# these condition does not apply to admins
- user.admin? or
- (record.reservation.user == user and enabled and ((record.start_at - DateTime.current).to_i / 3600 >= delay))
+ user.admin? || user.manager? ||
+ (record.reservation.user == user && enabled && ((record.start_at - DateTime.current).to_i / 3600 >= delay))
end
def cancel?
- user.admin? or record.reservation.user == user
+ user.admin? || user.manager? || record.reservation.user == user
end
end
diff --git a/app/policies/subscription_context.rb b/app/policies/subscription_context.rb
index aa2c134f6..e784814a4 100644
--- a/app/policies/subscription_context.rb
+++ b/app/policies/subscription_context.rb
@@ -2,11 +2,12 @@
# Pundit Additional context to validate the price of a subscription
class SubscriptionContext
- attr_reader :subscription, :price
+ attr_reader :subscription, :price, :user_id
- def initialize(subscription, price)
+ def initialize(subscription, price, user_id)
@subscription = subscription
@price = price
+ @user_id = user_id
end
def policy_class
diff --git a/app/policies/subscription_policy.rb b/app/policies/subscription_policy.rb
index d21f9ba24..e556189a0 100644
--- a/app/policies/subscription_policy.rb
+++ b/app/policies/subscription_policy.rb
@@ -4,7 +4,7 @@
class SubscriptionPolicy < ApplicationPolicy
include FablabConfiguration
def create?
- !fablab_plans_deactivated? && (user.admin? || record.price.zero?)
+ !fablab_plans_deactivated? && (user.admin? || (user.manager? && record.user_id != user.id) || record.price.zero?)
end
def show?
@@ -12,6 +12,6 @@ class SubscriptionPolicy < ApplicationPolicy
end
def update?
- user.admin?
+ user.admin? || (user.manager? && record.user.id != user.id)
end
end
diff --git a/app/policies/training_policy.rb b/app/policies/training_policy.rb
index d41cb5ff1..585f1d7b5 100644
--- a/app/policies/training_policy.rb
+++ b/app/policies/training_policy.rb
@@ -1,3 +1,6 @@
+# frozen_string_literal: true
+
+# Check the access policies for API::TrainingsController
class TrainingPolicy < ApplicationPolicy
class Scope < Scope
def resolve
@@ -5,17 +8,19 @@ class TrainingPolicy < ApplicationPolicy
end
end
- %w(create update).each do |action|
- define_method "#{action}?" do
- user.admin?
- end
+ def create
+ user.admin?
+ end
+
+ def update?
+ user.admin? || user.manager?
end
def destroy?
- user.admin? and record.destroyable?
+ user.admin? && record.destroyable?
end
def availabilities?
- user.admin?
+ user.admin? || user.manager?
end
end
diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb
index 6bf1bf9b0..2208c4f2d 100644
--- a/app/policies/user_policy.rb
+++ b/app/policies/user_policy.rb
@@ -16,26 +16,30 @@ class UserPolicy < ApplicationPolicy
end
def show?
- user.admin? || (record.is_allow_contact && record.member?) || (user.id == record.id)
+ user.admin? || user.manager? || (record.is_allow_contact && record.member?) || (user.id == record.id)
end
def update?
- user.admin? || (user.id == record.id)
+ user.admin? || user.manager? || (user.id == record.id)
end
def destroy?
user.admin? || (user.id == record.id)
end
- def merge?
- user.id == record.id
+ %w[merge complete_tour].each do |action|
+ define_method "#{action}?" do
+ user.id == record.id
+ end
end
- def complete_tour?
- user.id == record.id
+ %w[list index create_member].each do |action|
+ define_method "#{action}?" do
+ user.admin? || user.manager?
+ end
end
- %w[list create mapping].each do |action|
+ %w[create mapping update_role].each do |action|
define_method "#{action}?" do
user.admin?
end
diff --git a/app/policies/wallet_policy.rb b/app/policies/wallet_policy.rb
index 2a3442f88..680dee5c1 100644
--- a/app/policies/wallet_policy.rb
+++ b/app/policies/wallet_policy.rb
@@ -1,13 +1,14 @@
-class WalletPolicy < ApplicationPolicy
- def by_user?
- user.admin? or user == record.user
- end
+# frozen_string_literal: true
- def transactions?
- user.admin? or user == record.user
+# Check the access policies for API::WalletController
+class WalletPolicy < ApplicationPolicy
+ %w[by_user transactions].each do |action|
+ define_method "#{action}?" do
+ user.admin? || user.manager? || user == record.user
+ end
end
def credit?
- user.admin?
+ user.admin? || (user.manager? && user != record.user)
end
end
diff --git a/app/services/availabilities/availabilities_service.rb b/app/services/availabilities/availabilities_service.rb
index 98cadc034..9c4b77696 100644
--- a/app/services/availabilities/availabilities_service.rb
+++ b/app/services/availabilities/availabilities_service.rb
@@ -17,12 +17,13 @@ class Availabilities::AvailabilitiesService
slots = []
availabilities.each do |a|
- ((a.end_at - a.start_at) / ApplicationHelper::SLOT_DURATION.minutes).to_i.times do |i|
- next unless (a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes) > DateTime.current || user.admin?
+ slot_duration = a.slot_duration || ApplicationHelper::SLOT_DURATION
+ ((a.end_at - a.start_at) / slot_duration.minutes).to_i.times do |i|
+ next unless (a.start_at + (i * slot_duration).minutes) > DateTime.current || user.admin?
slot = Slot.new(
- start_at: a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes,
- end_at: a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes + ApplicationHelper::SLOT_DURATION.minutes,
+ start_at: a.start_at + (i * slot_duration).minutes,
+ end_at: a.start_at + (i * slot_duration).minutes + slot_duration.minutes,
availability_id: a.id,
availability: a,
machine: machine,
@@ -43,12 +44,13 @@ class Availabilities::AvailabilitiesService
slots = []
availabilities.each do |a|
- ((a.end_at - a.start_at) / ApplicationHelper::SLOT_DURATION.minutes).to_i.times do |i|
- next unless (a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes) > DateTime.current || user.admin?
+ slot_duration = a.slot_duration || ApplicationHelper::SLOT_DURATION
+ ((a.end_at - a.start_at) / slot_duration.minutes).to_i.times do |i|
+ next unless (a.start_at + (i * slot_duration).minutes) > DateTime.current || user.admin?
slot = Slot.new(
- start_at: a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes,
- end_at: a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes + ApplicationHelper::SLOT_DURATION.minutes,
+ start_at: a.start_at + (i * slot_duration).minutes,
+ end_at: a.start_at + (i * slot_duration).minutes + slot_duration.minutes,
availability_id: a.id,
availability: a,
space: space,
@@ -99,7 +101,7 @@ class Availabilities::AvailabilitiesService
end
def availabilities(reservable, type, user)
- if user.admin?
+ if user.admin? || user.manager?
reservable.availabilities
.includes(:tags)
.where('end_at > ? AND available_type = ?', 1.month.ago, type)
diff --git a/app/services/availabilities/public_availabilities_service.rb b/app/services/availabilities/public_availabilities_service.rb
index 9c3f63a0f..1f55330ff 100644
--- a/app/services/availabilities/public_availabilities_service.rb
+++ b/app/services/availabilities/public_availabilities_service.rb
@@ -15,13 +15,14 @@ class Availabilities::PublicAvailabilitiesService
.where(lock: false)
slots = []
availabilities.each do |a|
+ slot_duration = a.slot_duration || ApplicationHelper::SLOT_DURATION
a.machines.each do |machine|
next unless machine_ids&.include?(machine.id.to_s)
- ((a.end_at - a.start_at) / ApplicationHelper::SLOT_DURATION.minutes).to_i.times do |i|
+ ((a.end_at - a.start_at) / slot_duration.minutes).to_i.times do |i|
slot = Slot.new(
- start_at: a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes,
- end_at: a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes + ApplicationHelper::SLOT_DURATION.minutes,
+ start_at: a.start_at + (i * slot_duration).minutes,
+ end_at: a.start_at + (i * slot_duration).minutes + slot_duration.minutes,
availability_id: a.id,
availability: a,
machine: machine,
@@ -45,13 +46,14 @@ class Availabilities::PublicAvailabilitiesService
slots = []
availabilities.each do |a|
+ slot_duration = a.slot_duration || ApplicationHelper::SLOT_DURATION
space = a.spaces.first
- ((a.end_at - a.start_at) / ApplicationHelper::SLOT_DURATION.minutes).to_i.times do |i|
- next unless (a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes) > DateTime.current
+ ((a.end_at - a.start_at) / slot_duration.minutes).to_i.times do |i|
+ next unless (a.start_at + (i * slot_duration).minutes) > DateTime.current
slot = Slot.new(
- start_at: a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes,
- end_at: a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes + ApplicationHelper::SLOT_DURATION.minutes,
+ start_at: a.start_at + (i * slot_duration).minutes,
+ end_at: a.start_at + (i * slot_duration).minutes + slot_duration.minutes,
availability_id: a.id,
availability: a,
space: space,
diff --git a/app/services/coupon_service.rb b/app/services/coupon_service.rb
index a81055bf8..dde414508 100644
--- a/app/services/coupon_service.rb
+++ b/app/services/coupon_service.rb
@@ -36,6 +36,21 @@ class CouponService
price
end
+ ##
+ # Find the coupon associated with the given code and check it is valid for the given user
+ # @param code {String} the literal code of the coupon
+ # @param user_id {Number} identifier of the user who is applying the coupon
+ # @return {Coupon}
+ ##
+ def validate(code, user_id)
+ return nil unless code && user_id
+
+ coupon = Coupon.find_by(code: code)
+ raise InvalidCouponError if coupon.nil? || coupon.status(user_id) != 'active'
+
+ coupon
+ end
+
##
# Ventilate the discount of the provided coupon over the given amount proportionately to the invoice's total
# @param total {Number} total amount of the invoice expressed in monetary units
diff --git a/app/services/members/list_service.rb b/app/services/members/list_service.rb
index d1a170544..7b7c8d429 100644
--- a/app/services/members/list_service.rb
+++ b/app/services/members/list_service.rb
@@ -50,7 +50,7 @@ class Members::ListService
'SELECT max("created_at") ' \
'FROM "subscriptions" ' \
'WHERE "statistic_profile_id" = "statistic_profiles"."id")')
- .where("users.is_active = 'true' AND roles.name = 'member'")
+ .where("users.is_active = 'true' AND (roles.name = 'member' OR roles.name = 'manager')")
.limit(50)
query.downcase.split(' ').each do |word|
members = members.where('lower(f_unaccent(profiles.first_name)) ~ :search OR ' \
diff --git a/app/services/reservations/reserve.rb b/app/services/reservations/reserve.rb
index 7c9cd9e98..b83aa0bd4 100644
--- a/app/services/reservations/reserve.rb
+++ b/app/services/reservations/reserve.rb
@@ -9,8 +9,8 @@ class Reservations::Reserve
@operator_profile_id = operator_profile_id
end
- def pay_and_save(reservation, coupon: nil, payment_intent_id: nil)
+ def pay_and_save(reservation, payment_details: nil, payment_intent_id: nil)
reservation.statistic_profile_id = StatisticProfile.find_by(user_id: user_id).id
- reservation.save_with_payment(operator_profile_id, coupon, payment_intent_id)
+ reservation.save_with_payment(operator_profile_id, payment_details, payment_intent_id)
end
end
diff --git a/app/services/user_service.rb b/app/services/user_service.rb
index 4b2154dbc..77f40c6cf 100644
--- a/app/services/user_service.rb
+++ b/app/services/user_service.rb
@@ -50,4 +50,19 @@ class UserService
end
{ saved: saved, user: admin }
end
+
+ def self.create_manager(params)
+ generated_password = Devise.friendly_token.first(8)
+ manager = User.new(params.merge(password: generated_password))
+ manager.send :set_slug
+
+ saved = manager.save
+ if saved
+ manager.send_confirmation_instructions
+ manager.add_role(:manager)
+ manager.remove_role(:member)
+ UsersMailer.delay.notify_user_account_created(manager, generated_password)
+ end
+ { saved: saved, user: manager }
+ end
end
diff --git a/app/services/users_credits/manager.rb b/app/services/users_credits/manager.rb
index edc89dd62..c2e3ad6c5 100644
--- a/app/services/users_credits/manager.rb
+++ b/app/services/users_credits/manager.rb
@@ -1,8 +1,11 @@
+# frozen_string_literal: true
+
require 'forwardable'
module UsersCredits
class AlreadyUpdatedError < StandardError; end
+ # You must use UsersCredits::Manager to consume the credits of a user or to reset them
class Manager
extend Forwardable
attr_reader :manager
@@ -30,6 +33,8 @@ module UsersCredits
def_delegators :@manager, :will_use_credits?, :free_hours_count, :update_credits, :reset_credits
end
+ # The classes contained in UsersCredits::Managers are used by UsersCredits::Manager (no s) to handle the credits for
+ # the various kinds of reservations and for the user
module Managers
# that class is responsible for resetting users_credits of a user
class User
@@ -44,6 +49,7 @@ module UsersCredits
end
end
+ # Parent class of all reservations managers
class Reservation
attr_reader :reservation
@@ -119,7 +125,7 @@ module UsersCredits
return false, free_hours_count, machine_credit
end
end
- return false, 0
+ [false, 0]
end
end
@@ -149,10 +155,11 @@ module UsersCredits
return true, training_credit
end
end
- return false, nil
+ [false, nil]
end
end
+ # same as class Machine but for Event reservation
class Event < Reservation
def will_use_credits?
false
@@ -161,6 +168,7 @@ module UsersCredits
def update_credits; end
end
+ # same as class Machine but for Space reservation
class Space < Reservation
# to known if a credit will be used in the context of the given reservation
def will_use_credits?
@@ -206,7 +214,7 @@ module UsersCredits
return false, free_hours_count, space_credit
end
end
- return false, 0
+ [false, 0]
end
end
end
diff --git a/app/services/vat_history_service.rb b/app/services/vat_history_service.rb
index 8ced7b37c..4c03cfe71 100644
--- a/app/services/vat_history_service.rb
+++ b/app/services/vat_history_service.rb
@@ -11,7 +11,7 @@ class VatHistoryService
end
end
- # return the VAT rate foe the given date
+ # return the VAT rate for the given date
def vat_rate(date)
@vat_rates = vat_history if @vat_rates.nil?
diff --git a/app/services/wallet_service.rb b/app/services/wallet_service.rb
index 51eb093f6..cdde0cef7 100644
--- a/app/services/wallet_service.rb
+++ b/app/services/wallet_service.rb
@@ -22,7 +22,7 @@ class WalletService
receiver: @wallet.user,
attached_object: transaction
NotificationCenter.call type: 'notify_admin_user_wallet_is_credited',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: transaction
return transaction
end
diff --git a/app/views/api/availabilities/index.json.jbuilder b/app/views/api/availabilities/index.json.jbuilder
index e98ad286c..c36ca47e5 100644
--- a/app/views/api/availabilities/index.json.jbuilder
+++ b/app/views/api/availabilities/index.json.jbuilder
@@ -5,6 +5,7 @@ json.array!(@availabilities) do |availability|
json.title availability.title
json.start availability.start_at.iso8601
json.end availability.end_at.iso8601
+ json.slot_duration availability.slot_duration
json.available_type availability.available_type
json.machine_ids availability.machine_ids
json.training_ids availability.training_ids
diff --git a/app/views/api/availabilities/machine.json.jbuilder b/app/views/api/availabilities/machine.json.jbuilder
index 7c62843a9..c6fc966b5 100644
--- a/app/views/api/availabilities/machine.json.jbuilder
+++ b/app/views/api/availabilities/machine.json.jbuilder
@@ -15,13 +15,13 @@ json.array!(@slots) do |slot|
json.id slot.machine.id
json.name slot.machine.name
end
- # the user who booked the slot ...
- if (@current_user_role == 'admin') && slot.reservation
+ # the user who booked the slot, if the slot was reserved
+ if (%w[admin manager].include? @current_user_role) && slot.reservation
json.user do
json.id slot.reservation.user.id
json.name slot.reservation.user.profile.full_name
end
- end # ... if the slot was reserved
+ end
json.tag_ids slot.availability.tag_ids
json.tags slot.availability.tags do |t|
json.id t.id
diff --git a/app/views/api/availabilities/show.json.jbuilder b/app/views/api/availabilities/show.json.jbuilder
index a3788e23b..90a9390b7 100644
--- a/app/views/api/availabilities/show.json.jbuilder
+++ b/app/views/api/availabilities/show.json.jbuilder
@@ -3,6 +3,7 @@
json.extract! @availability, :id, :title, :lock, :is_recurrent, :occurrence_id, :period, :nb_periods, :end_date
json.start_at @availability.start_at.iso8601
json.end_at @availability.end_at.iso8601
+json.slot_duration @availability.slot_duration
json.available_type @availability.available_type
json.machine_ids @availability.machine_ids
json.plan_ids @availability.plan_ids
diff --git a/app/views/api/availabilities/spaces.json.jbuilder b/app/views/api/availabilities/spaces.json.jbuilder
index 0528284fb..a50a887ca 100644
--- a/app/views/api/availabilities/spaces.json.jbuilder
+++ b/app/views/api/availabilities/spaces.json.jbuilder
@@ -16,13 +16,13 @@ json.array!(@slots) do |slot|
json.id slot.space.id
json.name slot.space.name
end
- # the user who booked the slot ...
- if (@current_user_role == 'admin') && slot.reservation
+ # the user who booked the slot, if the slot was reserved
+ if (%w[admin manager].include? @current_user_role) && slot.reservation
json.user do
json.id slot.reservation.user.id
json.name slot.reservation.user.profile.full_name
end
- end # ... if the slot was reserved
+ end
json.tag_ids slot.availability.tag_ids
json.tags slot.availability.tags do |t|
json.id t.id
diff --git a/app/views/api/invoices/list.json.jbuilder b/app/views/api/invoices/list.json.jbuilder
index 60c9af411..d2b2f72dd 100644
--- a/app/views/api/invoices/list.json.jbuilder
+++ b/app/views/api/invoices/list.json.jbuilder
@@ -16,4 +16,10 @@ json.array!(@invoices) do |invoice|
json.date invoice.is_a?(Avoir) ? invoice.avoir_date : invoice.created_at
json.prevent_refund invoice.prevent_refund?
json.chained_footprint invoice.check_footprint
+ if invoice.operator_profile
+ json.operator do
+ json.id invoice.operator_profile.user_id
+ json.extract! invoice.operator_profile, :first_name, :last_name
+ end
+ end
end
diff --git a/app/views/api/machines/show.json.jbuilder b/app/views/api/machines/show.json.jbuilder
index 188e463d6..0645cc7a1 100644
--- a/app/views/api/machines/show.json.jbuilder
+++ b/app/views/api/machines/show.json.jbuilder
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
json.extract! @machine, :id, :name, :description, :spec, :disabled, :created_at, :updated_at, :slug
json.machine_image @machine.machine_image.attachment.large.url if @machine.machine_image
json.machine_files_attributes @machine.machine_files do |f|
@@ -7,9 +9,11 @@ json.machine_files_attributes @machine.machine_files do |f|
end
json.trainings @machine.trainings.each, :id, :name, :disabled
json.current_user_is_training current_user.training_machine?(@machine) if current_user
-json.current_user_training_reservation do
- json.partial! 'api/reservations/reservation', reservation: current_user.training_reservation_by_machine(@machine)
-end if current_user and !current_user.training_machine?(@machine) and current_user.training_reservation_by_machine(@machine)
+if current_user && !current_user.training_machine?(@machine) && current_user.training_reservation_by_machine(@machine)
+ json.current_user_training_reservation do
+ json.partial! 'api/reservations/reservation', reservation: current_user.training_reservation_by_machine(@machine)
+ end
+end
json.machine_projects @machine.projects.published.last(10) do |p|
json.id p.id
diff --git a/app/views/api/notifications/_notify_admins_role_update.json.jbuilder b/app/views/api/notifications/_notify_admins_role_update.json.jbuilder
new file mode 100644
index 000000000..dbfbddaf6
--- /dev/null
+++ b/app/views/api/notifications/_notify_admins_role_update.json.jbuilder
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+json.title notification.notification_type
+json.description t('.user_NAME_changed_ROLE_html',
+ NAME: notification.attached_object&.profile&.full_name || t('api.notifications.deleted_user'),
+ ROLE: t("roles.#{notification.attached_object&.role}"))
+json.url notification_url(notification, format: :json)
diff --git a/app/views/api/notifications/_notify_user_role_update.json.jbuilder b/app/views/api/notifications/_notify_user_role_update.json.jbuilder
new file mode 100644
index 000000000..2ed0413dc
--- /dev/null
+++ b/app/views/api/notifications/_notify_user_role_update.json.jbuilder
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+json.title notification.notification_type
+json.description t('.your_role_is_ROLE', ROLE: t("roles.#{notification.attached_object&.role}"))
+json.url notification_url(notification, format: :json)
diff --git a/app/views/api/stylesheets/show.css.erb b/app/views/api/stylesheets/show.css.erb
index 531891984..02c72b437 100644
--- a/app/views/api/stylesheets/show.css.erb
+++ b/app/views/api/stylesheets/show.css.erb
@@ -1 +1 @@
-<%= @stylesheet.contents %>
\ No newline at end of file
+<%= @stylesheet.contents.html_safe %>
\ No newline at end of file
diff --git a/app/views/api/users/index.json.jbuilder b/app/views/api/users/index.json.jbuilder
index d40b43c30..d2d409391 100644
--- a/app/views/api/users/index.json.jbuilder
+++ b/app/views/api/users/index.json.jbuilder
@@ -1,4 +1,8 @@
+# frozen_string_literal: true
+
json.users @users do |user|
json.extract! user, :id, :email, :first_name, :last_name
+ json.phone user.profile.phone
json.name user.profile.full_name
+ json.resource user.roles.last.resource
end
diff --git a/app/views/exports/availabilities_index.xlsx.axlsx b/app/views/exports/availabilities_index.xlsx.axlsx
index e45e778fe..cc8d3fd2f 100644
--- a/app/views/exports/availabilities_index.xlsx.axlsx
+++ b/app/views/exports/availabilities_index.xlsx.axlsx
@@ -16,10 +16,11 @@ wb.add_worksheet(name: t('export_availabilities.machines')) do |sheet|
# data rows
@availabilities.where(available_type: 'machines').order(:start_at).each do |a|
+ slot_duration = a.slot_duration || ApplicationHelper::SLOT_DURATION
a.machines.each do |m|
- ((a.end_at - a.start_at) / ApplicationHelper::SLOT_DURATION.minutes).to_i.times do |i|
- start_at = a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes
- end_at = a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes + ApplicationHelper::SLOT_DURATION.minutes
+ ((a.end_at - a.start_at) / slot_duration.minutes).to_i.times do |i|
+ start_at = a.start_at + (i * slot_duration).minutes
+ end_at = a.start_at + (i * slot_duration).minutes + slot_duration.minutes
reservations = 0
if a.slots&.map(&:start_at)&.include? start_at
reservations = Reservation.where(reservable: m).includes(:slots).where('slots.id' => a.slots, 'slots.start_at' => start_at).count
@@ -83,9 +84,10 @@ if Rails.application.secrets.fablab_without_spaces != 'false'
# data rows
@availabilities.where(available_type: 'space').order(:start_at).each do |a|
- ((a.end_at - a.start_at) / ApplicationHelper::SLOT_DURATION.minutes).to_i.times do |i|
- start_at = a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes
- end_at = a.start_at + (i * ApplicationHelper::SLOT_DURATION).minutes + ApplicationHelper::SLOT_DURATION.minutes
+ slot_duration = a.slot_duration || ApplicationHelper::SLOT_DURATION
+ ((a.end_at - a.start_at) / slot_duration.minutes).to_i.times do |i|
+ start_at = a.start_at + (i * slot_duration).minutes
+ end_at = a.start_at + (i * slot_duration).minutes + slot_duration.minutes
reservations = a.slots.where(start_at: start_at).count
data = [
diff --git a/app/views/notifications_mailer/notify_admins_role_update.html.erb b/app/views/notifications_mailer/notify_admins_role_update.html.erb
new file mode 100644
index 000000000..544f09316
--- /dev/null
+++ b/app/views/notifications_mailer/notify_admins_role_update.html.erb
@@ -0,0 +1,8 @@
+<%= render 'notifications_mailer/shared/hello', recipient: @recipient %>
+
+
<%= t('.body.user_role_changed_html', NAME: @attached_object&.profile&.full_name || t('api.notifications.deleted_user')) %>
+
+
+ <%= t('.body.previous_role') %> <%= t("roles.#{@notification.get_meta_data(:ex_role)}") %>
+
<%= t('.body.new_role') %> <%= t("roles.#{@attached_object.role}") %>
+
diff --git a/app/views/notifications_mailer/notify_user_role_update.html.erb b/app/views/notifications_mailer/notify_user_role_update.html.erb
new file mode 100644
index 000000000..d10e1abca
--- /dev/null
+++ b/app/views/notifications_mailer/notify_user_role_update.html.erb
@@ -0,0 +1,15 @@
+<%= render 'notifications_mailer/shared/hello', recipient: @recipient %>
+
+<%
+ name = Setting.find_by(name: 'fablab_name').value
+ gender = Setting.find_by(name: 'name_genre').value
+%>
+
<%= _t('.body.role_changed_html',
+ {
+ NAME: name,
+ GENDER: gender,
+ ROLE: t("roles.#{@attached_object.role}")
+ }
+ )
+ # messageFormat
+%>
diff --git a/app/workers/project_indexer_worker.rb b/app/workers/project_indexer_worker.rb
index 7dce4fa47..a2749cdf7 100644
--- a/app/workers/project_indexer_worker.rb
+++ b/app/workers/project_indexer_worker.rb
@@ -1,20 +1,23 @@
+# frozen_string_literal: true
+
+# Index the projects to ElasticSearch
class ProjectIndexerWorker
include Sidekiq::Worker
sidekiq_options queue: 'elasticsearch', retry: true
- Logger = Sidekiq.logger.level == Logger::DEBUG ? Sidekiq.logger : nil
- Client = Elasticsearch::Model.client
-
def perform(operation, record_id)
- logger.debug [operation, "ID: #{record_id}"]
+ logger = Sidekiq.logger.level == Logger::DEBUG ? Sidekiq.logger : nil
+ client = Elasticsearch::Model.client
+
+ logger&.debug [operation, "ID: #{record_id}"]
case operation.to_s
- when /index/
- record = Project.find(record_id)
- Client.index index: Project.index_name, type: Project.document_type, id: record.id, body: record.as_indexed_json
- when /delete/
- Client.delete index: Project.index_name, type: Project.document_type, id: record_id
- else raise ArgumentError, "Unknown operation '#{operation}'"
+ when /index/
+ record = Project.find(record_id)
+ client.index index: Project.index_name, type: Project.document_type, id: record.id, body: record.as_indexed_json
+ when /delete/
+ client.delete index: Project.index_name, type: Project.document_type, id: record_id
+ else raise ArgumentError, "Unknown operation '#{operation}'"
end
end
end
diff --git a/app/workers/subscription_expire_worker.rb b/app/workers/subscription_expire_worker.rb
index 13362f0ae..d7167e50e 100644
--- a/app/workers/subscription_expire_worker.rb
+++ b/app/workers/subscription_expire_worker.rb
@@ -9,14 +9,14 @@ class SubscriptionExpireWorker
receiver: s.user,
attached_object: s
NotificationCenter.call type: 'notify_admin_subscription_will_expire_in_7_days',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: s
else
NotificationCenter.call type: 'notify_member_subscription_is_expired',
receiver: s.user,
attached_object: s
NotificationCenter.call type: 'notify_admin_subscription_is_expired',
- receiver: User.admins,
+ receiver: User.admins_and_managers,
attached_object: s
end
end
diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml
index 81657a02c..60543d8a2 100644
--- a/config/locales/app.admin.en.yml
+++ b/config/locales/app.admin.en.yml
@@ -18,10 +18,13 @@ en:
events: "Eventos"
availabilities: "Availabilities"
availabilities_notice: "Export to an Excel workbook every slots available for reservation, and their occupancy rate."
+ info: "Info"
+ tags: "Tags"
+ slot_duration: "Slot duration: {DURATION} minutes"
ongoing_reservations: "Ongoing reservations"
- no_reservations: "No reservations"
+ without_reservation: "Without reservation"
confirmation_required: "Confirmation required"
- do_you_really_want_to_cancel_the_USER_s_reservation_the_DATE_at_TIME_concerning_RESERVATION: "Do you really want to cancel the {USER}'s reservation, the {DATE} at {TIME}, concerning {RESERVATION}?"
+ do_you_really_want_to_cancel_the_USER_s_reservation_the_DATE_at_TIME_concerning_RESERVATION: "Do you really {GENDER, select, other {want}} to cancel the {USER}'s reservation, the {DATE} at {TIME}, concerning {RESERVATION}?"
reservation_was_successfully_cancelled: "Reservation was successfully cancelled."
reservation_cancellation_failed: "Reservation cancellation failed."
unable_to_remove_the_last_machine_of_the_slot_delete_the_slot_rather: "Unable to remove the last machine of the slot. Delete the slot rather."
@@ -65,7 +68,7 @@ en:
select_nb_period: "Please select a number of periods for the recurrence"
select_end_date: "Please select the date of the last occurrence"
about_to_create: "You are about to create the following {TYPE, select, machines{machine} training{training} space{space} other{other}} {NUMBER, plural, one{slot} other{slots}}:"
- divided_in_slots: "{COUNT, plural, =1{This slot} other{These slots}} will be open for booking in {DURATION}-minutes increments. Contact your system administrator to change this setting."
+ divided_in_slots: "{COUNT, plural, =1{This slot} other{These slots}} will be open for booking in {DURATION}-minutes increments."
reservable: "Reservable(s):"
labels: "Label(s):"
none: "None"
@@ -98,6 +101,10 @@ en:
legend: "Legend"
and: "and"
external_sync: "Calendar synchronization"
+ divide_this_availability: "Divide this availability in"
+ slots: "slots"
+ slots_of: "of"
+ minutes: "minutes"
# import external iCal calendar
icalendar:
icalendar_import: "iCalendar import"
@@ -189,7 +196,7 @@ en:
booking: "Booking"
sold_out: "Sold out"
cancelled: "Cancelled"
- free_entry: "Free entry"
+ without_reservation: "Without reservation"
free_admission: "Free admission"
view_reservations: "View reservations"
load_the_next_events: "Load the next events..."
@@ -276,15 +283,16 @@ en:
prominence: "Prominence"
price: "Price"
machine_hours: "Machine slots"
- these_prices_match_machine_hours_rates_: "These prices match {DURATION} minutes of machine usage, "
- _without_subscriptions: "without subscriptions"
+ these_prices_match_machine_hours_rates_html: "The prices below match one hour of machine usage,
without subscription."
+ prices_calculated_on_hourly_rate_html: "All the prices will be automatically calculated based on the hourly rate defined here.
For example, if you define an hourly rate at {RATE}: a slot of {DURATION} minutes (default), will be charged
{PRICE}."
+ you_can_override: "You can override this duration for each availability you create in the agenda. The price will then be adjusted accordingly."
machines: "Machines"
credits: "Credits"
subscription: "Subscription"
related_trainings: "Related trainings"
add_a_machine_credit: "Add a machine credit"
machine: "Machine"
- hours: "Slots of {DURATION} minutes"
+ hours: "Slots (default {DURATION} minutes)"
related_subscriptions: "Related subscriptions"
please_specify_a_number: "Please specify a number."
none: "None" #grammar concordance with training.
@@ -330,7 +338,7 @@ en:
forever: "Each use"
valid_until: "Valid until (included)"
spaces: "Spaces"
- these_prices_match_space_hours_rates_: "These prices match {DURATION} minutes of space usage, "
+ these_prices_match_space_hours_rates_html: "The prices below match one hour of space usage,
without subscription."
add_a_space_credit: "Add a Space credit"
space: "Space"
error_a_credit_linking_this_space_with_that_subscription_already_exists: "Error : a credit linking this space with that subscription already exists."
@@ -359,7 +367,7 @@ en:
copy_prices_from: "Copy prices from"
machines: "Machines"
machine: "Machine"
- hourly_rate: "Price by slot"
+ hourly_rate: "Hourly rate"
spaces: "Spaces"
space: "Space"
unable_to_save_subscription_changes_please_try_again: "Unable to save subscription changes. Please try again."
@@ -370,6 +378,7 @@ en:
accounting_periods: "Accounting periods"
invoices_list: "Invoices list"
filter_invoices: "Filter invoices"
+ operator_: "Operator:"
invoice_num_: "Invoice #:"
customer_: "Customer:"
date_: "Date:"
@@ -584,6 +593,7 @@ en:
#management of users, labels, groups, and so on
members:
users_management: "Users management"
+ users: "Users"
members: "Members"
subscriptions: "Subscriptions"
search_for_an_user: "Search for an user"
@@ -599,6 +609,21 @@ en:
administrators: "Administrators"
search_for_an_administrator: "Search for an administrator"
add_a_new_administrator: "Add a new administrator"
+ managers: "Managers"
+ managers_info: "A manager is a restricted administrator that cannot modify the settings of the application. However, he will be able to take reservations for any members and for all managers, including himself, and to process payments and refunds."
+ search_for_a_manager: "Search for a manager"
+ add_a_new_manager: "Add a new manager"
+ delete_this_manager: "Do you really want to delete this manager? This cannot be undone."
+ manager_successfully_deleted: "Manager successfully deleted."
+ unable_to_delete_the_manager: "Unable to delete the manager."
+ partners: "Partners"
+ partners_info: "A partner is a special user that can be associated with the «Partner» plans. These users won't be able to connect and will just receive notifications about subscriptions to their associated plan."
+ search_for_a_partner: "Search for a partner"
+ add_a_new_partner: "Add a new partner"
+ delete_this_partner: "Do you really want to delete this partner? This cannot be undone."
+ partner_successfully_deleted: "Partner successfully deleted."
+ unable_to_delete_the_partner: "Unable to delete the partner."
+ associated_plan: "Associated plan"
groups: "Groups"
tags: "Tags"
authentication: "Authentication"
@@ -702,6 +727,13 @@ en:
error_details: "Error's details:"
#edit a member
members_edit:
+ change_role: "Change role"
+ warning_role_change: "
Warning: changing the role of a user is not a harmless operation. Is not currently possible to dismiss a user to a lower privileged role.
- Members can only book reservations for themselves, paying by card or wallet.
- Managers can book reservations for themselves, paying by card or wallet, and for other members and managers, by collecting payments at the checkout.
- Administrators can only book reservations for members and managers, by collecting payments at the checkout. Moreover, they can change every settings of the application.
"
+ admin: "Administrator"
+ manager: "Manager"
+ member: "Member"
+ role_changed: "Role successfully changed from {OLD} to {NEW}."
+ error_while_changing_role: "An error occurred while changing the role. Please try again later."
subscription: "Subscription"
duration: "Duration:"
expires_at: "Expires at:"
@@ -743,6 +775,8 @@ en:
a_problem_occurred_while_taking_the_subscription: "A problem occurred while taking the subscription"
wallet: "Wallet"
to_credit: 'Credit'
+ cannot_credit_own_wallet: "You cannot credit your own wallet. Please ask another manager or an administrator to credit your wallet."
+ cannot_extend_own_subscription: "You cannot extend your own subscription. Please ask another manager or an administrator to extend your subscription."
#add a new administrator to the platform
admins_new:
add_an_administrator: "Add an administrator"
@@ -761,6 +795,24 @@ en:
birth_date: "Date of birth"
address: "Address"
phone_number: "Phone number"
+ #add a new manager to the platform
+ manager_new:
+ add_a_manager: "Add a manager"
+ manager_successfully_created: "Manager successfully created. {GENDER, select, female{She} other{He}} receive {GENDER, select, female{her} other{his}} connection directives by e-mail."
+ failed_to_create_manager: "Unable to create the manager:"
+ man: "Man"
+ woman: "Woman"
+ pseudonym: "Pseudonym"
+ pseudonym_is_required: "Pseudonym is required."
+ first_name: "First name"
+ first_name_is_required: "First name is required."
+ surname: "Last name"
+ surname_is_required: "Last name is required."
+ email_address: "Email address"
+ email_is_required: "Email address is required."
+ birth_date: "Date of birth"
+ address: "Address"
+ phone_number: "Phone number"
#add a new authentication provider (SSO)
authentication_new:
local_database: "Local Database"
@@ -973,6 +1025,7 @@ en:
advanced: "Advanced settings"
customize_home_page_css: "Customise the stylesheet og the home page"
home_css_notice_html: "You can customize the stylesheet which will apply to the home page, using the
SASS syntax. These styles will be automatically subordinated to the
.home-page
selector to prevent any risk of breaking the application. Meanwhile please be careful, any changes in the home page editor at the top of the page may broke your styles, always refer to the HTML code."
+ an_error_occurred_saving_the_setting: "An error occurred while saving the setting. Please try again later."
sort_by:
default: "Default"
name: "Name"
@@ -1050,9 +1103,12 @@ en:
welcome:
title: "Trainings"
content: "Here you can create, modify and delete trainings. It is also the place where you can validate the training courses followed by your members."
+ welcome_manager:
+ title: "Trainings"
+ content: "This is the place where you can view the trainings and their associations with the machines. It is also the place where you can validate the training courses followed by your members."
trainings:
title: "Manage trainings"
- content: "
When creating a training, you can define a default number of places. However, the number of actual places may be modified for each session.
The training sessions are scheduled from the administrator tab « Calendar ».
Another thing: it is possible to associate one or more machines with a training. This makes it a prerequisite for the reservation of these machines.
"
+ content: "
With each training, a default number of places is associated. However, the number of actual places may be modified for each session.
The training sessions are scheduled from the administrator tab « Calendar ».
Furthermore, a training may be associated with one or more machines. This makes it a prerequisite for the reservation of these machines.
"
filter:
title: "Filter"
content: "By default, only active courses are displayed here. Display the others by choosing another filter here."
@@ -1110,6 +1166,9 @@ en:
welcome:
title: "Invoices"
content: "
Here you will be able to download invoices and credit notes issued, as well as manage everything related to accounting and invoicing.
If you use third-party software to manage your invoices, it is possible to deactivate the billing module. For this, contact your system administrator.
"
+ welcome_manager:
+ title: "Invoices"
+ content: "Here you will be able to download invoices and create credit notes."
list:
title: "Invoices list"
content: "By default, this table lists all the invoices and credit notes issued by Fab-manager. You can sort the list in a different order by clicking on the header of each column."
diff --git a/config/locales/app.admin.es.yml b/config/locales/app.admin.es.yml
index 3718165cf..5721bff36 100644
--- a/config/locales/app.admin.es.yml
+++ b/config/locales/app.admin.es.yml
@@ -18,8 +18,11 @@ es:
events: "Eventos"
availabilities: "Disponibilidades"
availabilities_notice: "Exportar a un libro de trabajo de Excel cada ranura disponible para reserva, y su ratio de ocupación."
+ info: "Info"
+ tags: "Tags"
+ slot_duration: "Slot duration: {DURATION} minutes"
ongoing_reservations: "Reservas en curso"
- no_reservations: "Sin reservas"
+ without_reservation: "Sin reserva"
confirmation_required: "Confirmación requerida"
do_you_really_want_to_cancel_the_USER_s_reservation_the_DATE_at_TIME_concerning_RESERVATION: "Realmente quieres cancelar la reserva del {USER}, en {DATE} a las {TIME}, respecto {RESERVATION}?"
reservation_was_successfully_cancelled: "La reserva fué cancelada con éxito."
@@ -65,7 +68,7 @@ es:
select_nb_period: "Please select a number of periods for the recurrence"
select_end_date: "Please select the date of the last occurrence"
about_to_create: "Está a punto de crear los horarios siguientes: {TYPE, select, machines{machine} training{training} space{space} other{other}} {NUMBER, plural, one{slot} other{slots}}:"
- divided_in_slots: "{COUNT, plural, =1{This slot} other{These slots}} will be open for booking in {DURATION}-minutes increments. Contact your system administrator to change this setting."
+ divided_in_slots: "{COUNT, plural, =1{This slot} other{These slots}} will be open for booking in {DURATION}-minutes increments."
reservable: "Reservable(s):"
labels: "Etiqueta(s):"
none: "Ninguna"
@@ -98,6 +101,10 @@ es:
legend: "Leyenda"
and: "y"
external_sync: "Calendar synchronization"
+ divide_this_availability: "Divide this availability in"
+ slots: "slots"
+ slots_of: "of"
+ minutes: "minutes"
#import external iCal calendar
icalendar:
icalendar_import: "iCalendar import"
@@ -189,8 +196,8 @@ es:
booking: "Booking"
sold_out: "Sold out"
cancelled: "Cancelled"
- free_entry: "Free entry"
- free_admission: "Free admission"
+ without_reservation: "Sin reserva"
+ free_admission: "Entrada gratuita"
view_reservations: "Ver reservas"
load_the_next_events: "Load the next events..."
categories: "CategorÃas"
@@ -276,15 +283,16 @@ es:
prominence: "Prominencia"
price: "Precio"
machine_hours: "Machine slots"
- these_prices_match_machine_hours_rates_: "Estos precios se ajustan a la tarifas de máquina por {DURATION} minutas"
- _without_subscriptions: "Sin suscripciones"
+ these_prices_match_machine_hours_rates_html: "The prices below match one hour of machine usage,
without subscription."
+ prices_calculated_on_hourly_rate_html: "All the prices will be automatically calculated based on the hourly rate defined here.
For example, if you define an hourly rate at {RATE}: a slot of {DURATION} minutes (default), will be charged
{PRICE}."
+ you_can_override: "You can override this duration for each availability you create in the agenda. The price will then be adjusted accordingly."
machines: "Máquinas"
credits: "Créditos"
subscription: "Suscripción"
related_trainings: "Formación relacionada"
add_a_machine_credit: "Agregar un crédito de máquina"
machine: "Máquina"
- hours: "Slots of {DURATION} minutes"
+ hours: "Slots (default {DURATION} minutes)"
related_subscriptions: "Suscripciónes relacionada"
please_specify_a_number: "Por favor, especifique un número."
none: "Nada" #grammar concordance with training.
@@ -330,7 +338,7 @@ es:
forever: "Cada uso"
valid_until: "Válido hasta (incluido)"
spaces: "Espacios"
- these_prices_match_space_hours_rates_: "Estos precios coinciden con las tarifas de espacio por {DURATION} minutas"
+ these_prices_match_space_hours_rates_html: "The prices below match one hour of space usage,
without subscription."
add_a_space_credit: "Añadir un crédito de espacio"
space: "Espacio"
error_a_credit_linking_this_space_with_that_subscription_already_exists: "Error: un crédito que vincula este espacio con esa suscripción ya existe."
@@ -359,7 +367,7 @@ es:
copy_prices_from: "Copia los precios desde"
machines: "Máquinas"
machine: "Máquina"
- hourly_rate: "Tarifa por slot"
+ hourly_rate: "Hourly rate"
spaces: "Espacios"
space: "Espacio"
unable_to_save_subscription_changes_please_try_again: "No se pueden guardar los cambios de suscripción. Por favor, inténtelo de nuevo."
@@ -370,6 +378,7 @@ es:
accounting_periods: "Accounting periods"
invoices_list: "Lista de facturas"
filter_invoices: "Filtrar facturas"
+ operator_: "Operator:"
invoice_num_: "Factura #:"
customer_: "Cliente:"
date_: "Fecha:"
@@ -584,6 +593,7 @@ es:
#management of users, labels, groups, and so on
members:
users_management: "Gestión de usuarios"
+ users: "Users"
members: "Miembros"
subscriptions: "Subscriptions"
search_for_an_user: "Buscar un usuario"
@@ -599,6 +609,21 @@ es:
administrators: "Administradores"
search_for_an_administrator: "Buscar un administrador"
add_a_new_administrator: "Agregar un nuevo administrador"
+ managers: "Managers"
+ managers_info: "A manager is a restricted administrator that cannot modify the settings of the application. However, he will be able to take reservations for any members and for all managers, including himself, and to process payments and refunds."
+ search_for_a_manager: "Search for a manager"
+ add_a_new_manager: "Add a new manager"
+ delete_this_manager: "Do you really want to delete this manager? This cannot be undone."
+ manager_successfully_deleted: "Manager successfully deleted."
+ unable_to_delete_the_manager: "Unable to delete the manager."
+ partners: "Partners"
+ partners_info: "A partner is a special user that can be associated with the «Partner» plans. These users won't be able to connect and will just receive notifications about subscriptions to their associated plan."
+ search_for_a_partner: "Search for a partner"
+ add_a_new_partner: "Add a new partner"
+ delete_this_partner: "Do you really want to delete this partner? This cannot be undone."
+ partner_successfully_deleted: "Partner successfully deleted."
+ unable_to_delete_the_partner: "Unable to delete the partner."
+ associated_plan: "Associated plan"
groups: "Grupos"
tags: "Tags"
authentication: "Autenticación"
@@ -702,6 +727,13 @@ es:
error_details: "Error's details:"
#edit a member
members_edit:
+ change_role: "Change role"
+ warning_role_change: "
Warning: changing the role of a user is not a harmless operation. Is not currently possible to dismiss a user to a lower privileged role.
- Members can only book reservations for themselves, paying by card or wallet.
- Managers can book reservations for themselves, paying by card or wallet, and for other members and managers, by collecting payments at the checkout.
- Administrators can only book reservations for members and managers, by collecting payments at the checkout. Moreover, they can change every settings of the application.
"
+ admin: "Administrator"
+ manager: "Manager"
+ member: "Member"
+ role_changed: "Role successfully changed from {OLD} to {NEW}."
+ error_while_changing_role: "An error occurred while changing the role. Please try again later."
subscription: "Subscription"
duration: "Duración:"
expires_at: "Caduca en:"
@@ -743,6 +775,8 @@ es:
a_problem_occurred_while_taking_the_subscription: "Se ha producido un problema al realizar la suscripción."
wallet: "Wallet"
to_credit: 'Credit'
+ cannot_credit_own_wallet: "You cannot credit your own wallet. Please ask another manager or an administrator to credit your wallet."
+ cannot_extend_own_subscription: "You cannot extend your own subscription. Please ask another manager or an administrator to extend your subscription."
#add a new administrator to the platform
admins_new:
add_an_administrator: "Agregar un administrador"
@@ -761,6 +795,24 @@ es:
birth_date: "Date of birth"
address: "Address"
phone_number: "Phone number"
+ #add a new manager to the platform
+ manager_new:
+ add_a_manager: "Add a manager"
+ manager_successfully_created: "Manager successfully created. {GENDER, select, female{She} other{He}} receive {GENDER, select, female{her} other{his}} connection directives by e-mail."
+ failed_to_create_manager: "Unable to create the manager:"
+ man: "Man"
+ woman: "Woman"
+ pseudonym: "Pseudonym"
+ pseudonym_is_required: "Pseudonym is required."
+ first_name: "First name"
+ first_name_is_required: "First name is required."
+ surname: "Last name"
+ surname_is_required: "Last name is required."
+ email_address: "Email address"
+ email_is_required: "Email address is required."
+ birth_date: "Date of birth"
+ address: "Address"
+ phone_number: "Phone number"
#add a new authentication provider (SSO)
authentication_new:
local_database: "Base de datos local"
@@ -973,6 +1025,7 @@ es:
advanced: "Advanced settings"
customize_home_page_css: "Customise the stylesheet og the home page"
home_css_notice_html: "You can customize the stylesheet which will apply to the home page, using the
SASS syntax. These styles will be automatically subordinated to the
.home-page
selector to prevent any risk of breaking the application. Meanwhile please be careful, any changes in the home page editor at the top of the page may broke your styles, always refer to the HTML code."
+ an_error_occurred_saving_the_setting: "An error occurred while saving the setting. Please try again later."
sort_by:
default: "Defecto"
name: "Nombre"
@@ -1050,9 +1103,12 @@ es:
welcome:
title: "Trainings"
content: "Here you can create, modify and delete trainings. It is also the place where you can validate the training courses followed by your members."
+ welcome_manager:
+ title: "Trainings"
+ content: "This is the place where you can view the trainings and their associations with the machines. It is also the place where you can validate the training courses followed by your members."
trainings:
title: "Manage trainings"
- content: "
When creating a training, you can define a default number of places. However, the number of actual places may be modified for each session.
The training sessions are scheduled from the administrator tab « Calendar ».
Another thing: it is possible to associate one or more machines with a training. This makes it a prerequisite for the reservation of these machines.
"
+ content: "
With each training, a default number of places is associated. However, the number of actual places may be modified for each session.
The training sessions are scheduled from the administrator tab « Calendar ».
Furthermore, a training may be associated with one or more machines. This makes it a prerequisite for the reservation of these machines.
"
filter:
title: "Filter"
content: "By default, only active courses are displayed here. Display the others by choosing another filter here."
@@ -1110,6 +1166,9 @@ es:
welcome:
title: "Invoices"
content: "
Here you will be able to download invoices and credit notes issued, as well as manage everything related to accounting and invoicing.
If you use third-party software to manage your invoices, it is possible to deactivate the billing module. For this, contact your system administrator.
"
+ welcome_manager:
+ title: "Invoices"
+ content: "Here you will be able to download invoices and create credit notes."
list:
title: "Invoices list"
content: "By default, this table lists all the invoices and credit notes issued by Fab-manager. You can sort the list in a different order by clicking on the header of each column."
diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml
index 37f08b720..5d9281afb 100644
--- a/config/locales/app.admin.fr.yml
+++ b/config/locales/app.admin.fr.yml
@@ -18,8 +18,11 @@ fr:
events: "Évènements"
availabilities: "Disponibilités"
availabilities_notice: "Exporter dans un classeur Excel tous les créneaux ouverts à la réservation et leurs taux d'occupation."
+ info: "Informations"
+ tags: "Étiquettes"
+ slot_duration: "Durée des créneaux: {DURATION} minutes"
ongoing_reservations: "Réservations en cours"
- no_reservations: "Aucune réservation"
+ without_reservation: "Sans réservation"
confirmation_required: "Confirmation requise"
do_you_really_want_to_cancel_the_USER_s_reservation_the_DATE_at_TIME_concerning_RESERVATION: "Êtes-vous {GENDER, select, female{sûre} other{sûr}} de vouloir annuler la réservation de {USER}, le {DATE} à {TIME}, concernant {RESERVATION} ?"
reservation_was_successfully_cancelled: "La réservation a bien été annulée."
@@ -65,7 +68,7 @@ fr:
select_nb_period: "Veuillez choisir un nombre de périodes pour la récurrence"
select_end_date: "Veuillez choisir la date de dernière occurrence"
about_to_create: "Vous vous apprêtez à créer {NUMBER, plural, one{le créneau} other{les créneaux}} {TYPE, select, machines{machine} training{formation} space{espace} other{autre}} suivant :"
- divided_in_slots: "{COUNT, plural, =1{Ce créneau sera proposé} other{Ces créneaux seront proposés}} à la réservation par tranches de {DURATION} minutes. Contactez votre administrateur système pour modifier ce paramètre."
+ divided_in_slots: "{COUNT, plural, =1{Ce créneau sera proposé} other{Ces créneaux seront proposés}} à la réservation par tranches de {DURATION} minutes."
reservable: "Réservable(s) :"
labels: "Étiquette(s) :"
none: "Aucune"
@@ -98,6 +101,10 @@ fr:
legend: "Légende"
and: "et"
external_sync: "Synchronisation d'agendas"
+ divide_this_availability: "Diviser cette disponibilité en"
+ slots: "créneaux"
+ slots_of: "de"
+ minutes: "minutes"
#import external iCal calendar
icalendar:
icalendar_import: "Import iCalendar"
@@ -189,7 +196,7 @@ fr:
booking: "Réservations"
sold_out: "Complet"
cancelled: "Annulé"
- free_entry: "Entrée libre"
+ without_reservation: "Sans réservation"
free_admission: "Entrée gratuite"
view_reservations: "Consulter les réservations"
load_the_next_events: "Charger les évènements suivants..."
@@ -276,15 +283,16 @@ fr:
prominence: "Importance"
price: "Prix"
machine_hours: "Créneaux machines"
- these_prices_match_machine_hours_rates_: "Ces tarifs correspondent au prix de {DURATION} minutes d'utilisation d'une machine, "
- _without_subscriptions: "sans abonnement"
+ these_prices_match_machine_hours_rates_html: "Les tarifs ci-dessous correspondent à une heure d'utilisation machine,
sans abonnement."
+ prices_calculated_on_hourly_rate_html: "Tous les prix seront automatiquement calculés par rapport au tarif horaire défini ici.
Par exemple, si vous définissez un tarif horaire à {RATE} : un créneau de {DURATION} minutes (par défaut), sera facturé
{PRICE}."
+ you_can_override: "Vous pouvez surcharger cette durée pour chaque disponibilité que vous créez dans l'agenda. Le prix sera alors ajusté en conséquence."
machines: "Machines"
credits: "Crédits"
subscription: "Abonnement"
related_trainings: "Formations associées"
add_a_machine_credit: "Ajouter un crédit Machine"
machine: "Machine"
- hours: "Créneaux de {DURATION} minutes"
+ hours: "Créneaux (par défaut {DURATION} minutes)"
related_subscriptions: "Abonnements associés"
please_specify_a_number: "Veuillez spécifier un nombre."
none: "Aucune" #grammar concordance with training.
@@ -330,7 +338,7 @@ fr:
forever: "À chaque utilisation"
valid_until: "Valable jusqu'au (inclus)"
spaces: "Espaces"
- these_prices_match_space_hours_rates_: "Ces tarifs correspondent au prix de {DURATION} minutes d'utilisation d'un espace, "
+ these_prices_match_space_hours_rates_html: "Les tarifs ci-dessous correspondent à une heure d'utilisation espace,
sans abonnement."
add_a_space_credit: "Ajouter un crédit Espace"
space: "Espace"
error_a_credit_linking_this_space_with_that_subscription_already_exists: "Erreur : un crédit associant cet espace et cet abonnement existe déjà ."
@@ -359,7 +367,7 @@ fr:
copy_prices_from: "Copier les prix depuis"
machines: "Machines"
machine: "Machine"
- hourly_rate: "Tarif par créneau"
+ hourly_rate: "Tarif horaire"
spaces: "Espaces"
space: "Espace"
unable_to_save_subscription_changes_please_try_again: "Les modifications de l'abonnement n'ont pas pu être enregistrées. Veuillez réessayer."
@@ -370,6 +378,7 @@ fr:
accounting_periods: "Périodes comptables"
invoices_list: "Liste des factures"
filter_invoices: "Filtrer les factures"
+ operator_: "Opérateur:"
invoice_num_: "Facture n° :"
customer_: "Client :"
date_: "Date :"
@@ -584,6 +593,7 @@ fr:
#management of users, labels, groups, and so on
members:
users_management: "Gestion des utilisateurs"
+ users: "Utilisateurs"
members: "Membres"
subscriptions: "Abonnements"
search_for_an_user: "Recherchez un utilisateur"
@@ -599,6 +609,21 @@ fr:
administrators: "Administrateurs"
search_for_an_administrator: "Recherchez un administrateur"
add_a_new_administrator: "Ajouter un nouvel administrateur"
+ managers: "Gestionnaires"
+ managers_info: "Un gestionnaire est un administrateur restreint qui ne peut pas modifier les paramètres de l'application. Cependant, il pourra effectuer des réservations pour l'ensemble des membres et pour tous les gestionnaires, y compris lui-même, et traiter les paiements et les remboursements."
+ search_for_a_manager: "Rechercher un gestionnaire"
+ add_a_new_manager: "Ajouter un nouveau gestionnaire"
+ delete_this_manager: "Êtes-vous sûr de vouloir supprimer ce gestionnaire ? Cette opération est irréversible."
+ manager_successfully_deleted: "Le gestionnaire a bien été supprimé."
+ unable_to_delete_the_manager: "Le gestionnaire n'a pas pu être supprimé."
+ partners: "Partenaires"
+ partners_info: "Un partenaire est un utilisateur spécial qui peut être associé à une formule d'abonnement de type «Partenaire». Ces utilisateurs ne pourront pas se connecter et ne feront que recevoir des notifications, à propos des souscriptions à la formule d'abonnement à laquelle ils sont associés."
+ search_for_a_partner: "Rechercher un partenaire"
+ add_a_new_partner: "Ajouter un partenaire"
+ delete_this_partner: "Voulez-vous vraiment supprimer ce partenaire ? Cette opération est irréversible."
+ partner_successfully_deleted: "Le partenaire a bien été supprimé."
+ unable_to_delete_the_partner: "Impossible de supprimer le partenaire."
+ associated_plan: "Abonnement associé"
groups: "Groupes"
tags: "Étiquettes"
authentication: "Authentification"
@@ -702,6 +727,13 @@ fr:
error_details: "Détails de l'erreur :"
#edit a member
members_edit:
+ change_role: "Changer le rôle"
+ warning_role_change: "
Attention : changer le rôle d'un utilisateur n'est pas une opération anodine. Il n'est actuellement pas possible de destituer un utilisateur vers un rôle de moindre privilège.
- Les membres ne peuvent que prendre des réservations pour eux-même, en payant par carte bancaire ou par porte-monnaie.
- Les gestionnaires peuvent prendre des réservations pour eux-même, en payant par carte bancaire ou par porte-monnaie, ainsi que pour les autres membres et gestionnaires, en encaissant les paiements à la caisse.
- Les administrateurs ne peuvent que prendre des réservations pour les membres et gestionnaires, en encaissant les paiements à la caisse. De plus, ils peuvent modifier l'ensemble des paramètres de l'application.
"
+ admin: "Administrateur"
+ manager: "Gestionnaire"
+ member: "Membre"
+ role_changed: "Rôle modifié avec succès de {OLD} à {NEW}."
+ error_while_changing_role: "Une erreur est survenue lors de changement de rôle. Merci de réessayer plus tard."
subscription: "Abonnement"
duration: "Durée :"
expires_at: "Expire le :"
@@ -743,6 +775,8 @@ fr:
a_problem_occurred_while_taking_the_subscription: "Il y a eu un problème lors de la souscription à l'abonnement"
wallet: "Porte-monnaie"
to_credit: 'Créditer'
+ cannot_credit_own_wallet: "Vous ne pouvez pas créditer votre propre porte-monnaie. Veuillez demander à un autre gestionnaire ou à un administrateur de créditer votre porte-monnaie."
+ cannot_extend_own_subscription: "Vous ne pouvez pas prolonger votre propre abonnement. Veuillez demander à un autre gestionnaire ou à un administrateur de prolonger votre abonnement."
#add a new administrator to the platform
admins_new:
add_an_administrator: "Ajouter un administrateur"
@@ -761,6 +795,24 @@ fr:
birth_date: "Date de naissance"
address: "Adresse"
phone_number: "Numéro de téléphone"
+ #add a new manager to the platform
+ manager_new:
+ add_a_manager: "Ajouter un gestionnaire"
+ manager_successfully_created: "Le gestionnaire a bien été créé. {GENDER, select, female{Elle} other{Il}} recevra ses instructions de connexion par courriel."
+ failed_to_create_manager: "Impossible de créer le gestionnaire :"
+ man: "Homme"
+ woman: "Femme"
+ pseudonym: "Pseudonyme"
+ pseudonym_is_required: "Le pseudonyme est requis."
+ first_name: "Prénom"
+ first_name_is_required: "Le prénom est requis."
+ surname: "Nom"
+ surname_is_required: "Le nom est requis."
+ email_address: "Adresse de courriel"
+ email_is_required: "L'adresse de courriel est requise."
+ birth_date: "Date de naissance"
+ address: "Adresse"
+ phone_number: "Numéro de téléphone"
#add a new authentication provider (SSO)
authentication_new:
local_database: "Base de données locale"
@@ -973,6 +1025,7 @@ fr:
advanced: "Paramètres avancés"
customize_home_page_css: "Personnaliser la feuille de style de la page d'accueil"
home_css_notice_html: "Vous pouvez personnaliser la feuille de style qui s'appliquera à la page d'accueil en utilisant la syntaxe
SASS. Ces styles seront automatiquement subordonnées au sélecteur
.home-page
pour prévenir tout risque de casse de l'application. Attention toutefois, les modifications de la page d'accueil dans l'éditeur en haut de page peuvent rendre caduque vos styles, référez vous toujours au code HTML."
+ an_error_occurred_saving_the_setting: "Une erreur est survenue pendant l'enregistrement du paramètre. Veuillez réessayer plus tard."
sort_by:
default: "Défaut"
name: "Nom"
@@ -1050,9 +1103,12 @@ fr:
welcome:
title: "Formations"
content: "Ici vous pourrez créer, modifier et supprimer des formations. C'est également l'endroit où vous pourrez valider les formations suivies par vos membres."
+ welcome_manager:
+ title: "Formations"
+ content: "C'est ici que vous pouvez voir les formations et les machines avec lesquelles elles sont associées. C'est également l'endroit où vous pouvez valider les formation suivies par vos membres."
trainings:
title: "Gérer les formations"
- content: "
Lors de la création d'une formation, vous pouvez définir un nombre de places par défaut. Néanmoins, le nombre de places effectives pourra être modifié pour chaque session.
La programmation des sessions de formation se fait depuis l'onglet administrateur « Agenda ».
D'autre part, il est possible d'associer une ou plusieurs machines à une formation. Cela permet d'en faire un pré-requis pour la réservation de ces machines.
"
+ content: "
À chaque formation, un nombre de places par défaut est associé. Néanmoins, le nombre de places effectives pourra être modifié pour chaque session.
La programmation des sessions de formation se fait depuis l'onglet administrateur « Agenda ».
De plus, une formation peut être associée à une ou plusieurs machines. Cela permet d'en faire un pré-requis pour la réservation de ces machines.
"
filter:
title: "Filtre"
content: "Par défaut, seules les formations actives sont affichées ici. Affichez les autres en choisissant un autre filtre ici."
@@ -1110,6 +1166,9 @@ fr:
welcome:
title: "Factures"
content: "
Ici, vous pourrez télécharger les factures et les avoirs émis, ainsi que gérer tout ce qui a trait à la comptabilité et à la facturation.
Si vous utilisez un logiciel tiers pour gérer vos factures, il est possible de désactiver le module de facturation. Pour cela, contactez votre administrateur système.
"
+ welcome_manager:
+ title: "Factures"
+ content: "Ici vous pourrez télécharger des factures et créer des avoirs."
list:
title: "Liste des factures"
content: "Par défaut, ce tableau liste l'ensemble des factures et avoirs émis via Fab-manager. Vous pouvez trier la liste dans un ordre différent en cliquant sur l'entête de chaque colonne."
diff --git a/config/locales/app.admin.pt.yml b/config/locales/app.admin.pt.yml
index 110f8ee0b..83e4b8aec 100755
--- a/config/locales/app.admin.pt.yml
+++ b/config/locales/app.admin.pt.yml
@@ -18,8 +18,11 @@ pt:
events: "Eventos"
availabilities: "DisponÃveis"
availabilities_notice: "Exportar para Excel livro com todos os slots disponÃveis para reserva, e suas ocupações."
+ info: "Info"
+ tags: "Tags"
+ slot_duration: "Slot duration: {DURATION} minutes"
ongoing_reservations: "Reservas em curso"
- no_reservations: "Sem reservas"
+ without_reservation: "Sem reservas"
confirmation_required: "Confirmação Obrigatória"
do_you_really_want_to_cancel_the_USER_s_reservation_the_DATE_at_TIME_concerning_RESERVATION: "Você realmente deseja cancelar a reserva do usuário {USER}, em {DATE} ás {TIME}, sobre {RESERVATION}?"
reservation_was_successfully_cancelled: "A reserva foi cancelada com sucesso"
@@ -65,7 +68,7 @@ pt:
select_nb_period: "Please select a number of periods for the recurrence"
select_end_date: "Please select the date of the last occurrence"
about_to_create: "You are about to create the following {TYPE, select, machines{machine} training{training} space{space} other{other}} {NUMBER, plural, one{slot} other{slots}}:"
- divided_in_slots: "{COUNT, plural, =1{This slot} other{These slots}} will be open for booking in {DURATION}-minutes increments. Contact your system administrator to change this setting."
+ divided_in_slots: "{COUNT, plural, =1{This slot} other{These slots}} will be open for booking in {DURATION}-minutes increments."
reservable: "Reservable(s) :"
labels: "Etiqueta(s):"
none: "Nenhuma"
@@ -98,6 +101,10 @@ pt:
legend: "Legenda"
and: "and"
external_sync: "Calendar synchronization"
+ divide_this_availability: "Divide this availability in"
+ slots: "slots"
+ slots_of: "of"
+ minutes: "minutes"
#import external iCal calendar
icalendar:
icalendar_import: "iCalendar import"
@@ -189,7 +196,7 @@ pt:
booking: "Reserva"
sold_out: "Esgotado"
cancelled: "Cancelado"
- free_entry: "Entrada gratuita"
+ without_reservation: "Sem reservas"
free_admission: "Admissão gratuita"
view_reservations: "Ver reservas"
load_the_next_events: "Load the next events..."
@@ -276,15 +283,16 @@ pt:
prominence: "Relevância"
price: "Preço"
machine_hours: "Machine slots"
- these_prices_match_machine_hours_rates_: "Estes preços correspondem às {DURATION} minutos de trabalho"
- _without_subscriptions: "sem assinaturas"
+ these_prices_match_machine_hours_rates_html: "The prices below match one hour of machine usage,
without subscription."
+ prices_calculated_on_hourly_rate_html: "All the prices will be automatically calculated based on the hourly rate defined here.
For example, if you define an hourly rate at {RATE}: a slot of {DURATION} minutes (default), will be charged
{PRICE}."
+ you_can_override: "You can override this duration for each availability you create in the agenda. The price will then be adjusted accordingly."
machines: "Máquinas"
credits: "Créditos"
subscription: "Inscrições"
related_trainings: "Treinamentos relacionados"
add_a_machine_credit: "Adicionar crédito de máquina"
machine: "Máquina"
- hours: "Slots of {DURATION} minutes"
+ hours: "Slots (default {DURATION} minutes)"
related_subscriptions: "Assinaturas relacionadas"
please_specify_a_number: "Por favor especifique um número."
none: "Vazio" #grammar concordance with training.
@@ -330,7 +338,7 @@ pt:
forever: "Cada uso"
valid_until: "Válido até (incluindo)"
spaces: "Espaços"
- these_prices_match_space_hours_rates_: "Estes preços correspondem às {DURATION} minutos de espaço"
+ these_prices_match_space_hours_rates_html: "The prices below match one hour of space usage,
without subscription."
add_a_space_credit: "Adicionar espaço de crédito"
space: "Espaço"
error_a_credit_linking_this_space_with_that_subscription_already_exists: "Erro: um crédito que vincula esse espaço com essa assinatura já existe."
@@ -359,7 +367,7 @@ pt:
copy_prices_from: "Copiar preços de"
machines: "Máquinas"
machine: "Máquina"
- hourly_rate: "Price by slot"
+ hourly_rate: "Hourly rate"
spaces: "Espaços"
space: "Espaço"
unable_to_save_subscription_changes_please_try_again: "ImpossÃvel salvar mudanças da assinatura. Por favor tente novamente."
@@ -370,6 +378,7 @@ pt:
accounting_periods: "Accounting periods"
invoices_list: "Lista de faturas"
filter_invoices: "Filtrar faturas"
+ operator_: "Operator:"
invoice_num_: "Fatura #:"
customer_: "Cliente:"
date_: "Data:"
@@ -584,6 +593,7 @@ pt:
#management of users, labels, groups, and so on
members:
users_management: "Gerenciamento de usuários"
+ users: "Users"
members: "Membros"
subscriptions: "Subscriptions"
search_for_an_user: "Buscar por usuário"
@@ -599,6 +609,21 @@ pt:
administrators: "Administradores"
search_for_an_administrator: "Buscar por administrador"
add_a_new_administrator: "Adicionar novo administrador"
+ managers: "Managers"
+ managers_info: "A manager is a restricted administrator that cannot modify the settings of the application. However, he will be able to take reservations for any members and for all managers, including himself, and to process payments and refunds."
+ search_for_a_manager: "Search for a manager"
+ add_a_new_manager: "Add a new manager"
+ delete_this_manager: "Do you really want to delete this manager? This cannot be undone."
+ manager_successfully_deleted: "Manager successfully deleted."
+ unable_to_delete_the_manager: "Unable to delete the manager."
+ partners: "Partners"
+ partners_info: "A partner is a special user that can be associated with the «Partner» plans. These users won't be able to connect and will just receive notifications about subscriptions to their associated plan."
+ search_for_a_partner: "Search for a partner"
+ add_a_new_partner: "Add a new partner"
+ delete_this_partner: "Do you really want to delete this partner? This cannot be undone."
+ partner_successfully_deleted: "Partner successfully deleted."
+ unable_to_delete_the_partner: "Unable to delete the partner."
+ associated_plan: "Associated plan"
groups: "Grupos"
tags: "Tags"
authentication: "Autenticação"
@@ -702,6 +727,13 @@ pt:
error_details: "Error's details:"
#edit a member
members_edit:
+ change_role: "Change role"
+ warning_role_change: "
Warning: changing the role of a user is not a harmless operation. Is not currently possible to dismiss a user to a lower privileged role.
- Members can only book reservations for themselves, paying by card or wallet.
- Managers can book reservations for themselves, paying by card or wallet, and for other members and managers, by collecting payments at the checkout.
- Administrators can only book reservations for members and managers, by collecting payments at the checkout. Moreover, they can change every settings of the application.
"
+ admin: "Administrator"
+ manager: "Manager"
+ member: "Member"
+ role_changed: "Role successfully changed from {OLD} to {NEW}."
+ error_while_changing_role: "An error occurred while changing the role. Please try again later."
subscription: "Subscription"
duration: "Duração:"
expires_at: "Experia em:"
@@ -743,6 +775,8 @@ pt:
a_problem_occurred_while_taking_the_subscription: "Ocorreu um problema ao fazer a assinatura"
wallet: "Wallet"
to_credit: 'Credit'
+ cannot_credit_own_wallet: "You cannot credit your own wallet. Please ask another manager or an administrator to credit your wallet."
+ cannot_extend_own_subscription: "You cannot extend your own subscription. Please ask another manager or an administrator to extend your subscription."
#add a new administrator to the platform
admins_new:
add_an_administrator: "Adicionar administrador"
@@ -761,6 +795,24 @@ pt:
birth_date: "Date of birth"
address: "Address"
phone_number: "Phone number"
+ #add a new manager to the platform
+ manager_new:
+ add_a_manager: "Add a manager"
+ manager_successfully_created: "Manager successfully created. {GENDER, select, female{She} other{He}} receive {GENDER, select, female{her} other{his}} connection directives by e-mail."
+ failed_to_create_manager: "Unable to create the manager:"
+ man: "Man"
+ woman: "Woman"
+ pseudonym: "Pseudonym"
+ pseudonym_is_required: "Pseudonym is required."
+ first_name: "First name"
+ first_name_is_required: "First name is required."
+ surname: "Last name"
+ surname_is_required: "Last name is required."
+ email_address: "Email address"
+ email_is_required: "Email address is required."
+ birth_date: "Date of birth"
+ address: "Address"
+ phone_number: "Phone number"
#add a new authentication provider (SSO)
authentication_new:
local_database: "Local Database"
@@ -973,6 +1025,7 @@ pt:
advanced: "Advanced settings"
customize_home_page_css: "Customise the stylesheet og the home page"
home_css_notice_html: "You can customize the stylesheet which will apply to the home page, using the
SASS syntax. These styles will be automatically subordinated to the
.home-page
selector to prevent any risk of breaking the application. Meanwhile please be careful, any changes in the home page editor at the top of the page may broke your styles, always refer to the HTML code."
+ an_error_occurred_saving_the_setting: "An error occurred while saving the setting. Please try again later."
sort_by:
default: "Default"
name: "Nome"
@@ -1050,9 +1103,12 @@ pt:
welcome:
title: "Trainings"
content: "Here you can create, modify and delete trainings. It is also the place where you can validate the training courses followed by your members."
+ welcome_manager:
+ title: "Trainings"
+ content: "This is the place where you can view the trainings and their associations with the machines. It is also the place where you can validate the training courses followed by your members."
trainings:
title: "Manage trainings"
- content: "
When creating a training, you can define a default number of places. However, the number of actual places may be modified for each session.
The training sessions are scheduled from the administrator tab « Calendar ».
Another thing: it is possible to associate one or more machines with a training. This makes it a prerequisite for the reservation of these machines.
"
+ content: "
With each training, a default number of places is associated. However, the number of actual places may be modified for each session.
The training sessions are scheduled from the administrator tab « Calendar ».
Furthermore, a training may be associated with one or more machines. This makes it a prerequisite for the reservation of these machines.
"
filter:
title: "Filter"
content: "By default, only active courses are displayed here. Display the others by choosing another filter here."
@@ -1110,6 +1166,9 @@ pt:
welcome:
title: "Invoices"
content: "
Here you will be able to download invoices and credit notes issued, as well as manage everything related to accounting and invoicing.
If you use third-party software to manage your invoices, it is possible to deactivate the billing module. For this, contact your system administrator.
"
+ welcome_manager:
+ title: "Invoices"
+ content: "Here you will be able to download invoices and create credit notes."
list:
title: "Invoices list"
content: "By default, this table lists all the invoices and credit notes issued by Fab-manager. You can sort the list in a different order by clicking on the header of each column."
diff --git a/config/locales/app.admin.zu.yml b/config/locales/app.admin.zu.yml
index 12c2902ff..13ee8c22e 100644
--- a/config/locales/app.admin.zu.yml
+++ b/config/locales/app.admin.zu.yml
@@ -18,10 +18,13 @@ zu:
events: "crwdns6715:0crwdne6715:0"
availabilities: "crwdns6717:0crwdne6717:0"
availabilities_notice: "crwdns6719:0crwdne6719:0"
+ info: "crwdns20468:0crwdne20468:0"
+ tags: "crwdns20470:0crwdne20470:0"
+ slot_duration: "crwdns20472:0{DURATION}crwdne20472:0"
ongoing_reservations: "crwdns6721:0crwdne6721:0"
- no_reservations: "crwdns6723:0crwdne6723:0"
+ without_reservation: "crwdns20326:0crwdne20326:0"
confirmation_required: "crwdns6725:0crwdne6725:0"
- do_you_really_want_to_cancel_the_USER_s_reservation_the_DATE_at_TIME_concerning_RESERVATION: "crwdns6727:0{USER}crwdnd6727:0{DATE}crwdnd6727:0{TIME}crwdnd6727:0{RESERVATION}crwdne6727:0"
+ do_you_really_want_to_cancel_the_USER_s_reservation_the_DATE_at_TIME_concerning_RESERVATION: "crwdns20296:0GENDER={GENDER}crwdnd20296:0USER={USER}crwdnd20296:0DATE={DATE}crwdnd20296:0TIME={TIME}crwdnd20296:0RESERVATION={RESERVATION}crwdne20296:0"
reservation_was_successfully_cancelled: "crwdns6729:0crwdne6729:0"
reservation_cancellation_failed: "crwdns6731:0crwdne6731:0"
unable_to_remove_the_last_machine_of_the_slot_delete_the_slot_rather: "crwdns6733:0crwdne6733:0"
@@ -65,7 +68,7 @@ zu:
select_nb_period: "crwdns6787:0crwdne6787:0"
select_end_date: "crwdns6789:0crwdne6789:0"
about_to_create: "crwdns6791:0TYPE={TYPE}crwdnd6791:0NUMBER={NUMBER}crwdne6791:0"
- divided_in_slots: "crwdns20172:0COUNT={COUNT}crwdnd20172:0DURATION={DURATION}crwdne20172:0"
+ divided_in_slots: "crwdns20284:0COUNT={COUNT}crwdnd20284:0DURATION={DURATION}crwdne20284:0"
reservable: "crwdns6793:0crwdne6793:0"
labels: "crwdns6795:0crwdne6795:0"
none: "crwdns6797:0crwdne6797:0"
@@ -98,6 +101,10 @@ zu:
legend: "crwdns20198:0crwdne20198:0"
and: "crwdns6853:0crwdne6853:0"
external_sync: "crwdns19774:0crwdne19774:0"
+ divide_this_availability: "crwdns20300:0crwdne20300:0"
+ slots: "crwdns20302:0crwdne20302:0"
+ slots_of: "crwdns20304:0crwdne20304:0"
+ minutes: "crwdns20288:0crwdne20288:0"
#import external iCal calendar
icalendar:
icalendar_import: "crwdns6855:0crwdne6855:0"
@@ -189,7 +196,7 @@ zu:
booking: "crwdns7009:0crwdne7009:0"
sold_out: "crwdns7011:0crwdne7011:0"
cancelled: "crwdns7013:0crwdne7013:0"
- free_entry: "crwdns7015:0crwdne7015:0"
+ without_reservation: "crwdns20328:0crwdne20328:0"
free_admission: "crwdns7017:0crwdne7017:0"
view_reservations: "crwdns7019:0crwdne7019:0"
load_the_next_events: "crwdns7021:0crwdne7021:0"
@@ -276,15 +283,16 @@ zu:
prominence: "crwdns7143:0crwdne7143:0"
price: "crwdns7145:0crwdne7145:0"
machine_hours: "crwdns7147:0crwdne7147:0"
- these_prices_match_machine_hours_rates_: "crwdns7149:0{DURATION}crwdne7149:0"
- _without_subscriptions: "crwdns7151:0crwdne7151:0"
+ these_prices_match_machine_hours_rates_html: "crwdns20474:0crwdne20474:0"
+ prices_calculated_on_hourly_rate_html: "crwdns20476:0{RATE}crwdnd20476:0{DURATION}crwdnd20476:0{PRICE}crwdne20476:0"
+ you_can_override: "crwdns20478:0crwdne20478:0"
machines: "crwdns7153:0crwdne7153:0"
credits: "crwdns7155:0crwdne7155:0"
subscription: "crwdns7157:0crwdne7157:0"
related_trainings: "crwdns7159:0crwdne7159:0"
add_a_machine_credit: "crwdns7161:0crwdne7161:0"
machine: "crwdns7163:0crwdne7163:0"
- hours: "crwdns7165:0{DURATION}crwdne7165:0"
+ hours: "crwdns20292:0{DURATION}crwdne20292:0"
related_subscriptions: "crwdns7167:0crwdne7167:0"
please_specify_a_number: "crwdns7169:0crwdne7169:0"
none: "crwdns19808:0crwdne19808:0" #grammar concordance with training.
@@ -330,7 +338,7 @@ zu:
forever: "crwdns7251:0crwdne7251:0"
valid_until: "crwdns7253:0crwdne7253:0"
spaces: "crwdns7255:0crwdne7255:0"
- these_prices_match_space_hours_rates_: "crwdns7257:0{DURATION}crwdne7257:0"
+ these_prices_match_space_hours_rates_html: "crwdns20480:0crwdne20480:0"
add_a_space_credit: "crwdns7259:0crwdne7259:0"
space: "crwdns7261:0crwdne7261:0"
error_a_credit_linking_this_space_with_that_subscription_already_exists: "crwdns7263:0crwdne7263:0"
@@ -359,7 +367,7 @@ zu:
copy_prices_from: "crwdns7291:0crwdne7291:0"
machines: "crwdns7293:0crwdne7293:0"
machine: "crwdns7295:0crwdne7295:0"
- hourly_rate: "crwdns7297:0crwdne7297:0"
+ hourly_rate: "crwdns20482:0crwdne20482:0"
spaces: "crwdns7299:0crwdne7299:0"
space: "crwdns7301:0crwdne7301:0"
unable_to_save_subscription_changes_please_try_again: "crwdns7303:0crwdne7303:0"
@@ -370,6 +378,7 @@ zu:
accounting_periods: "crwdns7309:0crwdne7309:0"
invoices_list: "crwdns7311:0crwdne7311:0"
filter_invoices: "crwdns7313:0crwdne7313:0"
+ operator_: "crwdns20430:0crwdne20430:0"
invoice_num_: "crwdns7315:0crwdne7315:0"
customer_: "crwdns7317:0crwdne7317:0"
date_: "crwdns7319:0crwdne7319:0"
@@ -584,6 +593,7 @@ zu:
#management of users, labels, groups, and so on
members:
users_management: "crwdns7735:0crwdne7735:0"
+ users: "crwdns20306:0crwdne20306:0"
members: "crwdns7737:0crwdne7737:0"
subscriptions: "crwdns7739:0crwdne7739:0"
search_for_an_user: "crwdns7741:0crwdne7741:0"
@@ -599,6 +609,21 @@ zu:
administrators: "crwdns7761:0crwdne7761:0"
search_for_an_administrator: "crwdns7763:0crwdne7763:0"
add_a_new_administrator: "crwdns7765:0crwdne7765:0"
+ managers: "crwdns20324:0crwdne20324:0"
+ managers_info: "crwdns20330:0crwdne20330:0"
+ search_for_a_manager: "crwdns20332:0crwdne20332:0"
+ add_a_new_manager: "crwdns20334:0crwdne20334:0"
+ delete_this_manager: "crwdns20336:0crwdne20336:0"
+ manager_successfully_deleted: "crwdns20338:0crwdne20338:0"
+ unable_to_delete_the_manager: "crwdns20340:0crwdne20340:0"
+ partners: "crwdns20308:0crwdne20308:0"
+ partners_info: "crwdns20342:0crwdne20342:0"
+ search_for_a_partner: "crwdns20312:0crwdne20312:0"
+ add_a_new_partner: "crwdns20314:0crwdne20314:0"
+ delete_this_partner: "crwdns20316:0crwdne20316:0"
+ partner_successfully_deleted: "crwdns20318:0crwdne20318:0"
+ unable_to_delete_the_partner: "crwdns20320:0crwdne20320:0"
+ associated_plan: "crwdns20322:0crwdne20322:0"
groups: "crwdns7767:0crwdne7767:0"
tags: "crwdns7769:0crwdne7769:0"
authentication: "crwdns7771:0crwdne7771:0"
@@ -702,6 +727,13 @@ zu:
error_details: "crwdns7943:0crwdne7943:0"
#edit a member
members_edit:
+ change_role: "crwdns20432:0crwdne20432:0"
+ warning_role_change: "crwdns20434:0crwdne20434:0"
+ admin: "crwdns20436:0crwdne20436:0"
+ manager: "crwdns20438:0crwdne20438:0"
+ member: "crwdns20440:0crwdne20440:0"
+ role_changed: "crwdns20442:0{OLD}crwdnd20442:0{NEW}crwdne20442:0"
+ error_while_changing_role: "crwdns20444:0crwdne20444:0"
subscription: "crwdns7945:0crwdne7945:0"
duration: "crwdns7947:0crwdne7947:0"
expires_at: "crwdns7949:0crwdne7949:0"
@@ -743,6 +775,8 @@ zu:
a_problem_occurred_while_taking_the_subscription: "crwdns8021:0crwdne8021:0"
wallet: "crwdns8023:0crwdne8023:0"
to_credit: 'crwdns8025:0crwdne8025:0'
+ cannot_credit_own_wallet: "crwdns20344:0crwdne20344:0"
+ cannot_extend_own_subscription: "crwdns20346:0crwdne20346:0"
#add a new administrator to the platform
admins_new:
add_an_administrator: "crwdns8027:0crwdne8027:0"
@@ -761,6 +795,24 @@ zu:
birth_date: "crwdns8053:0crwdne8053:0"
address: "crwdns8055:0crwdne8055:0"
phone_number: "crwdns8057:0crwdne8057:0"
+ #add a new manager to the platform
+ manager_new:
+ add_a_manager: "crwdns20348:0crwdne20348:0"
+ manager_successfully_created: "crwdns20350:0GENDER={GENDER}crwdnd20350:0GENDER={GENDER}crwdne20350:0"
+ failed_to_create_manager: "crwdns20352:0crwdne20352:0"
+ man: "crwdns20354:0crwdne20354:0"
+ woman: "crwdns20356:0crwdne20356:0"
+ pseudonym: "crwdns20358:0crwdne20358:0"
+ pseudonym_is_required: "crwdns20360:0crwdne20360:0"
+ first_name: "crwdns20362:0crwdne20362:0"
+ first_name_is_required: "crwdns20364:0crwdne20364:0"
+ surname: "crwdns20366:0crwdne20366:0"
+ surname_is_required: "crwdns20368:0crwdne20368:0"
+ email_address: "crwdns20370:0crwdne20370:0"
+ email_is_required: "crwdns20372:0crwdne20372:0"
+ birth_date: "crwdns20374:0crwdne20374:0"
+ address: "crwdns20376:0crwdne20376:0"
+ phone_number: "crwdns20378:0crwdne20378:0"
#add a new authentication provider (SSO)
authentication_new:
local_database: "crwdns8059:0crwdne8059:0"
@@ -973,6 +1025,7 @@ zu:
advanced: "crwdns19864:0crwdne19864:0"
customize_home_page_css: "crwdns19866:0crwdne19866:0"
home_css_notice_html: "crwdns19868:0crwdne19868:0"
+ an_error_occurred_saving_the_setting: "crwdns20380:0crwdne20380:0"
sort_by:
default: "crwdns8417:0crwdne8417:0"
name: "crwdns8419:0crwdne8419:0"
@@ -1050,9 +1103,12 @@ zu:
welcome:
title: "crwdns19902:0crwdne19902:0"
content: "crwdns19904:0crwdne19904:0"
+ welcome_manager:
+ title: "crwdns20382:0crwdne20382:0"
+ content: "crwdns20384:0crwdne20384:0"
trainings:
title: "crwdns19906:0crwdne19906:0"
- content: "crwdns20218:0crwdne20218:0"
+ content: "crwdns20386:0crwdne20386:0"
filter:
title: "crwdns19910:0crwdne19910:0"
content: "crwdns19912:0crwdne19912:0"
@@ -1110,6 +1166,9 @@ zu:
welcome:
title: "crwdns19978:0crwdne19978:0"
content: "crwdns19980:0crwdne19980:0"
+ welcome_manager:
+ title: "crwdns20388:0crwdne20388:0"
+ content: "crwdns20390:0crwdne20390:0"
list:
title: "crwdns19982:0crwdne19982:0"
content: "crwdns19984:0crwdne19984:0"
diff --git a/config/locales/app.public.en.yml b/config/locales/app.public.en.yml
index c4b48c82e..38383a1db 100644
--- a/config/locales/app.public.en.yml
+++ b/config/locales/app.public.en.yml
@@ -29,6 +29,7 @@ en:
#left menu
notifications: "Notifications"
admin: "Admin"
+ manager: "Manager"
reduce_panel: "Reduce panel"
#left menu (public)
home: "Home"
@@ -146,7 +147,7 @@ en:
from_date_to_date: "From {START} to {END}"
on_the_date: "On the {DATE}"
from_time_to_time: "From {START} to {END}"
- free_entry: "Free entry"
+ without_reservation: "Without reservation"
free_admission: "Free admission"
full_price: "Full price: "
event_full: "Event full"
@@ -241,8 +242,8 @@ en:
your_subscription_expires_on_the_DATE: "Your subscription expires on the {DATE}"
my_group: "My group"
his_group: "{GENDER, select, male{His} female{Her} other{Its}} group"
- he_wants_to_change_group: "{ROLE, select, admin{The user wants} other{I want}} to change group"
- change_my_group: "Change {ROLE, select, admin{{GENDER, select, male{his} female{her} other{its}}} other{my}} group"
+ he_wants_to_change_group: "{ROLE, select, member{I want} other{The user wants}} to change group"
+ change_my_group: "Change {ROLE, select, member{my} other{{GENDER, select, male{his} female{her} other{its}}}} group"
summary: "Summary"
your_subscription_has_expired_on_the_DATE: "Your subscription has expired on the {DATE}"
subscription_price: "Subscription price"
@@ -269,7 +270,7 @@ en:
cancelled: "Cancelled"
free_admission: "Free admission"
still_available: "available place(s)"
- free_entry: "Free entry"
+ without_reservation: "Without reservation"
add_an_event: "Add an event"
load_the_next_events: "Load the next events..."
full_price_: "Full price:"
@@ -290,7 +291,7 @@ en:
full_price_: "Full price:"
tickets_still_availables: "Tickets still available:"
sold_out: "Sold out."
- free_entry: "Free entry"
+ without_reservation: "Without reservation"
cancelled: "Cancelled"
ticket: "{NUMBER, plural, one{ticket} other{tickets}}"
make_a_gift_of_this_reservation: "Make a gift of this reservation"
@@ -387,8 +388,8 @@ en:
title: "Subscriptions"
content: "Subscriptions provide a way to segment your prices and provide benefits to regular users."
admin:
- title: "Administrator section"
- content: "
All of the elements below are only accessible to administrators. They allow you to manage and configure Fab-manager.
At the end of this visit, click on one of them to find out more.
"
+ title: "{ROLE} section"
+ content: "
All of the elements below are only accessible to administrators and managers. They allow you to manage and configure Fab-manager.
At the end of this visit, click on one of them to find out more.
"
about:
title: "About"
content: "A page that you can fully customize, to present your activity and your structure."
@@ -423,13 +424,25 @@ en:
welcome:
title: "Machines"
content: "
Machines are the tools available for your users. You must create here the machines which can then be reserved by the members.
You can also create entries for non-bookable or free access machines, then you just need to not associate availability slots with them.
"
+ welcome_manager:
+ title: "Machines"
+ content: "Machines are the tools available for the users to reserve."
view:
title: "View"
content: "To modify or delete a machine, click here first. You will not be able to delete a machine that has already been associated with availability slots, but you can deactivate it."
+ reserve:
+ title: "Reserve"
+ content: "Click here to access an agenda showing free slots. This will let you book this machine for an user and manage existing reservations."
spaces:
welcome:
title: "Spaces"
content: "
Spaces are places available for your users. For example, a meeting room or a woodshop. You must create here the spaces which can then be reserved by members.
The specificity of the spaces is that they can be reserved by several users at the same time.
"
+ welcome_manager:
+ title: "Spaces"
+ content: "
Spaces are places available to users, by reservation. For example, a meeting room or a woodshop.
The specificity of the spaces is that they can be reserved by several users at the same time.
"
view:
title: "View"
content: "To modify or delete a space, click here first. You will not be able to delete a space that has already been associated with availability slots, but you can deactivate it."
+ reserve:
+ title: "Reserve"
+ content: "Click here to access an agenda showing free slots. This will let you book this space for an user and manage existing reservations."
\ No newline at end of file
diff --git a/config/locales/app.public.es.yml b/config/locales/app.public.es.yml
index 92fcaebac..0433a4a0a 100644
--- a/config/locales/app.public.es.yml
+++ b/config/locales/app.public.es.yml
@@ -29,6 +29,7 @@ es:
#left menu
notifications: "Notificaciones"
admin: "Administrador"
+ manager: "Manager"
reduce_panel: "Reducir panel"
#left menu (public)
home: "Menú principal"
@@ -146,8 +147,8 @@ es:
from_date_to_date: "Desde {START} hasta {END}"
on_the_date: "El {DATE}"
from_time_to_time: "Desde {START} hasta {END}"
- free_entry: "Entrada gratuita"
- free_admission: "Admisión gratuita"
+ without_reservation: "Sin reserva"
+ free_admission: "Entrada gratuita"
full_price: "Precio completo: "
event_full: "Evento lleno"
still_available: "Asiento(s) disponible(s): "
@@ -241,8 +242,8 @@ es:
your_subscription_expires_on_the_DATE: "Su suscripción termina {DATE}"
my_group: "My grupo"
his_group: "{GENDER, select, male{His} female{Her} other{Its}} group"
- he_wants_to_change_group: "{ROLE, select, admin{The user wants} other{I want}} cambiar el grupo"
- change_my_group: "Cambiar {ROLE, select, admin{{GENDER, select, male{his} female{her} other{its}}} other{my}} grupo"
+ he_wants_to_change_group: "{ROLE, select, member{Quiero} other{El usuario quiere}} cambiar el grupo"
+ change_my_group: "Cambiar {ROLE, select, member{mi} other{{GENDER, select, other{su}}}} grupo"
summary: "Summary"
your_subscription_has_expired_on_the_DATE: "Sus suscripcion expiró el {DATE}"
subscription_price: "Subscription price"
@@ -267,9 +268,9 @@ es:
for_all: "Para todo"
sold_out: "Sold Out"
cancelled: "Cancelled"
- free_admission: "Free admission"
+ free_admission: "Entrada gratuita"
still_available: "asiento(s) disponible(s)"
- free_entry: "Free entry"
+ without_reservation: "Sin reserva"
add_an_event: "Add an event"
load_the_next_events: "Cargar los próximos eventos..."
full_price_: "Precio completo:"
@@ -290,7 +291,7 @@ es:
full_price_: "Precio completo:"
tickets_still_availables: "Entradas disponibles:"
sold_out: "Entradas vendidas."
- free_entry: "Entrada gratuita"
+ without_reservation: "Sin reserva"
cancelled: "Cancelled"
ticket: "{NUMBER, plural, one{ticket} other{tickets}}"
make_a_gift_of_this_reservation: "Regalar esta reserva"
@@ -387,8 +388,8 @@ es:
title: "Subscriptions"
content: "Subscriptions provide a way to segment your prices and provide benefits to regular users."
admin:
- title: "Administrator section"
- content: "
All of the elements below are only accessible to administrators. They allow you to manage and configure Fab-manager.
At the end of this visit, click on one of them to find out more.
"
+ title: "{ROLE} section"
+ content: "
All of the elements below are only accessible to administrators and managers. They allow you to manage and configure Fab-manager.
At the end of this visit, click on one of them to find out more.
"
about:
title: "About"
content: "A page that you can fully customize, to present your activity and your structure."
@@ -423,13 +424,25 @@ es:
welcome:
title: "Machines"
content: "
Machines are the tools available for your users. You must create here the machines which can then be reserved by the members.
You can also create entries for non-bookable or free access machines, then you just need to not associate availability slots with them.
"
+ welcome_manager:
+ title: "Machines"
+ content: "Machines are the tools available for the users to reserve."
view:
title: "View"
content: "To modify or delete a machine, click here first. You will not be able to delete a machine that has already been associated with availability slots, but you can deactivate it."
+ reserve:
+ title: "Reserve"
+ content: "Click here to access an agenda showing free slots. This will let you book this machine for an user and manage existing reservations."
spaces:
welcome:
title: "Spaces"
content: "
Spaces are places available for your users. For example, a meeting room or a woodshop. You must create here the spaces which can then be reserved by members.
The specificity of the spaces is that they can be reserved by several users at the same time.
"
+ welcome_manager:
+ title: "Spaces"
+ content: "
Spaces are places available to users, by reservation. For example, a meeting room or a woodshop.
The specificity of the spaces is that they can be reserved by several users at the same time.
"
view:
title: "View"
content: "To modify or delete a space, click here first. You will not be able to delete a space that has already been associated with availability slots, but you can deactivate it."
+ reserve:
+ title: "Reserve"
+ content: "Click here to access an agenda showing free slots. This will let you book this space for an user and manage existing reservations."
diff --git a/config/locales/app.public.fr.yml b/config/locales/app.public.fr.yml
index c9807097b..dc8df6ceb 100644
--- a/config/locales/app.public.fr.yml
+++ b/config/locales/app.public.fr.yml
@@ -29,6 +29,7 @@ fr:
#left menu
notifications: "Notifications"
admin: "Admin"
+ manager: "Gestionnaire"
reduce_panel: "Réduire le volet"
#left menu (public)
home: "Accueil"
@@ -146,7 +147,7 @@ fr:
from_date_to_date: "Du {START} au {END}"
on_the_date: "Le {DATE}"
from_time_to_time: "De {START} Ã {END}"
- free_entry: "Accès libre"
+ without_reservation: "Sans réservation"
free_admission: "Entrée gratuite"
full_price: "Plein tarif : "
event_full: "Événement complet"
@@ -241,8 +242,8 @@ fr:
your_subscription_expires_on_the_DATE: "Votre abonnement expire au {DATE}"
my_group: "Mon groupe"
his_group: "Son groupe"
- he_wants_to_change_group: "{ROLE, select, admin{L'utilisateur veut} other{Je veux}} changer de groupe"
- change_my_group: "Changer {ROLE, select, admin{son} other{mon}} groupe"
+ he_wants_to_change_group: "{ROLE, select, member{Je veux} other{L'utilisateur veut}} changer de groupe"
+ change_my_group: "Changer {ROLE, select, member{mon} other{{GENDER, select, other{son}}}} groupe"
summary: "Résumé"
your_subscription_has_expired_on_the_DATE: "Votre abonnement a expiré au {DATE}"
subscription_price: "Coût de l'abonnement"
@@ -269,7 +270,7 @@ fr:
cancelled: "Annulé"
free_admission: "Gratuit"
still_available: "place(s) disponible(s)"
- free_entry: "Accès libre"
+ without_reservation: "Sans réservation"
add_an_event: "Ajouter un évènement"
load_the_next_events: "Charger les évènements suivants..."
full_price_: "Plein tarif :"
@@ -290,7 +291,7 @@ fr:
full_price_: "Plein tarif :"
tickets_still_availables: "Places encore disponibles :"
sold_out: "Événement complet."
- free_entry: "Accès libre"
+ without_reservation: "Sans réservation"
cancelled: "Annulé"
ticket: "{NUMBER, plural, =0{place} one{place} other{places}}"
make_a_gift_of_this_reservation: "Offrir cette réservation"
@@ -387,8 +388,8 @@ fr:
title: "Abonnements"
content: "Les abonnements offrent un moyen de segmenter vos tarifs et d'accorder des avantages aux utilisateurs réguliers."
admin:
- title: "Section administrateur"
- content: "
L'ensemble des éléments ci-dessous ne sont accessibles qu'aux administrateurs. Ils permettent de gérer et de configurer Fab-manager.
À la fin de cette visite, cliquez sur l'un d'entre eux pour en savoir plus.
"
+ title: "Section {ROLE}"
+ content: "
L'ensemble des éléments ci-dessous ne sont accessibles qu'aux administrateurs et aux gestionnaires. Ils permettent de gérer et de configurer Fab-manager.
À la fin de cette visite, cliquez sur l'un d'entre eux pour en savoir plus.
"
about:
title: "À propos"
content: "Une page que vous pouvez entièrement personnaliser, pour y présenter votre activité et votre structure."
@@ -423,13 +424,25 @@ fr:
welcome:
title: "Machines"
content: "
Les machines sont les outils que vous mettez à disposition de vos utilisateurs. Vous devez créer ici les machines qui pourront ensuite être réservées par les membres.
Vous pouvez également créer des entrées pour des machines non réservables ou en libre accès, il vous suffira ensuite de ne pas associer de créneaux de disponibilités à celles-ci.
"
+ welcome_manager:
+ title: "Machines"
+ content: "Les machines sont les outils disponibles pour être réservés par les utilisateurs."
view:
title: "Consulter"
content: "Pour modifier ou supprimer une machine, cliquez tout d'abord ici. Vous ne pourrez pas supprimer une machine qui a déjà été associée à des créneaux de disponibilité, mais vous pourrez la désactiver."
+ reserve:
+ title: "Réserver"
+ content: "Cliquez ici pour accéder à un agenda montrant les créneaux libres. Cela vous permettra de réserver cette machine pour un utilisateur et de gérer les réservations existantes."
spaces:
welcome:
title: "Espaces"
content: "
Les espaces sont des lieux que vous mettez à disposition de vos utilisateurs. Par exemple, une salle de réunion ou un atelier bois. Vous devez créer ici les espaces qui pourront ensuite être réservées par les membres.
La spécificité des espaces est qu'ils peuvent être réservés par plusieurs utilisateurs en même temps.
"
+ welcome_manager:
+ title: "Espaces"
+ content: "
Les espaces sont des lieux à disposition des utilisateurs, sur réservation. Par exemple, une salle de réunion ou un atelier bois.
La spécificité des espaces est qu'ils peuvent être réservés par plusieurs utilisateurs en même temps.
"
view:
title: "Consulter"
content: "Pour modifier ou supprimer un espace, cliquez tout d'abord ici. Vous ne pourrez pas supprimer un espace qui a déjà été associée à des créneaux de disponibilité, mais vous pourrez le désactiver."
+ reserve:
+ title: "Réserver"
+ content: "Cliquez ici pour accéder à un agenda montrant les créneaux libres. Cela vous permettra de réserver cet espace pour un utilisateur et de gérer les réservations existantes."
diff --git a/config/locales/app.public.pt.yml b/config/locales/app.public.pt.yml
index 889e1fbeb..4fc096db5 100755
--- a/config/locales/app.public.pt.yml
+++ b/config/locales/app.public.pt.yml
@@ -29,6 +29,7 @@ pt:
#left menu
notifications: "Nofificações"
admin: "Admin"
+ manager: "Manager"
reduce_panel: "Reduzir painel"
#left menu (public)
home: "InÃcio"
@@ -146,7 +147,7 @@ pt:
from_date_to_date: "De {START} até {END}"
on_the_date: "Em {DATE}"
from_time_to_time: "Das {START} até {END}"
- free_entry: "Entrada franca"
+ without_reservation: "Sem reservas"
free_admission: "Admissão grátis"
full_price: "Valor inteira: "
event_full: "Evento lotado"
@@ -241,8 +242,8 @@ pt:
your_subscription_expires_on_the_DATE: "Sua inscrição expira em {DATE}"
my_group: "Meu grupo"
his_group: "{GENDER, select, male{Ele} female{Ela} other{Esses}} grupo"
- he_wants_to_change_group: "{ROLE, select, admin{O usuário quer} other{Eu quero}} trocar de grupo"
- change_my_group: "Mudar {ROLE, select, admin{{GENDER, select, male{dele} female{dela} other{esses}}} other{meu}} grupo"
+ he_wants_to_change_group: "{ROLE, select, member{Eu quero} other{O usuário quer}} trocar de grupo"
+ change_my_group: "Mudar {ROLE, select, member{meu} other{{GENDER, select, other{seu}}}} grupo"
summary: "Summary"
your_subscription_has_expired_on_the_DATE: "Sua inscrição expirou em {DATE}"
subscription_price: "Subscription price"
@@ -269,7 +270,7 @@ pt:
cancelled: "Cancelado"
free_admission: "Admissão grátis"
still_available: "lugares disponÃveis"
- free_entry: "Entrada franca"
+ without_reservation: "Sem reservas"
add_an_event: "Add an event"
load_the_next_events: "Load the next events..."
full_price_: "Valor inteira:"
@@ -290,7 +291,7 @@ pt:
full_price_: "Valor inteira:"
tickets_still_availables: "Tickets ainda disponÃveis:"
sold_out: "Esgotado."
- free_entry: "Entrada franca"
+ without_reservation: "Sem reservas"
cancelled: "Cancelado"
ticket: "{NUMBER, plural, one{ticket} other{tickets}}"
make_a_gift_of_this_reservation: "Doe esta reserva"
@@ -387,8 +388,8 @@ pt:
title: "Subscriptions"
content: "Subscriptions provide a way to segment your prices and provide benefits to regular users."
admin:
- title: "Administrator section"
- content: "
All of the elements below are only accessible to administrators. They allow you to manage and configure Fab-manager.
At the end of this visit, click on one of them to find out more.
"
+ title: "{ROLE} section"
+ content: "
All of the elements below are only accessible to administrators and managers. They allow you to manage and configure Fab-manager.
At the end of this visit, click on one of them to find out more.
"
about:
title: "About"
content: "A page that you can fully customize, to present your activity and your structure."
@@ -423,13 +424,25 @@ pt:
welcome:
title: "Machines"
content: "
Machines are the tools available for your users. You must create here the machines which can then be reserved by the members.
You can also create entries for non-bookable or free access machines, then you just need to not associate availability slots with them.
"
+ welcome_manager:
+ title: "Machines"
+ content: "Machines are the tools available for the users to reserve."
view:
title: "View"
content: "To modify or delete a machine, click here first. You will not be able to delete a machine that has already been associated with availability slots, but you can deactivate it."
+ reserve:
+ title: "Reserve"
+ content: "Click here to access an agenda showing free slots. This will let you book this machine for an user and manage existing reservations."
spaces:
welcome:
title: "Spaces"
content: "
Spaces are places available for your users. For example, a meeting room or a woodshop. You must create here the spaces which can then be reserved by members.
The specificity of the spaces is that they can be reserved by several users at the same time.
"
+ welcome_manager:
+ title: "Spaces"
+ content: "
Spaces are places available to users, by reservation. For example, a meeting room or a woodshop.
The specificity of the spaces is that they can be reserved by several users at the same time.
"
view:
title: "View"
content: "To modify or delete a space, click here first. You will not be able to delete a space that has already been associated with availability slots, but you can deactivate it."
+ reserve:
+ title: "Reserve"
+ content: "Click here to access an agenda showing free slots. This will let you book this space for an user and manage existing reservations."
diff --git a/config/locales/app.public.zu.yml b/config/locales/app.public.zu.yml
index 825768da4..19f33419f 100644
--- a/config/locales/app.public.zu.yml
+++ b/config/locales/app.public.zu.yml
@@ -29,6 +29,7 @@ zu:
#left menu
notifications: "crwdns8839:0crwdne8839:0"
admin: "crwdns8841:0crwdne8841:0"
+ manager: "crwdns20392:0crwdne20392:0"
reduce_panel: "crwdns8843:0crwdne8843:0"
#left menu (public)
home: "crwdns8845:0crwdne8845:0"
@@ -146,7 +147,7 @@ zu:
from_date_to_date: "crwdns9021:0{START}crwdnd9021:0{END}crwdne9021:0"
on_the_date: "crwdns9023:0{DATE}crwdne9023:0"
from_time_to_time: "crwdns9025:0{START}crwdnd9025:0{END}crwdne9025:0"
- free_entry: "crwdns9027:0crwdne9027:0"
+ without_reservation: "crwdns20394:0crwdne20394:0"
free_admission: "crwdns9029:0crwdne9029:0"
full_price: "crwdns20242:0crwdne20242:0"
event_full: "crwdns9033:0crwdne9033:0"
@@ -241,8 +242,8 @@ zu:
your_subscription_expires_on_the_DATE: "crwdns9179:0{DATE}crwdne9179:0"
my_group: "crwdns9181:0crwdne9181:0"
his_group: "crwdns9183:0GENDER={GENDER}crwdne9183:0"
- he_wants_to_change_group: "crwdns9185:0ROLE={ROLE}crwdne9185:0"
- change_my_group: "crwdns9187:0ROLE={ROLE}crwdnd9187:0GENDER={GENDER}crwdne9187:0"
+ he_wants_to_change_group: "crwdns20396:0ROLE={ROLE}crwdne20396:0"
+ change_my_group: "crwdns20398:0ROLE={ROLE}crwdnd20398:0GENDER={GENDER}crwdne20398:0"
summary: "crwdns9189:0crwdne9189:0"
your_subscription_has_expired_on_the_DATE: "crwdns9191:0{DATE}crwdne9191:0"
subscription_price: "crwdns9193:0crwdne9193:0"
@@ -269,7 +270,7 @@ zu:
cancelled: "crwdns9231:0crwdne9231:0"
free_admission: "crwdns9233:0crwdne9233:0"
still_available: "crwdns9235:0crwdne9235:0"
- free_entry: "crwdns9237:0crwdne9237:0"
+ without_reservation: "crwdns20400:0crwdne20400:0"
add_an_event: "crwdns9239:0crwdne9239:0"
load_the_next_events: "crwdns9241:0crwdne9241:0"
full_price_: "crwdns9243:0crwdne9243:0"
@@ -290,7 +291,7 @@ zu:
full_price_: "crwdns9267:0crwdne9267:0"
tickets_still_availables: "crwdns9269:0crwdne9269:0"
sold_out: "crwdns9271:0crwdne9271:0"
- free_entry: "crwdns9273:0crwdne9273:0"
+ without_reservation: "crwdns20402:0crwdne20402:0"
cancelled: "crwdns9275:0crwdne9275:0"
ticket: "crwdns9277:0NUMBER={NUMBER}crwdne9277:0"
make_a_gift_of_this_reservation: "crwdns9279:0crwdne9279:0"
@@ -387,8 +388,8 @@ zu:
title: "crwdns19682:0crwdne19682:0"
content: "crwdns19684:0crwdne19684:0"
admin:
- title: "crwdns19686:0crwdne19686:0"
- content: "crwdns19688:0crwdne19688:0"
+ title: "crwdns20404:0{ROLE}crwdne20404:0"
+ content: "crwdns20406:0crwdne20406:0"
about:
title: "crwdns19690:0crwdne19690:0"
content: "crwdns19692:0crwdne19692:0"
@@ -423,13 +424,25 @@ zu:
welcome:
title: "crwdns19730:0crwdne19730:0"
content: "crwdns19732:0crwdne19732:0"
+ welcome_manager:
+ title: "crwdns20408:0crwdne20408:0"
+ content: "crwdns20410:0crwdne20410:0"
view:
title: "crwdns19734:0crwdne19734:0"
content: "crwdns19736:0crwdne19736:0"
+ reserve:
+ title: "crwdns20412:0crwdne20412:0"
+ content: "crwdns20424:0crwdne20424:0"
spaces:
welcome:
title: "crwdns19738:0crwdne19738:0"
content: "crwdns19740:0crwdne19740:0"
+ welcome_manager:
+ title: "crwdns20416:0crwdne20416:0"
+ content: "crwdns20426:0crwdne20426:0"
view:
title: "crwdns19742:0crwdne19742:0"
content: "crwdns19744:0crwdne19744:0"
+ reserve:
+ title: "crwdns20420:0crwdne20420:0"
+ content: "crwdns20428:0crwdne20428:0"
diff --git a/config/locales/app.shared.en.yml b/config/locales/app.shared.en.yml
index 1c21c3474..e66507285 100644
--- a/config/locales/app.shared.en.yml
+++ b/config/locales/app.shared.en.yml
@@ -379,7 +379,7 @@ en:
select_one_or_more_slots_in_the_calendar: "Select one {SINGLE, select, true{slot} other{or more slots}} in the calendar"
you_ve_just_selected_the_slot: "You've just selected the slot:"
datetime_to_time: "{START_DATETIME} to {END_TIME}" #eg: Thursday, September 4 1986 8:30 PM to 10:00 PM
- cost_of_TYPE: "Cost of {TYPE, select, Machine{a machine hour} Training{the training} other{the element}}"
+ cost_of_TYPE: "Cost of the {TYPE, select, Machine{machine slot} Training{training} Space{space slot} other{element}}"
offer_this_slot: "Offer this slot"
confirm_this_slot: "Confirm this slot"
remove_this_slot: "Remove this slot"
@@ -425,6 +425,12 @@ en:
slot_at_same_time: "Conflict with others reservations"
do_you_really_want_to_book_slot_at_same_time: "Do you really want to book this slot? Other bookings take place at the same time"
unable_to_book_slot_because_really_have_reservation_at_same_time: "Unable to book this slot because the following reservation occurs at the same time."
+ tags_mismatch: "Tags mismatch"
+ confirm_book_slot_tags_mismatch: "Do you really want to book this slot? {USER} does not have any of the required tags."
+ unable_to_book_slot_tags_mismatch: "Unable to book this slot because you don't have any of the required tags."
+ slot_tags: "Slot tags"
+ user_tags: "User tags"
+ no_tags: "No tags"
# feature-tour modal
tour:
previous: "Previous"
diff --git a/config/locales/app.shared.es.yml b/config/locales/app.shared.es.yml
index 41e64ad94..f1dca4d36 100644
--- a/config/locales/app.shared.es.yml
+++ b/config/locales/app.shared.es.yml
@@ -57,7 +57,7 @@ es:
phone_number: "Phone number"
phone_number_is_required: "Phone number is required."
i_authorize_Fablab_users_registered_on_the_site_to_contact_me: "I authorize FabLab users, registered on the site, to contact me"
- i_accept_to_receive_information_from_the_fablab: "I accept to receive information from the FabLab"
+ i_accept_to_receive_information_from_the_fablab: "Acepto recibir información del FabLab"
used_for_statistics: "This data will be used for statistical purposes"
used_for_invoicing: "This data will be used for billing purposes"
used_for_reservation: "This data will be used in case of change on one of your bookings"
@@ -379,7 +379,7 @@ es:
select_one_or_more_slots_in_the_calendar: "Selecciona uno {SINGLE, select, true{slot} other{or more slots}} en el calendario"
you_ve_just_selected_the_slot: "Acaba de seleccionar el espacio :"
datetime_to_time: "{START_DATETIME} hasta {END_TIME}" #eg: Thursday, September 4 1986 8:30 PM to 10:00 PM
- cost_of_TYPE: "Coste de {TYPE, select, Machine{a machine hour} Training{the training} other{the element}}"
+ cost_of_TYPE: "Cost of the {TYPE, select, Machine{machine slot} Training{training} Space{space slot} other{element}}"
offer_this_slot: "Ofertar este espacio"
confirm_this_slot: "Confirmar este espacio"
remove_this_slot: "Eliminar este espacio"
@@ -425,6 +425,12 @@ es:
slot_at_same_time: "Conflict with others reservations"
do_you_really_want_to_book_slot_at_same_time: "Do you really want to book this slot? Other bookings take place at the same time"
unable_to_book_slot_because_really_have_reservation_at_same_time: "Unable to book this slot because the following reservation occurs at the same time."
+ tags_mismatch: "Tags mismatch"
+ confirm_book_slot_tags_mismatch: "Do you really want to book this slot? {USER} does not have any of the required tags."
+ unable_to_book_slot_tags_mismatch: "Unable to book this slot because you don't have any of the required tags."
+ slot_tags: "Slot tags"
+ user_tags: "User tags"
+ no_tags: "No tags"
#feature-tour modal
tour:
previous: "Previous"
diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml
index 01403caeb..21449714e 100644
--- a/config/locales/app.shared.fr.yml
+++ b/config/locales/app.shared.fr.yml
@@ -57,7 +57,7 @@ fr:
phone_number: "Numéro de téléphone"
phone_number_is_required: "Le numéro de téléphone est requis."
i_authorize_Fablab_users_registered_on_the_site_to_contact_me: "J'autorise les utilisateurs du Fab Lab inscrits sur le site à me contacter"
- i_accept_to_receive_information_from_the_fablab: "I accept to receive information from the FabLab"
+ i_accept_to_receive_information_from_the_fablab: "J'accepte de recevoir des informations du Fab Lab"
used_for_statistics: "Cette donnée sera utilisée à des fins statistiques"
used_for_invoicing: "Cette donnée sera utilisée à des fins de facturation"
used_for_reservation: "Cette donnée sera utilisée en cas de changement sur une de vos réservations"
@@ -379,7 +379,7 @@ fr:
select_one_or_more_slots_in_the_calendar: "Sélectionnez un {SINGLE, select, true{créneau} other{ou plusieurs créneaux}} dans le calendrier"
you_ve_just_selected_the_slot: "Vous venez de sélectionner le créneau :"
datetime_to_time: "{START_DATETIME} Ã {END_TIME}" #eg: Thursday, September 4 1986 8:30 PM to 10:00 PM
- cost_of_TYPE: "Coût de {TYPE, select, Machine{l'heure machine} Training{la formation} other{l'élément}}"
+ cost_of_TYPE: "Coût {TYPE, select, Machine{du créneau machine} Training{de la formation} Space{du créneau espace} other{de l'élément}}"
offer_this_slot: "Offrir ce créneau"
confirm_this_slot: "Valider ce créneau"
remove_this_slot: "Supprimer ce créneau"
@@ -425,6 +425,12 @@ fr:
slot_at_same_time: "Conflit avec d'autres réservations"
do_you_really_want_to_book_slot_at_same_time: "Êtes-vous sûr de réserver ce créneau ? D'autres réservations ont lieu en même temps"
unable_to_book_slot_because_really_have_reservation_at_same_time: "Impossible de réserver ce créneau car les réservations ci-dessous ont lieu en même temps."
+ tags_mismatch: "Étiquettes incompatibles"
+ confirm_book_slot_tags_mismatch: "Êtes-vous sûr de vouloir réserver ce créneau ? {USER} ne possède aucune des étiquettes requises."
+ unable_to_book_slot_tags_mismatch: "Impossible de réserver ce créneau car vous ne possédez aucune des étiquettes requises."
+ slot_tags: "Étiquettes du créneau"
+ user_tags: "Étiquettes de l'utilisateur"
+ no_tags: "Aucune étiquette"
#feature-tour modal
tour:
previous: "Précédent"
diff --git a/config/locales/app.shared.pt.yml b/config/locales/app.shared.pt.yml
index 577b81657..b689f5b21 100755
--- a/config/locales/app.shared.pt.yml
+++ b/config/locales/app.shared.pt.yml
@@ -57,7 +57,7 @@ pt:
phone_number: "Phone number"
phone_number_is_required: "Phone number is required."
i_authorize_Fablab_users_registered_on_the_site_to_contact_me: "I authorize FabLab users, registered on the site, to contact me"
- i_accept_to_receive_information_from_the_fablab: "I accept to receive information from the FabLab"
+ i_accept_to_receive_information_from_the_fablab: "Eu aceito receber informações do FabLab"
used_for_statistics: "This data will be used for statistical purposes"
used_for_invoicing: "This data will be used for billing purposes"
used_for_reservation: "This data will be used in case of change on one of your bookings"
@@ -379,7 +379,7 @@ pt:
select_one_or_more_slots_in_the_calendar: "Selecionar um {SINGLE, select, true{slot} other{ou mais slots}} no calendário"
you_ve_just_selected_the_slot: "Você selecionou apenas o slot:"
datetime_to_time: "{START_DATETIME} até {END_TIME}" #eg: Thursday, September 4 1986 8:30 PM to 10:00 PM
- cost_of_TYPE: "Custo de {TYPE, select, Machine{máquina hora} Training{o treinamento} other{o elemento}}"
+ cost_of_TYPE: "Custo de {TYPE, select, Machine{máquina slot} Training{o treinamento} Space{espaço slot} other{o elemento}}"
offer_this_slot: "Oferecer este slot"
confirm_this_slot: "Confirmar este slot"
remove_this_slot: "Remover este slot"
@@ -425,6 +425,12 @@ pt:
slot_at_same_time: "Conflict with others reservations"
do_you_really_want_to_book_slot_at_same_time: "Do you really want to book this slot? Other bookings take place at the same time"
unable_to_book_slot_because_really_have_reservation_at_same_time: "Unable to book this slot because the following reservation occurs at the same time."
+ tags_mismatch: "Tags mismatch"
+ confirm_book_slot_tags_mismatch: "Do you really want to book this slot? {USER} does not have any of the required tags."
+ unable_to_book_slot_tags_mismatch: "Unable to book this slot because you don't have any of the required tags."
+ slot_tags: "Slot tags"
+ user_tags: "User tags"
+ no_tags: "No tags"
#feature-tour modal
tour:
previous: "Previous"
diff --git a/config/locales/app.shared.zu.yml b/config/locales/app.shared.zu.yml
index 5640a2770..56d8084a0 100644
--- a/config/locales/app.shared.zu.yml
+++ b/config/locales/app.shared.zu.yml
@@ -379,7 +379,7 @@ zu:
select_one_or_more_slots_in_the_calendar: "crwdns10031:0SINGLE={SINGLE}crwdne10031:0"
you_ve_just_selected_the_slot: "crwdns10033:0crwdne10033:0"
datetime_to_time: "crwdns10035:0{START_DATETIME}crwdnd10035:0{END_TIME}crwdne10035:0" #eg: Thursday, September 4 1986 8:30 PM to 10:00 PM
- cost_of_TYPE: "crwdns10037:0TYPE={TYPE}crwdne10037:0"
+ cost_of_TYPE: "crwdns20298:0TYPE={TYPE}crwdne20298:0"
offer_this_slot: "crwdns10039:0crwdne10039:0"
confirm_this_slot: "crwdns10041:0crwdne10041:0"
remove_this_slot: "crwdns10043:0crwdne10043:0"
@@ -425,6 +425,12 @@ zu:
slot_at_same_time: "crwdns20150:0crwdne20150:0"
do_you_really_want_to_book_slot_at_same_time: "crwdns20152:0crwdne20152:0"
unable_to_book_slot_because_really_have_reservation_at_same_time: "crwdns20154:0crwdne20154:0"
+ tags_mismatch: "crwdns20484:0crwdne20484:0"
+ confirm_book_slot_tags_mismatch: "crwdns20486:0{USER}crwdne20486:0"
+ unable_to_book_slot_tags_mismatch: "crwdns20488:0crwdne20488:0"
+ slot_tags: "crwdns20490:0crwdne20490:0"
+ user_tags: "crwdns20492:0crwdne20492:0"
+ no_tags: "crwdns20494:0crwdne20494:0"
#feature-tour modal
tour:
previous: "crwdns20166:0crwdne20166:0"
diff --git a/config/locales/en.yml b/config/locales/en.yml
index f7ecd4c5d..b4d4eff67 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -214,6 +214,10 @@ en:
event: "Event"
reservations: "Reservations"
available_seats: "Available seats"
+ roles:
+ member: "Member"
+ manager: "Manager"
+ admin: "Administrator"
api:
#internal app notifications
notifications:
@@ -329,6 +333,10 @@ en:
click_to_show: "Click here to consult"
notify_admin_refund_created:
refund_created: "A refund of %{AMOUNT} has been created for user %{USER}"
+ notify_user_role_update:
+ your_role_is_ROLE: "Your role has been changed to %{ROLE}."
+ notify_admins_role_update:
+ user_NAME_changed_ROLE_html: "User
%{NAME} is now %{ROLE}."
#statistics tools for admins
statistics:
subscriptions: "Subscriptions"
diff --git a/config/locales/es.yml b/config/locales/es.yml
index be0e91d15..764028fb7 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -214,6 +214,10 @@ es:
event: "Evento"
reservations: "Reservas"
available_seats: "Asientos disponibles"
+ roles:
+ member: "Miembro"
+ manager: "Gerente"
+ admin: "Administrador"
api:
#internal app notifications
notifications:
@@ -329,6 +333,10 @@ es:
click_to_show: "Haga clic aquà para consultar"
notify_admin_refund_created:
refund_created: "Se ha creado un reembolso de %{AMOUNT} para el usuario %{USER}"
+ notify_user_role_update:
+ your_role_is_ROLE: "Your role has been changed to %{ROLE}."
+ notify_admins_role_update:
+ user_NAME_changed_ROLE_html: "User
%{NAME} is now %{ROLE}."
#statistics tools for admins
statistics:
subscriptions: "Suscripciones"
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index fa6295007..f4335218c 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -214,6 +214,10 @@ fr:
event: "Évènement"
reservations: "Réservations"
available_seats: "Places disponibles"
+ roles:
+ member: "Membre"
+ manager: "Gestionnaire"
+ admin: "Administrateur"
api:
#internal app notifications
notifications:
@@ -329,6 +333,10 @@ fr:
click_to_show: "Cliquez ici pour la consulter"
notify_admin_refund_created:
refund_created: "Un avoir de %{AMOUNT} a été généré pour l'utilisateur %{USER}"
+ notify_user_role_update:
+ your_role_is_ROLE: "Votre rôle a été changé en %{ROLE}."
+ notify_admins_role_update:
+ user_NAME_changed_ROLE_html: "L'utilisateur
%{NAME} est maintenant %{ROLE}."
#statistics tools for admins
statistics:
subscriptions: "Abonnements"
diff --git a/config/locales/mails.en.yml b/config/locales/mails.en.yml
index 5cfb2d6ed..5d8fd903b 100644
--- a/config/locales/mails.en.yml
+++ b/config/locales/mails.en.yml
@@ -273,5 +273,15 @@ en:
body:
refund_created: "A refund of %{AMOUNT} has been generated on invoice %{INVOICE} of user %{USER}"
download: "Click here to download this refund invoice"
+ notify_admins_role_update:
+ subject: "The role of a user has changed"
+ body:
+ user_role_changed_html: "The role of the user
%{NAME} has changed."
+ previous_role: "Previous role:"
+ new_role: "New role:"
+ notify_user_role_update:
+ subject: "Your role has changed"
+ body:
+ role_changed_html: "Your role at {GENDER, select, male{the} female{the} neutral{} other{the}} {NAME} has changed. You are now
{ROLE}.
With great power comes great responsibility, use your new privileges fairly and respectfully."
shared:
hello: "Hello %{user_name}"
diff --git a/config/locales/mails.es.yml b/config/locales/mails.es.yml
index 36654d9d3..8569ccfec 100644
--- a/config/locales/mails.es.yml
+++ b/config/locales/mails.es.yml
@@ -273,5 +273,15 @@ es:
body:
refund_created: "A refund of %{AMOUNT} has been generated on invoice %{INVOICE} of user %{USER}"
download: "Click here to download this refund invoice"
+ notify_admins_role_update:
+ subject: "The role of a user has changed"
+ body:
+ user_role_changed_html: "The role of the user
%{NAME} has changed."
+ previous_role: "Previous role:"
+ new_role: "New role:"
+ notify_user_role_update:
+ subject: "Your role has changed"
+ body:
+ role_changed_html: "Your role at {GENDER, select, male{the} female{the} neutral{} other{the}} {NAME} has changed. You are now
{ROLE}.
With great power comes great responsibility, use your new privileges fairly and respectfully."
shared:
hello: "¡Hola %{user_name}!"
diff --git a/config/locales/mails.fr.yml b/config/locales/mails.fr.yml
index fefa687e1..d266c9f76 100644
--- a/config/locales/mails.fr.yml
+++ b/config/locales/mails.fr.yml
@@ -273,5 +273,15 @@ fr:
body:
refund_created: "Un avoir de %{AMOUNT} a été généré sur la facture %{INVOICE} de l'utilisateur %{USER}"
download: "Cliquez ici pour télécharger cet avoir"
+ notify_admins_role_update:
+ subject: "Le rôle d'un utilisateur a changé"
+ body:
+ user_role_changed_html: "Le rôle de l'utilisateur
%{NAME} a changé."
+ previous_role: "Rôle précédent :"
+ new_role: "Nouveau rôle :"
+ notify_user_role_update:
+ subject: "Vous avez changé de rôle"
+ body:
+ role_changed_html: "Votre rôle {GENDER, select, male{au} female{à la} neutral{} other{aux}} {NAME} a changé. Vous êtes maintenant
{ROLE}.
Avec un grand pouvoir vient une grande responsabilité, utilisez vos nouveaux privilèges de manière juste et respectueuse."
shared:
hello: "Bonjour %{user_name}"
diff --git a/config/locales/mails.pt.yml b/config/locales/mails.pt.yml
index fbb618a16..e633e424a 100755
--- a/config/locales/mails.pt.yml
+++ b/config/locales/mails.pt.yml
@@ -273,5 +273,15 @@ pt:
body:
refund_created: "A refund of %{AMOUNT} has been generated on invoice %{INVOICE} of user %{USER}"
download: "Click here to download this refund invoice"
+ notify_admins_role_update:
+ subject: "The role of a user has changed"
+ body:
+ user_role_changed_html: "The role of the user
%{NAME} has changed."
+ previous_role: "Previous role:"
+ new_role: "New role:"
+ notify_user_role_update:
+ subject: "Your role has changed"
+ body:
+ role_changed_html: "Your role at {GENDER, select, male{the} female{the} neutral{} other{the}} {NAME} has changed. You are now
{ROLE}.
With great power comes great responsibility, use your new privileges fairly and respectfully."
shared:
hello: "Olá %{user_name}"
diff --git a/config/locales/mails.zu.yml b/config/locales/mails.zu.yml
index 8622bdb45..103328b17 100644
--- a/config/locales/mails.zu.yml
+++ b/config/locales/mails.zu.yml
@@ -273,5 +273,15 @@ zu:
body:
refund_created: "crwdns4567:0%{AMOUNT}crwdnd4567:0%{INVOICE}crwdnd4567:0%{USER}crwdne4567:0"
download: "crwdns4569:0crwdne4569:0"
+ notify_admins_role_update:
+ subject: "crwdns20456:0crwdne20456:0"
+ body:
+ user_role_changed_html: "crwdns20458:0%{NAME}crwdne20458:0"
+ previous_role: "crwdns20460:0crwdne20460:0"
+ new_role: "crwdns20462:0crwdne20462:0"
+ notify_user_role_update:
+ subject: "crwdns20464:0crwdne20464:0"
+ body:
+ role_changed_html: "crwdns20466:0GENDER={GENDER}crwdnd20466:0NAME={NAME}crwdnd20466:0ROLE={ROLE}crwdne20466:0"
shared:
hello: "crwdns4215:0%{user_name}crwdne4215:0"
diff --git a/config/locales/pt.yml b/config/locales/pt.yml
index 2cae55d34..baf95e3dc 100755
--- a/config/locales/pt.yml
+++ b/config/locales/pt.yml
@@ -214,6 +214,10 @@ pt:
event: "Evento"
reservations: "Reservas"
available_seats: "Assentos disponÃveis"
+ roles:
+ member: "Member"
+ manager: "Manager"
+ admin: "Administrator"
api:
#internal app notifications
notifications:
@@ -329,6 +333,10 @@ pt:
click_to_show: "Click here to consult"
notify_admin_refund_created:
refund_created: "A refund of %{AMOUNT} has been created for user %{USER}"
+ notify_user_role_update:
+ your_role_is_ROLE: "Your role has been changed to %{ROLE}."
+ notify_admins_role_update:
+ user_NAME_changed_ROLE_html: "User
%{NAME} is now %{ROLE}."
#statistics tools for admins
statistics:
subscriptions: "Assinaturas"
diff --git a/config/locales/zu.yml b/config/locales/zu.yml
index ac09d255b..fc2868d77 100644
--- a/config/locales/zu.yml
+++ b/config/locales/zu.yml
@@ -214,6 +214,10 @@ zu:
event: "crwdns3551:0crwdne3551:0"
reservations: "crwdns3553:0crwdne3553:0"
available_seats: "crwdns3555:0crwdne3555:0"
+ roles:
+ member: "crwdns20446:0crwdne20446:0"
+ manager: "crwdns20448:0crwdne20448:0"
+ admin: "crwdns20450:0crwdne20450:0"
api:
#internal app notifications
notifications:
@@ -329,6 +333,10 @@ zu:
click_to_show: "crwdns3687:0crwdne3687:0"
notify_admin_refund_created:
refund_created: "crwdns4559:0%{AMOUNT}crwdnd4559:0%{USER}crwdne4559:0"
+ notify_user_role_update:
+ your_role_is_ROLE: "crwdns20452:0%{ROLE}crwdne20452:0"
+ notify_admins_role_update:
+ user_NAME_changed_ROLE_html: "crwdns20454:0%{NAME}crwdnd20454:0%{ROLE}crwdne20454:0"
#statistics tools for admins
statistics:
subscriptions: "crwdns3689:0crwdne3689:0"
diff --git a/config/routes.rb b/config/routes.rb
index 03f64afae..114868831 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -45,7 +45,7 @@ Rails.application.routes.draw do
patch '/bulk_update', action: 'bulk_update', on: :collection
put '/reset/:name', action: 'reset', on: :collection
end
- resources :users, only: %i[index create]
+ resources :users, only: %i[index create destroy]
resources :members, only: %i[index show create update destroy] do
get '/export_subscriptions', action: 'export_subscriptions', on: :collection
get '/export_reservations', action: 'export_reservations', on: :collection
@@ -55,6 +55,7 @@ Rails.application.routes.draw do
get 'search/:query', action: 'search', on: :collection
get 'mapping', action: 'mapping', on: :collection
patch ':id/complete_tour', action: 'complete_tour', on: :collection
+ patch ':id/update_role', action: 'update_role', on: :collection
end
resources :reservations, only: %i[show create index update]
resources :notifications, only: %i[index show update] do
diff --git a/db/migrate/20190522115230_migrate_invoice_to_invoicing_profile.rb b/db/migrate/20190522115230_migrate_invoice_to_invoicing_profile.rb
index 3fb3ccd63..b99519b52 100644
--- a/db/migrate/20190522115230_migrate_invoice_to_invoicing_profile.rb
+++ b/db/migrate/20190522115230_migrate_invoice_to_invoicing_profile.rb
@@ -1,8 +1,6 @@
# frozen_string_literal: true
# migrate the invoices from being attached to a user to invoicing_profiles which are GDPR compliant
-# frozen_string_literal:true
-
class MigrateInvoiceToInvoicingProfile < ActiveRecord::Migration[4.2]
def up
# first, check the footprints
diff --git a/db/migrate/20200415141809_add_slot_duration_to_availability.rb b/db/migrate/20200415141809_add_slot_duration_to_availability.rb
new file mode 100644
index 000000000..67b094b8e
--- /dev/null
+++ b/db/migrate/20200415141809_add_slot_duration_to_availability.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal:true
+
+# From this migration any availability can override the default SLOT_DURATION value for its own slots
+class AddSlotDurationToAvailability < ActiveRecord::Migration[5.2]
+ def change
+ add_column :availabilities, :slot_duration, :integer
+ end
+end
diff --git a/db/migrate/20200511075933_fix_accounting_periods.rb b/db/migrate/20200511075933_fix_accounting_periods.rb
new file mode 100644
index 000000000..d2a3038bb
--- /dev/null
+++ b/db/migrate/20200511075933_fix_accounting_periods.rb
@@ -0,0 +1,72 @@
+# frozen_string_literal: true
+
+# regenerate the accounting periods affected by the current bug (period totals are wrong due to wrong VAT computation)
+class FixAccountingPeriods < ActiveRecord::Migration[5.2]
+ def change
+ # first, check the footprints
+ check_footprints
+
+ # if everything is ok, proceed with migration
+ # remove periods (backup their parameters in memory)
+ periods = backup_and_remove_periods
+ # recreate periods from memory dump
+ restore_periods(periods)
+ end
+
+ def check_footprints
+ if AccountingPeriod.count.positive?
+ last_period = AccountingPeriod.order(start_at: :desc).first
+ puts "Checking invoices footprints from #{last_period.end_at}. This may take a while..."
+ Invoice.where('created_at > ?', last_period.end_at).order(:id).each do |i|
+ raise "Invalid footprint for invoice #{i.id}" unless i.check_footprint
+ end
+ else
+ puts 'Checking all invoices footprints. This may take a while...'
+ Invoice.order(:id).all.each do |i|
+ raise "Invalid footprint for invoice #{i.id}" unless i.check_footprint
+ end
+ end
+ end
+
+ # will return an array of hash containing the removed periods data
+ def backup_and_remove_periods
+ return [] unless AccountingPeriod.where("created_at > '2019-08-01' AND created_at < '2020-05-12'").count.positive?
+
+ puts 'Removing erroneous accounting archives...'
+ # 1. remove protection for AccountingPeriods
+ execute("DROP RULE IF EXISTS accounting_periods_del_protect ON #{AccountingPeriod.arel_table.name};")
+ # 2. backup AccountingPeriods in memory
+ periods = []
+ AccountingPeriod.where("created_at > '2019-08-01'").each do |p|
+ periods.push(
+ start_at: p.start_at,
+ end_at: p.end_at,
+ closed_at: p.closed_at,
+ closed_by: p.closed_by
+ )
+ end
+ # 3. Delete periods from database
+ AccountingPeriod.where("created_at > '2019-08-01'").each do |ap|
+ execute("DELETE FROM accounting_periods WHERE ID=#{ap.id};")
+ end
+ periods
+ end
+
+ def restore_periods(periods)
+ return unless periods.size.positive?
+
+ # 1. recreate AccountingPeriods
+ puts 'Recreating accounting archives. This may take a while...'
+ periods.each do |p|
+ AccountingPeriod.create!(
+ start_at: p[:start_at],
+ end_at: p[:end_at],
+ closed_at: p[:closed_at],
+ closed_by: p[:closed_by]
+ )
+ end
+ # 2. reset protection for AccountingPeriods
+ execute("CREATE RULE accounting_periods_del_protect AS ON DELETE TO #{AccountingPeriod.arel_table.name} DO INSTEAD NOTHING;")
+ end
+
+end
diff --git a/db/schema.rb b/db/schema.rb
index 1af0e13a3..fd65d29b9 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2020_04_08_101654) do
+ActiveRecord::Schema.define(version: 2020_05_11_075933) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -18,8 +18,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
enable_extension "unaccent"
create_table "abuses", id: :serial, force: :cascade do |t|
- t.integer "signaled_id"
t.string "signaled_type"
+ t.integer "signaled_id"
t.string "first_name"
t.string "last_name"
t.string "email"
@@ -48,8 +48,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
t.string "locality"
t.string "country"
t.string "postal_code"
- t.integer "placeable_id"
t.string "placeable_type"
+ t.integer "placeable_id"
t.datetime "created_at"
t.datetime "updated_at"
end
@@ -63,8 +63,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
end
create_table "assets", id: :serial, force: :cascade do |t|
- t.integer "viewable_id"
t.string "viewable_type"
+ t.integer "viewable_id"
t.string "attachment"
t.string "type"
t.datetime "created_at"
@@ -94,6 +94,7 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
t.string "period"
t.integer "nb_periods"
t.datetime "end_date"
+ t.integer "slot_duration"
end
create_table "availability_tags", id: :serial, force: :cascade do |t|
@@ -131,8 +132,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
end
create_table "credits", id: :serial, force: :cascade do |t|
- t.integer "creditable_id"
t.string "creditable_type"
+ t.integer "creditable_id"
t.integer "plan_id"
t.integer "hours"
t.datetime "created_at"
@@ -284,8 +285,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
end
create_table "invoices", id: :serial, force: :cascade do |t|
- t.integer "invoiced_id"
t.string "invoiced_type"
+ t.integer "invoiced_id"
t.string "stp_invoice_id"
t.integer "total"
t.datetime "created_at"
@@ -348,15 +349,15 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
create_table "notifications", id: :serial, force: :cascade do |t|
t.integer "receiver_id"
- t.integer "attached_object_id"
t.string "attached_object_type"
+ t.integer "attached_object_id"
t.integer "notification_type_id"
t.boolean "is_read", default: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "receiver_type"
t.boolean "is_send", default: false
- t.jsonb "meta_data", default: {}
+ t.jsonb "meta_data", default: "{}"
t.index ["notification_type_id"], name: "index_notifications_on_notification_type_id"
t.index ["receiver_id"], name: "index_notifications_on_receiver_id"
end
@@ -456,8 +457,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
create_table "prices", id: :serial, force: :cascade do |t|
t.integer "group_id"
t.integer "plan_id"
- t.integer "priceable_id"
t.string "priceable_type"
+ t.integer "priceable_id"
t.integer "amount"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@@ -564,8 +565,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
t.text "message"
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "reservable_id"
t.string "reservable_type"
+ t.integer "reservable_id"
t.integer "nb_reserve_places"
t.integer "statistic_profile_id"
t.index ["reservable_type", "reservable_id"], name: "index_reservations_on_reservable_type_and_reservable_id"
@@ -574,8 +575,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
create_table "roles", id: :serial, force: :cascade do |t|
t.string "name"
- t.integer "resource_id"
t.string "resource_type"
+ t.integer "resource_id"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
@@ -866,8 +867,8 @@ ActiveRecord::Schema.define(version: 2020_04_08_101654) do
create_table "wallet_transactions", id: :serial, force: :cascade do |t|
t.integer "wallet_id"
- t.integer "transactable_id"
t.string "transactable_type"
+ t.integer "transactable_id"
t.string "transaction_type"
t.integer "amount"
t.datetime "created_at", null: false
diff --git a/db/seeds.rb b/db/seeds.rb
index 6e2a4bab5..545fedae6 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -284,7 +284,7 @@ end
unless Setting.find_by(name: 'machine_explications_alert').try(:value)
setting = Setting.find_or_initialize_by(name: 'machine_explications_alert')
- setting.value = "Tout achat d'heure machine est définitif. Aucune" \
+ setting.value = 'Tout achat de créneau machine est définitif. Aucune' \
' annulation ne pourra être effectuée, néanmoins au plus tard 24h avant le créneau fixé, vous pouvez en' \
" modifier la date et l'horaire à votre convenance et en fonction du calendrier proposé. Passé ce délais," \
' aucun changement ne pourra être effectué.'
@@ -699,7 +699,7 @@ unless Setting.find_by(name: 'secondary_color').try(:value)
setting.save
end
-Stylesheet.build_sheet!
+Stylesheet.build_theme!
Stylesheet.build_home!
unless Setting.find_by(name: 'training_information_message').try(:value)
diff --git a/doc/README.md b/doc/README.md
index 7384b04e7..e0d80db19 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -26,6 +26,9 @@ The following guides are designed for the people that perform software maintenan
- [PostgreSQL](postgres_upgrade.md)
- [ElasticSearch](elastic_upgrade.md)
+### Translator's documentation
+If you intend to translate Fab-manager to a new, or an already supported language, you'll find here the information you need.
+- [Guide for translators](translation_readme.md)
### Developer's documentation
The following guides should help those who want to contribute to the code.
diff --git a/doc/development_readme.md b/doc/development_readme.md
index a07938945..23839225d 100644
--- a/doc/development_readme.md
+++ b/doc/development_readme.md
@@ -107,8 +107,8 @@ This procedure is not easy to follow so if you don't need to write some code for
```bash
cp config/database.yml.default config/database.yml
- cp config/application.yml.default config/application.yml
- vi config/application.yml
+ cp env.example .env
+ vi .env
# or use your favorite text editor instead of vi (nano, ne...)
```
diff --git a/doc/elastic_upgrade.md b/doc/elastic_upgrade.md
index 274de5190..425f52e00 100644
--- a/doc/elastic_upgrade.md
+++ b/doc/elastic_upgrade.md
@@ -4,19 +4,19 @@
Fab-manager release 2.6.5 has upgraded its dependency to ElasticSearch from version 1.7 to version 5.6 as the previous was unsupported for months.
To keep using Fab-manager you need to upgrade your installation with the new version.
-We've wrote a script to automate the process while keeping your data integrity, but there's some requirements to understand before running it.
+We've written a script to automate the process while keeping your data integrity, but there are some requirements to understand before running it.
- You need to install *curl*, *jq*, *GNU awk* and *sudo* on your system before running the script.
Usually, `apt update && apt install curl jq sudo gawk`, ran as root, will do the trick but this may change, depending upon your system.
- Your current user must be part of the *docker* and *sudo* groups.
Using the root user is a possible alternative, but not recommended.
-- You'll need at least 4GB of RAM for the data migration to complete successfully.
- The script will try to add 4GB of swap memory if this requirement is detected as missing but this will consume you hard disk space (see below).
-- 1,2GB of free disk space are also required to perform the data migration.
+- You'll need at least 4 GB of RAM for the data migration to complete successfully.
+ The script will try to add 4 GB of swap memory if this requirement is detected as missing but this will consume you hard disk space (see below).
+- 1,2 GB of free disk space are also required to perform the data migration.
Please ensure that you'll have enough space, considering the point above. The script won't run otherwise.
- This script will run on any Linux or Macintoch systems if you installed ElasticSearch using docker or docker-compose.
Otherwise, only Debian compatible OS (like Ubuntu) and MacOS X are supported for classical installations. On any other cases you'll need to perform the upgrade yourself manually.
-- If your ElasticSearch instance uses replicas shards, you can't use this script and you must perform a manual upgrade (if you have a standard Fab-manager installation and you don't understand what this mean, you're probably not concerned).
+- If your ElasticSearch instance uses replicas shards, you can't use this script, and you must perform a manual upgrade (if you have a standard Fab-manager installation, and you don't understand what this mean, you're probably not concerned).
Once you've understood all the points above, you can run the migration script with the following:
@@ -35,7 +35,7 @@ For instructions regarding a manual upgrade, please refer to the official docume
## Restart the upgrade
-So something goes wrong and the upgrade failed during ES 2.4 reindexing?
+So something goes wrong, and the upgrade failed during ES 2.4 reindexing?
Sad news, but everything isn't lost, follow this procedure to start the upgrade again.
First, check the status of your indices:
@@ -145,7 +145,7 @@ Stop and remove your container, then edit your [docker-compose.yml](../docker/do
Copy [elasticsearch.yml](../docker/elasticsearch.yml) and [log4j2.properties](../docker/log4j2.properties) to `elasticsearch/config`, then pull and restart your containers.
-Finally reindex your data:
+Finally, reindex your data:
```bash
rails fablab:es:build_stats
rails fablab:es:generate_stats[3000]
diff --git a/doc/environment.md b/doc/environment.md
index 61cd1ca81..90d713044 100644
--- a/doc/environment.md
+++ b/doc/environment.md
@@ -121,7 +121,7 @@ If set to 'false' the phone number won't be required to register a new user on t
BOOK_SLOT_AT_SAME_TIME
-If set to 'false', users won't be able to book a machine/formation/event slot if they already have a reservation the same day at the same time.
+If set to 'true', users will be able to book a machine/formation/event slot, even if they already have a reservation the same day at the same time.
USER_CONFIRMATION_NEEDED_TO_SIGN_IN
diff --git a/lib/tasks/fablab/maintenance.rake b/lib/tasks/fablab/maintenance.rake
index 86caa8a4f..b2121b596 100644
--- a/lib/tasks/fablab/maintenance.rake
+++ b/lib/tasks/fablab/maintenance.rake
@@ -66,7 +66,7 @@ namespace :fablab do
desc '(re)build customization stylesheet'
task rebuild_stylesheet: :environment do
- Stylesheet.build_sheet!
+ Stylesheet.build_theme!
end
desc 'migration notifications from Fab-manager v1'
diff --git a/lib/tasks/fablab/stripe.rake b/lib/tasks/fablab/stripe.rake
index 7b216db6f..486b86b02 100644
--- a/lib/tasks/fablab/stripe.rake
+++ b/lib/tasks/fablab/stripe.rake
@@ -48,7 +48,10 @@ namespace :fablab do
desc 'sync users to the stripe database'
task sync_members: :environment do
- User.members.each do |member|
+ puts 'We create all non-existing customers on stripe. This may take a while, please wait...'
+ total = User.online_payers.count
+ User.online_payers.each_with_index do |member, index|
+ print_on_line "#{index} / #{total}"
begin
stp_customer = Stripe::Customer.retrieve member.stp_customer_id
StripeWorker.perform_async(:create_stripe_customer, member.id) if stp_customer.nil? || stp_customer[:deleted]
@@ -56,6 +59,12 @@ namespace :fablab do
StripeWorker.perform_async(:create_stripe_customer, member.id)
end
end
+ puts 'Done'
+ end
+
+ def print_on_line(str)
+ print "#{str}\r"
+ $stdout.flush
end
end
end
diff --git a/package.json b/package.json
index b429aa503..25ea65e7a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "fab-manager",
- "version": "4.3.4",
+ "version": "4.4.0",
"description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.",
"keywords": [
"fablab",
diff --git a/public/rank-icon.svg b/public/rank-icon.svg
new file mode 100644
index 000000000..d45ec416f
--- /dev/null
+++ b/public/rank-icon.svg
@@ -0,0 +1,61 @@
+
+
diff --git a/setup/setup.sh b/setup/setup.sh
index 0b3a7a715..6d117e7d0 100755
--- a/setup/setup.sh
+++ b/setup/setup.sh
@@ -264,11 +264,17 @@ read_password()
local password confirmation
>&2 echo "Please input a password for this administrator's account"
read -rsp " > " password &2 printf "\nConfirm the password\n"
- read -rsp " > " confirmation &2 printf "\nError: passwords mismatch\n"
- password=$(read_password)
+ if [ ${#password} -lt 8 ]; then
+ >&2 printf "\nError: password is too short (minimal length: 8 characters)\n"
+ password=$(read_password 'no-confirm')
+ fi
+ if [ "$1" != 'no-confirm' ]; then
+ >&2 printf "\nConfirm the password\n"
+ read -rsp " > " confirmation &2 printf "\nError: passwords mismatch\n"
+ password=$(read_password)
+ fi
fi
echo "$password"
}
diff --git a/test/integration/availabilities/as_admin_test.rb b/test/integration/availabilities/as_admin_test.rb
index 524baf742..e813eebda 100644
--- a/test/integration/availabilities/as_admin_test.rb
+++ b/test/integration/availabilities/as_admin_test.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require 'test_helper'
+
module Availabilities
class AsAdminTest < ActionDispatch::IntegrationTest
setup do
@@ -83,5 +85,48 @@ module Availabilities
assert availabilities.map { |a| a[:available_type] }.include?('space'), 'space availability not found instead that it was enabled'
end
+
+ test 'create availabilities' do
+ date = DateTime.current.change(hour: 8, min: 0, sec: 0)
+ post '/api/availabilities',
+ params: {
+ availability: {
+ start_at: date.iso8601,
+ end_at: (date + 6.hours).iso8601,
+ available_type: 'machines',
+ tag_ids: [],
+ is_recurrent: true,
+ period: 'week',
+ nb_periods: 1,
+ end_date: (date + 2.weeks).end_of_day.iso8601,
+ slot_duration: 90,
+ machine_ids: [2, 3, 5],
+ occurrences: [
+ { start_at: date.iso8601, end_at: (date + 6.hours).iso8601 },
+ { start_at: (date + 1.week).iso8601, end_at: (date + 1.week + 6.hours).iso8601 },
+ { start_at: (date + 2.weeks).iso8601, end_at: (date + 2.weeks + 6.hours).iso8601 }
+ ],
+ plan_ids: [1]
+ }
+ }
+
+ # Check response format & status
+ assert_equal 201, response.status
+ assert_equal Mime[:json], response.content_type
+
+ # Check the id
+ availability = json_response(response.body)
+ assert_not_nil availability[:id], 'availability ID was unexpectedly nil'
+
+ # Check the slots
+ assert_equal (availability[:start_at].to_datetime + availability[:slot_duration].minutes * 4).iso8601,
+ availability[:end_at],
+ 'expected end_at = start_at + 4 slots of 90 minutes'
+
+ # Check the recurrence
+ assert_equal (availability[:start_at].to_date + 2.weeks),
+ availability[:end_date].to_date,
+ 'expected end_date = start_at + 2 weeks'
+ end
end
end
diff --git a/test/integration/reservations/create_as_admin_test.rb b/test/integration/reservations/create_as_admin_test.rb
index 164cb06b9..92dd752fc 100644
--- a/test/integration/reservations/create_as_admin_test.rb
+++ b/test/integration/reservations/create_as_admin_test.rb
@@ -57,7 +57,7 @@ module Reservations
# invoice_items assertions
invoice_item = InvoiceItem.last
- assert_equal invoice_item.amount, machine.prices.find_by(group_id: @user_without_subscription.group_id, plan_id: nil).amount
+ assert_equal machine.prices.find_by(group_id: @user_without_subscription.group_id, plan_id: nil).amount, invoice_item.amount
# invoice assertions
invoice = Invoice.find_by(invoiced: reservation)
@@ -244,7 +244,7 @@ module Reservations
# invoice_items assertions
invoice_item = InvoiceItem.last
- assert_equal invoice_item.amount, machine.prices.find_by(group_id: @vlonchamp.group_id, plan_id: nil).amount
+ assert_equal machine.prices.find_by(group_id: @vlonchamp.group_id, plan_id: nil).amount, invoice_item.amount
# invoice assertions
invoice = Invoice.find_by(invoiced: reservation)
diff --git a/test/integration/reservations/create_test.rb b/test/integration/reservations/create_test.rb
index e9d17c1a3..cc1aaf26d 100644
--- a/test/integration/reservations/create_test.rb
+++ b/test/integration/reservations/create_test.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require 'test_helper'
+
module Reservations
class CreateTest < ActionDispatch::IntegrationTest
setup do
@@ -67,7 +69,7 @@ module Reservations
# invoice_items assertions
invoice_item = InvoiceItem.last
- assert_equal invoice_item.amount, machine.prices.find_by(group_id: @user_without_subscription.group_id, plan_id: nil).amount
+ assert_equal machine.prices.find_by(group_id: @user_without_subscription.group_id, plan_id: nil).amount, invoice_item.amount
assert invoice_item.check_footprint
# invoice assertions
@@ -413,7 +415,7 @@ module Reservations
# invoice_items assertions
invoice_item = InvoiceItem.last
- assert_equal invoice_item.amount, machine.prices.find_by(group_id: @vlonchamp.group_id, plan_id: nil).amount
+ assert_equal machine.prices.find_by(group_id: @vlonchamp.group_id, plan_id: nil).amount, invoice_item.amount
assert invoice_item.check_footprint
# invoice assertions
diff --git a/test/models/availability_test.rb b/test/models/availability_test.rb
index b14e1c70b..3d2b07c65 100644
--- a/test/models/availability_test.rb
+++ b/test/models/availability_test.rb
@@ -1,11 +1,12 @@
+# frozen_string_literal: true
+
require 'test_helper'
class AvailabilityTest < ActiveSupport::TestCase
- test "length must be at least 1h" do
+ test 'any duration is allowed' do
a = Availability.first
a.end_at = a.start_at + 15.minutes
- assert a.invalid?
- assert a.errors.key?(:end_at)
+ assert a.valid?
end
test "if type available_type is 'machines' check that there is minimum 1 association" do
diff --git a/test/vcr_cassettes/reservations_create_for_machine_and_pay_wallet_success.yml b/test/vcr_cassettes/reservations_create_for_machine_and_pay_wallet_success.yml
deleted file mode 100644
index 480786dde..000000000
--- a/test/vcr_cassettes/reservations_create_for_machine_and_pay_wallet_success.yml
+++ /dev/null
@@ -1,635 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_x6qr8Aki7Sk0SC","request_duration_ms":441}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:12 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_aXLV4SsElLj1LY
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9L2sOmf47Nz9k6j91lpo",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247312,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:12 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_aXLV4SsElLj1LY","request_duration_ms":573}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:12 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_vfbldZ92PiYQqR
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9M2sOmf47Nz9fnl8ct92",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247312,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:12 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc9L2sOmf47Nz9k6j91lpo&amount=2400¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzNtM08NVlSGN
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_vfbldZ92PiYQqR","request_duration_ms":560}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:14 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4149'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_umzY4x2alL0YYk
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9N2sOmf47Nz9eAeXuoje",
- "object": "payment_intent",
- "amount": 2400,
- "amount_capturable": 0,
- "amount_received": 2400,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9N2sOmf47Nz9Id0QFa9k",
- "object": "charge",
- "amount": 2400,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9N2sOmf47Nz9pLPp3w8z",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247313,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 1,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9N2sOmf47Nz9eAeXuoje",
- "payment_method": "pm_1GIc9L2sOmf47Nz9k6j91lpo",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9N2sOmf47Nz9Id0QFa9k/rcpt_GqIk4G5Akux62oo1UKqzPaSO7un3Lfp",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9N2sOmf47Nz9Id0QFa9k/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9N2sOmf47Nz9eAeXuoje"
- },
- "client_secret": "pi_1GIc9N2sOmf47Nz9eAeXuoje_secret_d3LGJaq61LSIeTuun710CqIbV",
- "confirmation_method": "manual",
- "created": 1583247313,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9L2sOmf47Nz9k6j91lpo",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:14 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc9N2sOmf47Nz9eAeXuoje
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_umzY4x2alL0YYk","request_duration_ms":1501}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:14 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4176'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_FLZYb8VQWkcCLS
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9N2sOmf47Nz9eAeXuoje",
- "object": "payment_intent",
- "amount": 2400,
- "amount_capturable": 0,
- "amount_received": 2400,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9N2sOmf47Nz9Id0QFa9k",
- "object": "charge",
- "amount": 2400,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9N2sOmf47Nz9pLPp3w8z",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247313,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 1,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9N2sOmf47Nz9eAeXuoje",
- "payment_method": "pm_1GIc9L2sOmf47Nz9k6j91lpo",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9N2sOmf47Nz9Id0QFa9k/rcpt_GqIk4G5Akux62oo1UKqzPaSO7un3Lfp",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9N2sOmf47Nz9Id0QFa9k/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9N2sOmf47Nz9eAeXuoje"
- },
- "client_secret": "pi_1GIc9N2sOmf47Nz9eAeXuoje_secret_d3LGJaq61LSIeTuun710CqIbV",
- "confirmation_method": "manual",
- "created": 1583247313,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9L2sOmf47Nz9k6j91lpo",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:14 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reservations_create_for_machine_with_subscription_success.yml b/test/vcr_cassettes/reservations_create_for_machine_with_subscription_success.yml
deleted file mode 100644
index 4dd74b80f..000000000
--- a/test/vcr_cassettes/reservations_create_for_machine_with_subscription_success.yml
+++ /dev/null
@@ -1,530 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_aYIhUnB77ZvQ5j","request_duration_ms":432}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:04 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_qzrttCf9NMC2Mi
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9E2sOmf47Nz9FpiGvvan",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247304,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:04 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc9E2sOmf47Nz9FpiGvvan&amount=1000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzKe50I0J1gaI
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_qzrttCf9NMC2Mi","request_duration_ms":755}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:06 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4150'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_iURCQkSxc3FFrI
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9F2sOmf47Nz9GjveqezE",
- "object": "payment_intent",
- "amount": 1000,
- "amount_capturable": 0,
- "amount_received": 1000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9F2sOmf47Nz9wCixBgR9",
- "object": "charge",
- "amount": 1000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9F2sOmf47Nz9lj3XtJSw",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247305,
- "currency": "usd",
- "customer": "cus_8CzKe50I0J1gaI",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 19,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9F2sOmf47Nz9GjveqezE",
- "payment_method": "pm_1GIc9E2sOmf47Nz9FpiGvvan",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9F2sOmf47Nz9wCixBgR9/rcpt_GqIkBGWpXdgKTA4Ry6rhZVRLnERhlk5",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9F2sOmf47Nz9wCixBgR9/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9F2sOmf47Nz9GjveqezE"
- },
- "client_secret": "pi_1GIc9F2sOmf47Nz9GjveqezE_secret_kpWYayvcBYMX8p7SxQNcQNCdy",
- "confirmation_method": "manual",
- "created": 1583247305,
- "currency": "usd",
- "customer": "cus_8CzKe50I0J1gaI",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9E2sOmf47Nz9FpiGvvan",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:06 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc9F2sOmf47Nz9GjveqezE
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_iURCQkSxc3FFrI","request_duration_ms":1248}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:06 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4177'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_ibMIFsp2QxVYc3
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9F2sOmf47Nz9GjveqezE",
- "object": "payment_intent",
- "amount": 1000,
- "amount_capturable": 0,
- "amount_received": 1000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9F2sOmf47Nz9wCixBgR9",
- "object": "charge",
- "amount": 1000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9F2sOmf47Nz9lj3XtJSw",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247305,
- "currency": "usd",
- "customer": "cus_8CzKe50I0J1gaI",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 19,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9F2sOmf47Nz9GjveqezE",
- "payment_method": "pm_1GIc9E2sOmf47Nz9FpiGvvan",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9F2sOmf47Nz9wCixBgR9/rcpt_GqIkBGWpXdgKTA4Ry6rhZVRLnERhlk5",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9F2sOmf47Nz9wCixBgR9/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9F2sOmf47Nz9GjveqezE"
- },
- "client_secret": "pi_1GIc9F2sOmf47Nz9GjveqezE_secret_kpWYayvcBYMX8p7SxQNcQNCdy",
- "confirmation_method": "manual",
- "created": 1583247305,
- "currency": "usd",
- "customer": "cus_8CzKe50I0J1gaI",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9E2sOmf47Nz9FpiGvvan",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:06 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reservations_create_for_machine_without_subscription_error.yml b/test/vcr_cassettes/reservations_create_for_machine_without_subscription_error.yml
deleted file mode 100644
index 838c8ab8f..000000000
--- a/test/vcr_cassettes/reservations_create_for_machine_without_subscription_error.yml
+++ /dev/null
@@ -1,420 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4000000000000002&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_ibMIFsp2QxVYc3","request_duration_ms":444}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:07 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_rQkLrGoQDETduL
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9H2sOmf47Nz90liTuzCF",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "xsVM9Mfv9kfwhRSL",
- "funding": "credit",
- "generated_from": null,
- "last4": "0002",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247307,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:07 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc9H2sOmf47Nz90liTuzCF&amount=3200¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_rQkLrGoQDETduL","request_duration_ms":550}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 402
- message: Payment Required
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:08 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '7569'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_Rnfs5yMyXOOH1y
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "error": {
- "charge": "ch_1GIc9I2sOmf47Nz9FtpNbnZe",
- "code": "card_declined",
- "decline_code": "generic_decline",
- "doc_url": "https://stripe.com/docs/error-codes/card-declined",
- "message": "Your card was declined.",
- "payment_intent": {
- "id": "pi_1GIc9H2sOmf47Nz9MOnjgOxJ",
- "object": "payment_intent",
- "amount": 3200,
- "amount_capturable": 0,
- "amount_received": 0,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9I2sOmf47Nz9FtpNbnZe",
- "object": "charge",
- "amount": 3200,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": null,
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": false,
- "created": 1583247308,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": "card_declined",
- "failure_message": "Your card was declined.",
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "declined_by_network",
- "reason": "generic_decline",
- "risk_level": "normal",
- "risk_score": 15,
- "seller_message": "The bank did not return any further details with this decline.",
- "type": "issuer_declined"
- },
- "paid": false,
- "payment_intent": "pi_1GIc9H2sOmf47Nz9MOnjgOxJ",
- "payment_method": "pm_1GIc9H2sOmf47Nz90liTuzCF",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "xsVM9Mfv9kfwhRSL",
- "funding": "credit",
- "installments": null,
- "last4": "0002",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9I2sOmf47Nz9FtpNbnZe/rcpt_GqIkyhhnZTtgnFYFV2z2p9t0R3IU6kN",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9I2sOmf47Nz9FtpNbnZe/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "failed",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9H2sOmf47Nz9MOnjgOxJ"
- },
- "client_secret": "pi_1GIc9H2sOmf47Nz9MOnjgOxJ_secret_J8UKKE0FGj0sZ1oVGoYvSzcOk",
- "confirmation_method": "manual",
- "created": 1583247307,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "invoice": null,
- "last_payment_error": {
- "charge": "ch_1GIc9I2sOmf47Nz9FtpNbnZe",
- "code": "card_declined",
- "decline_code": "generic_decline",
- "doc_url": "https://stripe.com/docs/error-codes/card-declined",
- "message": "Your card was declined.",
- "payment_method": {
- "id": "pm_1GIc9H2sOmf47Nz90liTuzCF",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "xsVM9Mfv9kfwhRSL",
- "funding": "credit",
- "generated_from": null,
- "last4": "0002",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247307,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- },
- "type": "card_error"
- },
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": null,
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "requires_payment_method",
- "transfer_data": null,
- "transfer_group": null
- },
- "payment_method": {
- "id": "pm_1GIc9H2sOmf47Nz90liTuzCF",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "xsVM9Mfv9kfwhRSL",
- "funding": "credit",
- "generated_from": null,
- "last4": "0002",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247307,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- },
- "type": "card_error"
- }
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:09 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reservations_create_for_machine_without_subscription_success.yml b/test/vcr_cassettes/reservations_create_for_machine_without_subscription_success.yml
deleted file mode 100644
index 46ea131df..000000000
--- a/test/vcr_cassettes/reservations_create_for_machine_without_subscription_success.yml
+++ /dev/null
@@ -1,530 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_rQkLrGoQDETduL","request_duration_ms":550}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:09 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_LIEZQxCvUuHYJP
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9J2sOmf47Nz9PJqSIEk4",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247309,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:09 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc9J2sOmf47Nz9PJqSIEk4&amount=3200¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_LIEZQxCvUuHYJP","request_duration_ms":552}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:10 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4150'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_HO3YR4158KeOXG
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9J2sOmf47Nz9RNI3j6MI",
- "object": "payment_intent",
- "amount": 3200,
- "amount_capturable": 0,
- "amount_received": 3200,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9K2sOmf47Nz9w5U0mEkk",
- "object": "charge",
- "amount": 3200,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9K2sOmf47Nz9318PDNXW",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247310,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 44,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9J2sOmf47Nz9RNI3j6MI",
- "payment_method": "pm_1GIc9J2sOmf47Nz9PJqSIEk4",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9K2sOmf47Nz9w5U0mEkk/rcpt_GqIkjpWmpcfwKljzMBmzDXiXvI7DQff",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9K2sOmf47Nz9w5U0mEkk/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9J2sOmf47Nz9RNI3j6MI"
- },
- "client_secret": "pi_1GIc9J2sOmf47Nz9RNI3j6MI_secret_FWjjKFpkyQjZiHqniqGRpmnfS",
- "confirmation_method": "manual",
- "created": 1583247309,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9J2sOmf47Nz9PJqSIEk4",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:10 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc9J2sOmf47Nz9RNI3j6MI
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_HO3YR4158KeOXG","request_duration_ms":1327}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:11 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4177'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_x6qr8Aki7Sk0SC
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9J2sOmf47Nz9RNI3j6MI",
- "object": "payment_intent",
- "amount": 3200,
- "amount_capturable": 0,
- "amount_received": 3200,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9K2sOmf47Nz9w5U0mEkk",
- "object": "charge",
- "amount": 3200,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9K2sOmf47Nz9318PDNXW",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247310,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 44,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9J2sOmf47Nz9RNI3j6MI",
- "payment_method": "pm_1GIc9J2sOmf47Nz9PJqSIEk4",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9K2sOmf47Nz9w5U0mEkk/rcpt_GqIkjpWmpcfwKljzMBmzDXiXvI7DQff",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9K2sOmf47Nz9w5U0mEkk/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9J2sOmf47Nz9RNI3j6MI"
- },
- "client_secret": "pi_1GIc9J2sOmf47Nz9RNI3j6MI_secret_FWjjKFpkyQjZiHqniqGRpmnfS",
- "confirmation_method": "manual",
- "created": 1583247309,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9J2sOmf47Nz9PJqSIEk4",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:11 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reservations_create_for_training_and_plan_by_pay_wallet_success.yml b/test/vcr_cassettes/reservations_create_for_training_and_plan_by_pay_wallet_success.yml
deleted file mode 100644
index 696e44fee..000000000
--- a/test/vcr_cassettes/reservations_create_for_training_and_plan_by_pay_wallet_success.yml
+++ /dev/null
@@ -1,530 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_GMWzR1ixnTfmPl","request_duration_ms":374}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:59 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_C6NTHPpmiFxxXy
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc982sOmf47Nz96LHOKPE8",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247299,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:59 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc982sOmf47Nz96LHOKPE8&amount=1000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzNtM08NVlSGN
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_C6NTHPpmiFxxXy","request_duration_ms":513}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:00 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4150'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_bFNL9utQPjObfv
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc992sOmf47Nz9L2kElR3d",
- "object": "payment_intent",
- "amount": 1000,
- "amount_capturable": 0,
- "amount_received": 1000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc992sOmf47Nz9JnrbIpwi",
- "object": "charge",
- "amount": 1000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9A2sOmf47Nz9SJgwwwJ3",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247299,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 47,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc992sOmf47Nz9L2kElR3d",
- "payment_method": "pm_1GIc982sOmf47Nz96LHOKPE8",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc992sOmf47Nz9JnrbIpwi/rcpt_GqIkN1XMukIN2BKyXmLdEoQyauCkkwL",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc992sOmf47Nz9JnrbIpwi/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc992sOmf47Nz9L2kElR3d"
- },
- "client_secret": "pi_1GIc992sOmf47Nz9L2kElR3d_secret_hXfPyHsmlWnFQcedakriStju5",
- "confirmation_method": "manual",
- "created": 1583247299,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc982sOmf47Nz96LHOKPE8",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:00 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc992sOmf47Nz9L2kElR3d
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_bFNL9utQPjObfv","request_duration_ms":1430}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:01 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4177'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_XCkmcOVl8ibzM8
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc992sOmf47Nz9L2kElR3d",
- "object": "payment_intent",
- "amount": 1000,
- "amount_capturable": 0,
- "amount_received": 1000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc992sOmf47Nz9JnrbIpwi",
- "object": "charge",
- "amount": 1000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9A2sOmf47Nz9SJgwwwJ3",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247299,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 47,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc992sOmf47Nz9L2kElR3d",
- "payment_method": "pm_1GIc982sOmf47Nz96LHOKPE8",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc992sOmf47Nz9JnrbIpwi/rcpt_GqIkN1XMukIN2BKyXmLdEoQyauCkkwL",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc992sOmf47Nz9JnrbIpwi/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc992sOmf47Nz9L2kElR3d"
- },
- "client_secret": "pi_1GIc992sOmf47Nz9L2kElR3d_secret_hXfPyHsmlWnFQcedakriStju5",
- "confirmation_method": "manual",
- "created": 1583247299,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc982sOmf47Nz96LHOKPE8",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:01 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reservations_create_for_training_without_subscription_success.yml b/test/vcr_cassettes/reservations_create_for_training_without_subscription_success.yml
deleted file mode 100644
index e0bdccbf0..000000000
--- a/test/vcr_cassettes/reservations_create_for_training_without_subscription_success.yml
+++ /dev/null
@@ -1,530 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_XCkmcOVl8ibzM8","request_duration_ms":436}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:02 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_55JRffo7TFGrdT
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9B2sOmf47Nz9pKb0t0ry",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247301,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:02 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc9B2sOmf47Nz9pKb0t0ry&amount=5100¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_55JRffo7TFGrdT","request_duration_ms":544}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:03 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4150'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_ST5lCeD68xtxs3
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9C2sOmf47Nz97hYG413j",
- "object": "payment_intent",
- "amount": 5100,
- "amount_capturable": 0,
- "amount_received": 5100,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9C2sOmf47Nz9SM5bFPj2",
- "object": "charge",
- "amount": 5100,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9C2sOmf47Nz9nPAjyZQ5",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247302,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 23,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9C2sOmf47Nz97hYG413j",
- "payment_method": "pm_1GIc9B2sOmf47Nz9pKb0t0ry",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9C2sOmf47Nz9SM5bFPj2/rcpt_GqIks79BAgX5h7JXNnDajnDviycxD0j",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9C2sOmf47Nz9SM5bFPj2/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9C2sOmf47Nz97hYG413j"
- },
- "client_secret": "pi_1GIc9C2sOmf47Nz97hYG413j_secret_FboNGX5rFzb9Jalyse6QaTMdf",
- "confirmation_method": "manual",
- "created": 1583247302,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9B2sOmf47Nz9pKb0t0ry",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:03 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc9C2sOmf47Nz97hYG413j
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_ST5lCeD68xtxs3","request_duration_ms":1308}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:03 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4177'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_aYIhUnB77ZvQ5j
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9C2sOmf47Nz97hYG413j",
- "object": "payment_intent",
- "amount": 5100,
- "amount_capturable": 0,
- "amount_received": 5100,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9C2sOmf47Nz9SM5bFPj2",
- "object": "charge",
- "amount": 5100,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9C2sOmf47Nz9nPAjyZQ5",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247302,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 23,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9C2sOmf47Nz97hYG413j",
- "payment_method": "pm_1GIc9B2sOmf47Nz9pKb0t0ry",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9C2sOmf47Nz9SM5bFPj2/rcpt_GqIks79BAgX5h7JXNnDajnDviycxD0j",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9C2sOmf47Nz9SM5bFPj2/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9C2sOmf47Nz97hYG413j"
- },
- "client_secret": "pi_1GIc9C2sOmf47Nz97hYG413j_secret_FboNGX5rFzb9Jalyse6QaTMdf",
- "confirmation_method": "manual",
- "created": 1583247302,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9B2sOmf47Nz9pKb0t0ry",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:03 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml
deleted file mode 100644
index 4e6f084b6..000000000
--- a/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml
+++ /dev/null
@@ -1,214 +0,0 @@
----
-http_interactions:
-- request:
- method: get
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc962sOmf47Nz9YBsuyxKn
- body:
- encoding: US-ASCII
- string: ''
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_Bd5Vwd3cPNoLTt","request_duration_ms":416}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:58 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4177'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_GMWzR1ixnTfmPl
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc962sOmf47Nz9YBsuyxKn",
- "object": "payment_intent",
- "amount": 3825,
- "amount_capturable": 0,
- "amount_received": 3825,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc962sOmf47Nz9Uq5jY1jX",
- "object": "charge",
- "amount": 3825,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc962sOmf47Nz9Q3q7kCPg",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247296,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 62,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc962sOmf47Nz9YBsuyxKn",
- "payment_method": "pm_1GIc952sOmf47Nz9fS2p9Rxu",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc962sOmf47Nz9Uq5jY1jX/rcpt_GqIkWzM6n72G361VXBXlldDkJUWQS7Z",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc962sOmf47Nz9Uq5jY1jX/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc962sOmf47Nz9YBsuyxKn"
- },
- "client_secret": "pi_1GIc962sOmf47Nz9YBsuyxKn_secret_DlWg2EEk0dvS4nMUwgzWneNn7",
- "confirmation_method": "manual",
- "created": 1583247296,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc952sOmf47Nz9fS2p9Rxu",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:58 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml
deleted file mode 100644
index 257a7aa68..000000000
--- a/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml
+++ /dev/null
@@ -1,530 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_7t6Czv8JevU9CB","request_duration_ms":513}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:55 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_yirqrAAMdgxV5F
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc952sOmf47Nz9fS2p9Rxu",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247295,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:55 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc952sOmf47Nz9fS2p9Rxu&amount=3825¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_yirqrAAMdgxV5F","request_duration_ms":510}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:57 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4150'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_Gir8V0OQ50uxPe
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc962sOmf47Nz9YBsuyxKn",
- "object": "payment_intent",
- "amount": 3825,
- "amount_capturable": 0,
- "amount_received": 3825,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc962sOmf47Nz9Uq5jY1jX",
- "object": "charge",
- "amount": 3825,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc962sOmf47Nz9Q3q7kCPg",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247296,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 62,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc962sOmf47Nz9YBsuyxKn",
- "payment_method": "pm_1GIc952sOmf47Nz9fS2p9Rxu",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc962sOmf47Nz9Uq5jY1jX/rcpt_GqIkWzM6n72G361VXBXlldDkJUWQS7Z",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc962sOmf47Nz9Uq5jY1jX/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc962sOmf47Nz9YBsuyxKn"
- },
- "client_secret": "pi_1GIc962sOmf47Nz9YBsuyxKn_secret_DlWg2EEk0dvS4nMUwgzWneNn7",
- "confirmation_method": "manual",
- "created": 1583247296,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc952sOmf47Nz9fS2p9Rxu",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:57 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc962sOmf47Nz9YBsuyxKn
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_Gir8V0OQ50uxPe","request_duration_ms":1590}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:57 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4177'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_Bd5Vwd3cPNoLTt
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc962sOmf47Nz9YBsuyxKn",
- "object": "payment_intent",
- "amount": 3825,
- "amount_capturable": 0,
- "amount_received": 3825,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc962sOmf47Nz9Uq5jY1jX",
- "object": "charge",
- "amount": 3825,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc962sOmf47Nz9Q3q7kCPg",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247296,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 62,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc962sOmf47Nz9YBsuyxKn",
- "payment_method": "pm_1GIc952sOmf47Nz9fS2p9Rxu",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc962sOmf47Nz9Uq5jY1jX/rcpt_GqIkWzM6n72G361VXBXlldDkJUWQS7Z",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc962sOmf47Nz9Uq5jY1jX/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc962sOmf47Nz9YBsuyxKn"
- },
- "client_secret": "pi_1GIc962sOmf47Nz9YBsuyxKn_secret_DlWg2EEk0dvS4nMUwgzWneNn7",
- "confirmation_method": "manual",
- "created": 1583247296,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc952sOmf47Nz9fS2p9Rxu",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:57 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reservations_training_with_expired_coupon_error.yml b/test/vcr_cassettes/reservations_training_with_expired_coupon_error.yml
deleted file mode 100644
index 82cae7535..000000000
--- a/test/vcr_cassettes/reservations_training_with_expired_coupon_error.yml
+++ /dev/null
@@ -1,213 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_Reuaqw87EjoTN7","request_duration_ms":381}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:54 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_AKmq4YFv8nv3Zj
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc942sOmf47Nz9X2OnwfHz",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247294,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:54 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_AKmq4YFv8nv3Zj","request_duration_ms":526}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:55 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_7t6Czv8JevU9CB
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc942sOmf47Nz9zy21Kacp",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247295,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:55 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means.yml b/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means.yml
deleted file mode 100644
index b8b5bcf7f..000000000
--- a/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means.yml
+++ /dev/null
@@ -1,528 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:45 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_HoBLUXCSZ5M1LS
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc8u2sOmf47Nz9Z9zoefnj",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247285,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:45 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc8u2sOmf47Nz9Z9zoefnj&amount=42350¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzNtM08NVlSGN
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_HoBLUXCSZ5M1LS","request_duration_ms":564}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:46 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4153'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_F06TYabhdT0lY1
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc8v2sOmf47Nz9ml7utm9H",
- "object": "payment_intent",
- "amount": 42350,
- "amount_capturable": 0,
- "amount_received": 42350,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc8v2sOmf47Nz9QI9nWnpU",
- "object": "charge",
- "amount": 42350,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc8w2sOmf47Nz9myVnnnlm",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247285,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 52,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc8v2sOmf47Nz9ml7utm9H",
- "payment_method": "pm_1GIc8u2sOmf47Nz9Z9zoefnj",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc8v2sOmf47Nz9QI9nWnpU/rcpt_GqIk4euyZSZAF2cqvoQ4YlwZk64iIbT",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc8v2sOmf47Nz9QI9nWnpU/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc8v2sOmf47Nz9ml7utm9H"
- },
- "client_secret": "pi_1GIc8v2sOmf47Nz9ml7utm9H_secret_KktP51swzT5Zl6B0qXflO2Non",
- "confirmation_method": "manual",
- "created": 1583247285,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc8u2sOmf47Nz9Z9zoefnj",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:46 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc8v2sOmf47Nz9ml7utm9H
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_F06TYabhdT0lY1","request_duration_ms":1262}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:47 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4180'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_IDZnriQDLXdBNX
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc8v2sOmf47Nz9ml7utm9H",
- "object": "payment_intent",
- "amount": 42350,
- "amount_capturable": 0,
- "amount_received": 42350,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc8v2sOmf47Nz9QI9nWnpU",
- "object": "charge",
- "amount": 42350,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc8w2sOmf47Nz9myVnnnlm",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247285,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 52,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc8v2sOmf47Nz9ml7utm9H",
- "payment_method": "pm_1GIc8u2sOmf47Nz9Z9zoefnj",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc8v2sOmf47Nz9QI9nWnpU/rcpt_GqIk4euyZSZAF2cqvoQ4YlwZk64iIbT",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc8v2sOmf47Nz9QI9nWnpU/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc8v2sOmf47Nz9ml7utm9H"
- },
- "client_secret": "pi_1GIc8v2sOmf47Nz9ml7utm9H_secret_KktP51swzT5Zl6B0qXflO2Non",
- "confirmation_method": "manual",
- "created": 1583247285,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc8u2sOmf47Nz9Z9zoefnj",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:47 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means_retrieve_invoice_from_stripe.yml b/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means_retrieve_invoice_from_stripe.yml
deleted file mode 100644
index ea6ff5cad..000000000
--- a/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means_retrieve_invoice_from_stripe.yml
+++ /dev/null
@@ -1,214 +0,0 @@
----
-http_interactions:
-- request:
- method: get
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc8v2sOmf47Nz9ml7utm9H
- body:
- encoding: US-ASCII
- string: ''
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_IDZnriQDLXdBNX","request_duration_ms":403}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:54:48 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4180'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_Reuaqw87EjoTN7
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc8v2sOmf47Nz9ml7utm9H",
- "object": "payment_intent",
- "amount": 42350,
- "amount_capturable": 0,
- "amount_received": 42350,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc8v2sOmf47Nz9QI9nWnpU",
- "object": "charge",
- "amount": 42350,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc8w2sOmf47Nz9myVnnnlm",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247285,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 52,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc8v2sOmf47Nz9ml7utm9H",
- "payment_method": "pm_1GIc8u2sOmf47Nz9Z9zoefnj",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc8v2sOmf47Nz9QI9nWnpU/rcpt_GqIk4euyZSZAF2cqvoQ4YlwZk64iIbT",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc8v2sOmf47Nz9QI9nWnpU/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc8v2sOmf47Nz9ml7utm9H"
- },
- "client_secret": "pi_1GIc8v2sOmf47Nz9ml7utm9H_secret_KktP51swzT5Zl6B0qXflO2Non",
- "confirmation_method": "manual",
- "created": 1583247285,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc8u2sOmf47Nz9Z9zoefnj",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:54:48 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/subscriptions_user_create_failed.yml b/test/vcr_cassettes/subscriptions_user_create_failed.yml
deleted file mode 100644
index ccc5944c3..000000000
--- a/test/vcr_cassettes/subscriptions_user_create_failed.yml
+++ /dev/null
@@ -1,108 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_sKTcNxwXEgg7UW","request_duration_ms":391}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:21 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_qJlAIwLHBL3Eaj
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9V2sOmf47Nz96pqAvXKb",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247321,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:21 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/subscriptions_user_create_success.yml b/test/vcr_cassettes/subscriptions_user_create_success.yml
deleted file mode 100644
index ec26c2226..000000000
--- a/test/vcr_cassettes/subscriptions_user_create_success.yml
+++ /dev/null
@@ -1,530 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_FLZYb8VQWkcCLS","request_duration_ms":452}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:16 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_ippegIxrFH9fJ2
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9Q2sOmf47Nz9rsPseajX",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247316,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:16 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc9Q2sOmf47Nz9rsPseajX&amount=3000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_ippegIxrFH9fJ2","request_duration_ms":569}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:17 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4150'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_W0JzHculn48snH
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9Q2sOmf47Nz9iYHKWLUh",
- "object": "payment_intent",
- "amount": 3000,
- "amount_capturable": 0,
- "amount_received": 3000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9Q2sOmf47Nz9GFzPbGLj",
- "object": "charge",
- "amount": 3000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9R2sOmf47Nz9ttSUmJuK",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247316,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 55,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9Q2sOmf47Nz9iYHKWLUh",
- "payment_method": "pm_1GIc9Q2sOmf47Nz9rsPseajX",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9Q2sOmf47Nz9GFzPbGLj/rcpt_GqIkPUg6C6CfpZR5OlOj1LzV7JMwaGu",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9Q2sOmf47Nz9GFzPbGLj/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9Q2sOmf47Nz9iYHKWLUh"
- },
- "client_secret": "pi_1GIc9Q2sOmf47Nz9iYHKWLUh_secret_ztRTs2yaqzcm8vOfvyZ4j31Oj",
- "confirmation_method": "manual",
- "created": 1583247316,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9Q2sOmf47Nz9rsPseajX",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:17 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc9Q2sOmf47Nz9iYHKWLUh
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_W0JzHculn48snH","request_duration_ms":1329}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:18 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4177'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_lYkRyC5HhvAfuP
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9Q2sOmf47Nz9iYHKWLUh",
- "object": "payment_intent",
- "amount": 3000,
- "amount_capturable": 0,
- "amount_received": 3000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9Q2sOmf47Nz9GFzPbGLj",
- "object": "charge",
- "amount": 3000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9R2sOmf47Nz9ttSUmJuK",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247316,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 55,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9Q2sOmf47Nz9iYHKWLUh",
- "payment_method": "pm_1GIc9Q2sOmf47Nz9rsPseajX",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9Q2sOmf47Nz9GFzPbGLj/rcpt_GqIkPUg6C6CfpZR5OlOj1LzV7JMwaGu",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9Q2sOmf47Nz9GFzPbGLj/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9Q2sOmf47Nz9iYHKWLUh"
- },
- "client_secret": "pi_1GIc9Q2sOmf47Nz9iYHKWLUh_secret_ztRTs2yaqzcm8vOfvyZ4j31Oj",
- "confirmation_method": "manual",
- "created": 1583247316,
- "currency": "usd",
- "customer": "cus_8Di1wjdVktv5kt",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9Q2sOmf47Nz9rsPseajX",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:18 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/subscriptions_user_create_success_with_wallet.yml b/test/vcr_cassettes/subscriptions_user_create_success_with_wallet.yml
deleted file mode 100644
index 6984f5127..000000000
--- a/test/vcr_cassettes/subscriptions_user_create_success_with_wallet.yml
+++ /dev/null
@@ -1,530 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_lYkRyC5HhvAfuP","request_duration_ms":568}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:19 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_EGVR0KbXOjQQEl
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9S2sOmf47Nz9KEzEGLZL",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247319,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:19 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc9S2sOmf47Nz9KEzEGLZL&amount=1000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzNtM08NVlSGN
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_EGVR0KbXOjQQEl","request_duration_ms":528}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:20 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4150'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_lJBhm8ex2TbJZ5
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9T2sOmf47Nz9kYoPSMEq",
- "object": "payment_intent",
- "amount": 1000,
- "amount_capturable": 0,
- "amount_received": 1000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9T2sOmf47Nz9hzX3fbro",
- "object": "charge",
- "amount": 1000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9U2sOmf47Nz9K6V3j4qG",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247319,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 35,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9T2sOmf47Nz9kYoPSMEq",
- "payment_method": "pm_1GIc9S2sOmf47Nz9KEzEGLZL",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9T2sOmf47Nz9hzX3fbro/rcpt_GqIkZJAzoXiw26bymloAGrjy4Vg0hna",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9T2sOmf47Nz9hzX3fbro/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9T2sOmf47Nz9kYoPSMEq"
- },
- "client_secret": "pi_1GIc9T2sOmf47Nz9kYoPSMEq_secret_JUtjtVOZaDsZAoN57aDWFwGnV",
- "confirmation_method": "manual",
- "created": 1583247319,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9S2sOmf47Nz9KEzEGLZL",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:20 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc9T2sOmf47Nz9kYoPSMEq
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_lJBhm8ex2TbJZ5","request_duration_ms":1399}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:21 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4177'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_sKTcNxwXEgg7UW
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9T2sOmf47Nz9kYoPSMEq",
- "object": "payment_intent",
- "amount": 1000,
- "amount_capturable": 0,
- "amount_received": 1000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9T2sOmf47Nz9hzX3fbro",
- "object": "charge",
- "amount": 1000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9U2sOmf47Nz9K6V3j4qG",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247319,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 35,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9T2sOmf47Nz9kYoPSMEq",
- "payment_method": "pm_1GIc9S2sOmf47Nz9KEzEGLZL",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9T2sOmf47Nz9hzX3fbro/rcpt_GqIkZJAzoXiw26bymloAGrjy4Vg0hna",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9T2sOmf47Nz9hzX3fbro/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9T2sOmf47Nz9kYoPSMEq"
- },
- "client_secret": "pi_1GIc9T2sOmf47Nz9kYoPSMEq_secret_JUtjtVOZaDsZAoN57aDWFwGnV",
- "confirmation_method": "manual",
- "created": 1583247319,
- "currency": "usd",
- "customer": "cus_8CzNtM08NVlSGN",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9S2sOmf47Nz9KEzEGLZL",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:21 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/subscriptions_user_renew_failed.yml b/test/vcr_cassettes/subscriptions_user_renew_failed.yml
deleted file mode 100644
index 570b30344..000000000
--- a/test/vcr_cassettes/subscriptions_user_renew_failed.yml
+++ /dev/null
@@ -1,420 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4000000000000002&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_NNCoWza9ondAIx","request_duration_ms":599}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:25 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_omWmVa1SbgnhXT
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9Y2sOmf47Nz9aaIwjK7V",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "xsVM9Mfv9kfwhRSL",
- "funding": "credit",
- "generated_from": null,
- "last4": "0002",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247325,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:25 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc9Y2sOmf47Nz9aaIwjK7V&amount=3000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8E2ys9zDZgetWX
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_omWmVa1SbgnhXT","request_duration_ms":527}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 402
- message: Payment Required
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:27 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '7569'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_M2H98iru3Xt31z
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "error": {
- "charge": "ch_1GIc9Z2sOmf47Nz9xoFaFgIA",
- "code": "card_declined",
- "decline_code": "generic_decline",
- "doc_url": "https://stripe.com/docs/error-codes/card-declined",
- "message": "Your card was declined.",
- "payment_intent": {
- "id": "pi_1GIc9Z2sOmf47Nz91xCkee6I",
- "object": "payment_intent",
- "amount": 3000,
- "amount_capturable": 0,
- "amount_received": 0,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9Z2sOmf47Nz9xoFaFgIA",
- "object": "charge",
- "amount": 3000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": null,
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": false,
- "created": 1583247325,
- "currency": "usd",
- "customer": "cus_8E2ys9zDZgetWX",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": "card_declined",
- "failure_message": "Your card was declined.",
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "declined_by_network",
- "reason": "generic_decline",
- "risk_level": "normal",
- "risk_score": 64,
- "seller_message": "The bank did not return any further details with this decline.",
- "type": "issuer_declined"
- },
- "paid": false,
- "payment_intent": "pi_1GIc9Z2sOmf47Nz91xCkee6I",
- "payment_method": "pm_1GIc9Y2sOmf47Nz9aaIwjK7V",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "xsVM9Mfv9kfwhRSL",
- "funding": "credit",
- "installments": null,
- "last4": "0002",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9Z2sOmf47Nz9xoFaFgIA/rcpt_GqIlCsRVxrOuz8AE4BdqbdKWItWjNBV",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9Z2sOmf47Nz9xoFaFgIA/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "failed",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9Z2sOmf47Nz91xCkee6I"
- },
- "client_secret": "pi_1GIc9Z2sOmf47Nz91xCkee6I_secret_OJQYRP55NZ5iVKUWcxwIG4vpt",
- "confirmation_method": "manual",
- "created": 1583247325,
- "currency": "usd",
- "customer": "cus_8E2ys9zDZgetWX",
- "description": null,
- "invoice": null,
- "last_payment_error": {
- "charge": "ch_1GIc9Z2sOmf47Nz9xoFaFgIA",
- "code": "card_declined",
- "decline_code": "generic_decline",
- "doc_url": "https://stripe.com/docs/error-codes/card-declined",
- "message": "Your card was declined.",
- "payment_method": {
- "id": "pm_1GIc9Y2sOmf47Nz9aaIwjK7V",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "xsVM9Mfv9kfwhRSL",
- "funding": "credit",
- "generated_from": null,
- "last4": "0002",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247325,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- },
- "type": "card_error"
- },
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": null,
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "requires_payment_method",
- "transfer_data": null,
- "transfer_group": null
- },
- "payment_method": {
- "id": "pm_1GIc9Y2sOmf47Nz9aaIwjK7V",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "xsVM9Mfv9kfwhRSL",
- "funding": "credit",
- "generated_from": null,
- "last4": "0002",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247325,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- },
- "type": "card_error"
- }
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:27 GMT
-recorded_with: VCR 3.0.1
diff --git a/test/vcr_cassettes/subscriptions_user_renew_success.yml b/test/vcr_cassettes/subscriptions_user_renew_success.yml
deleted file mode 100644
index 432ba97f4..000000000
--- a/test/vcr_cassettes/subscriptions_user_renew_success.yml
+++ /dev/null
@@ -1,530 +0,0 @@
----
-http_interactions:
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_methods
- body:
- encoding: UTF-8
- string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2021&card[cvc]=314
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_qJlAIwLHBL3Eaj","request_duration_ms":590}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:22 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '840'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_dfmAuwdRAZxOVT
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pm_1GIc9W2sOmf47Nz9xOphAQQe",
- "object": "payment_method",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "unchecked"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1583247322,
- "customer": null,
- "livemode": false,
- "metadata": {
- },
- "type": "card"
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:22 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents
- body:
- encoding: UTF-8
- string: payment_method=pm_1GIc9W2sOmf47Nz9xOphAQQe&amount=3000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8E2ys9zDZgetWX
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_dfmAuwdRAZxOVT","request_duration_ms":555}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:24 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4150'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_JJcOaWgidBQ4OW
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9X2sOmf47Nz9KUeU06j5",
- "object": "payment_intent",
- "amount": 3000,
- "amount_capturable": 0,
- "amount_received": 3000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9X2sOmf47Nz9sXXWeRP9",
- "object": "charge",
- "amount": 3000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9X2sOmf47Nz9nzhSgQkq",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247323,
- "currency": "usd",
- "customer": "cus_8E2ys9zDZgetWX",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 21,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9X2sOmf47Nz9KUeU06j5",
- "payment_method": "pm_1GIc9W2sOmf47Nz9xOphAQQe",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9X2sOmf47Nz9sXXWeRP9/rcpt_GqIlDf1OtiNDpCE3f6H8yzNNNJgiThf",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9X2sOmf47Nz9sXXWeRP9/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9X2sOmf47Nz9KUeU06j5"
- },
- "client_secret": "pi_1GIc9X2sOmf47Nz9KUeU06j5_secret_Y2DWwqJ1cY5xEPb302KsejvF4",
- "confirmation_method": "manual",
- "created": 1583247323,
- "currency": "usd",
- "customer": "cus_8E2ys9zDZgetWX",
- "description": null,
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9W2sOmf47Nz9xOphAQQe",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:24 GMT
-- request:
- method: post
- uri: https://api.stripe.com/v1/payment_intents/pi_1GIc9X2sOmf47Nz9KUeU06j5
- body:
- encoding: UTF-8
- string: description=Invoice+reference%3A+2003001%2FVL
- headers:
- User-Agent:
- - Stripe/v1 RubyBindings/5.1.1
- Authorization:
- - Bearer sk_test_testfaketestfaketestfake
- Content-Type:
- - application/x-www-form-urlencoded
- X-Stripe-Client-Telemetry:
- - '{"last_request_metrics":{"request_id":"req_JJcOaWgidBQ4OW","request_duration_ms":1170}}'
- Stripe-Version:
- - '2019-08-14'
- X-Stripe-Client-User-Agent:
- - '{"bindings_version":"5.1.1","lang":"ruby","lang_version":"2.3.8 p459 (2018-10-18)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux
- version 5.5.5-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch
- Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Thu, 20 Feb 2020 18:23:09 +0000","hostname":"Sylvain-desktop"}'
- Accept-Encoding:
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
- Accept:
- - "*/*"
- response:
- status:
- code: 200
- message: OK
- headers:
- Server:
- - nginx
- Date:
- - Tue, 03 Mar 2020 14:55:24 GMT
- Content-Type:
- - application/json
- Content-Length:
- - '4177'
- Connection:
- - keep-alive
- Access-Control-Allow-Credentials:
- - 'true'
- Access-Control-Allow-Methods:
- - GET, POST, HEAD, OPTIONS, DELETE
- Access-Control-Allow-Origin:
- - "*"
- Access-Control-Expose-Headers:
- - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
- Access-Control-Max-Age:
- - '300'
- Cache-Control:
- - no-cache, no-store
- Request-Id:
- - req_NNCoWza9ondAIx
- Stripe-Version:
- - '2019-08-14'
- Strict-Transport-Security:
- - max-age=31556926; includeSubDomains; preload
- body:
- encoding: UTF-8
- string: |
- {
- "id": "pi_1GIc9X2sOmf47Nz9KUeU06j5",
- "object": "payment_intent",
- "amount": 3000,
- "amount_capturable": 0,
- "amount_received": 3000,
- "application": null,
- "application_fee_amount": null,
- "canceled_at": null,
- "cancellation_reason": null,
- "capture_method": "automatic",
- "charges": {
- "object": "list",
- "data": [
- {
- "id": "ch_1GIc9X2sOmf47Nz9sXXWeRP9",
- "object": "charge",
- "amount": 3000,
- "amount_refunded": 0,
- "application": null,
- "application_fee": null,
- "application_fee_amount": null,
- "balance_transaction": "txn_1GIc9X2sOmf47Nz9nzhSgQkq",
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "captured": true,
- "created": 1583247323,
- "currency": "usd",
- "customer": "cus_8E2ys9zDZgetWX",
- "description": null,
- "destination": null,
- "dispute": null,
- "disputed": false,
- "failure_code": null,
- "failure_message": null,
- "fraud_details": {
- },
- "invoice": null,
- "livemode": false,
- "metadata": {
- },
- "on_behalf_of": null,
- "order": null,
- "outcome": {
- "network_status": "approved_by_network",
- "reason": null,
- "risk_level": "normal",
- "risk_score": 21,
- "seller_message": "Payment complete.",
- "type": "authorized"
- },
- "paid": true,
- "payment_intent": "pi_1GIc9X2sOmf47Nz9KUeU06j5",
- "payment_method": "pm_1GIc9W2sOmf47Nz9xOphAQQe",
- "payment_method_details": {
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 4,
- "exp_year": 2021,
- "fingerprint": "o52jybR7bnmNn6AT",
- "funding": "credit",
- "installments": null,
- "last4": "4242",
- "network": "visa",
- "three_d_secure": null,
- "wallet": null
- },
- "type": "card"
- },
- "receipt_email": null,
- "receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1GIc9X2sOmf47Nz9sXXWeRP9/rcpt_GqIlDf1OtiNDpCE3f6H8yzNNNJgiThf",
- "refunded": false,
- "refunds": {
- "object": "list",
- "data": [
-
- ],
- "has_more": false,
- "total_count": 0,
- "url": "/v1/charges/ch_1GIc9X2sOmf47Nz9sXXWeRP9/refunds"
- },
- "review": null,
- "shipping": null,
- "source": null,
- "source_transfer": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- ],
- "has_more": false,
- "total_count": 1,
- "url": "/v1/charges?payment_intent=pi_1GIc9X2sOmf47Nz9KUeU06j5"
- },
- "client_secret": "pi_1GIc9X2sOmf47Nz9KUeU06j5_secret_Y2DWwqJ1cY5xEPb302KsejvF4",
- "confirmation_method": "manual",
- "created": 1583247323,
- "currency": "usd",
- "customer": "cus_8E2ys9zDZgetWX",
- "description": "Invoice reference: 2003001/VL",
- "invoice": null,
- "last_payment_error": null,
- "livemode": false,
- "metadata": {
- },
- "next_action": null,
- "on_behalf_of": null,
- "payment_method": "pm_1GIc9W2sOmf47Nz9xOphAQQe",
- "payment_method_options": {
- "card": {
- "installments": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "receipt_email": null,
- "review": null,
- "setup_future_usage": null,
- "shipping": null,
- "source": null,
- "statement_descriptor": null,
- "statement_descriptor_suffix": null,
- "status": "succeeded",
- "transfer_data": null,
- "transfer_group": null
- }
- http_version:
- recorded_at: Tue, 03 Mar 2020 14:55:24 GMT
-recorded_with: VCR 3.0.1