diff --git a/.fabmanager-version b/.fabmanager-version index 79a614418f..26f8b8bcdf 100644 --- a/.fabmanager-version +++ b/.fabmanager-version @@ -1 +1 @@ -2.4.4 +2.4.5 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a54faf3d9d..7c036fc9d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog Fab Manager +## v2.4.5 2016 November 29 + +- Ability to create coupons with cash amounts (previously only percentages were allowed) +- Improved error messages when something wrong append when paying a machine reservation by stripe +- Ability to display optional information message on event reservation page +- Fix a bug: misconfigured Twitter's ENV variables results in HTTP error 500 +- Fix a bug: wallet is not debited when paying locally with a user who have invoices disabled +- Fix a bug: wrong error message about rounding inconsistency is logged on invoice generation +- Fix a bug: reservation calendar of a specific training shows availabilities for all trainings + ## v2.4.4 2016 November 24 - Fix a bug: unable to rollback migration 20160906145713 diff --git a/README.md b/README.md index fb6d7023ca..2a08d75726 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,7 @@ See https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname- TWITTER_NAME Identifier of the Twitter account, from witch the last tweet will be fetched and displayed on the home page. +This value can be graphically overridden during the application's lifecycle in Admin/Customization/Home page/Twitter Feed. It will also be used for [Twitter Card analytics](https://dev.twitter.com/cards/analytics). TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, TWITTER_ACCESS_TOKEN & TWITTER_ACCESS_TOKEN_SECRET diff --git a/app/assets/javascripts/controllers/admin/coupons.coffee b/app/assets/javascripts/controllers/admin/coupons.coffee index eef8f658c4..21e0a65ae7 100644 --- a/app/assets/javascripts/controllers/admin/coupons.coffee +++ b/app/assets/javascripts/controllers/admin/coupons.coffee @@ -8,12 +8,13 @@ userValidities = ['once', 'forever'] ## # Controller used in the coupon creation page ## -Application.Controllers.controller "NewCouponController", ["$scope", "$state",'Coupon', 'growl', '_t' +Application.Controllers.controller "NewCouponController", ["$scope", "$state", 'Coupon', 'growl', '_t' , ($scope, $state, Coupon, growl, _t) -> ## Values for the coupon currently created $scope.coupon = active: true + type: 'percent_off' ## Options for the validity per user $scope.validities = userValidities @@ -57,7 +58,7 @@ Application.Controllers.controller "NewCouponController", ["$scope", "$state",'C ## # Controller used in the coupon edition page ## -Application.Controllers.controller "EditCouponController", ["$scope", "$state", 'Coupon', 'couponPromise', '_t' +Application.Controllers.controller "EditCouponController", ["$scope", "$state", 'Coupon', 'couponPromise', '_t' , ($scope, $state, Coupon, couponPromise, _t) -> ### PUBLIC SCOPE ### diff --git a/app/assets/javascripts/controllers/admin/events.coffee.erb b/app/assets/javascripts/controllers/admin/events.coffee.erb index 4e2665f5da..9ef91e1c5d 100644 --- a/app/assets/javascripts/controllers/admin/events.coffee.erb +++ b/app/assets/javascripts/controllers/admin/events.coffee.erb @@ -382,8 +382,8 @@ Application.Controllers.controller "ShowEventReservationsController", ["$scope", ## # Controller used in the event creation page ## -Application.Controllers.controller "NewEventController", ["$scope", "$state", "$locale", 'CSRF', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t' -, ($scope, $state, $locale, CSRF, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t) -> +Application.Controllers.controller "NewEventController", ["$scope", "$state", 'CSRF', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t' +, ($scope, $state, CSRF, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t) -> CSRF.setMetaTags() ## API URL where the form will be posted @@ -425,10 +425,6 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$ {label: _t('every_year'), value: 'year'} ] - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - - ## Using the EventsController new EventsController($scope, $state) ] @@ -438,8 +434,8 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$ ## # Controller used in the events edition page ## -Application.Controllers.controller "EditEventController", ["$scope", "$state", "$stateParams", "$locale", 'CSRF', 'eventPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise' -, ($scope, $state, $stateParams, $locale, CSRF, eventPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise) -> +Application.Controllers.controller "EditEventController", ["$scope", "$state", "$stateParams", 'CSRF', 'eventPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise' +, ($scope, $state, $stateParams, CSRF, eventPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise) -> ### PUBLIC SCOPE ### @@ -454,9 +450,6 @@ Application.Controllers.controller "EditEventController", ["$scope", "$state", " ## Retrieve the event details, in case of error the user is redirected to the events listing $scope.event = eventPromise - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - ## List of categories for the events $scope.categories = categoriesPromise diff --git a/app/assets/javascripts/controllers/admin/members.coffee.erb b/app/assets/javascripts/controllers/admin/members.coffee.erb index 75b30126cb..9c37206d8e 100644 --- a/app/assets/javascripts/controllers/admin/members.coffee.erb +++ b/app/assets/javascripts/controllers/admin/members.coffee.erb @@ -421,10 +421,7 @@ Application.Controllers.controller "EditMemberController", ["$scope", "$state", modalInstance = $uibModal.open animation: true, templateUrl: '<%= asset_path "wallet/credit_modal.html" %>' - controller: ['$scope', '$uibModalInstance', 'Wallet', '$locale', ($scope, $uibModalInstance, Wallet, $locale) -> - - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM + controller: ['$scope', '$uibModalInstance', 'Wallet', ($scope, $uibModalInstance, Wallet) -> ## # Modal dialog validation callback diff --git a/app/assets/javascripts/controllers/admin/plans.coffee.erb b/app/assets/javascripts/controllers/admin/plans.coffee.erb index 8fb323c10f..c632790b8d 100644 --- a/app/assets/javascripts/controllers/admin/plans.coffee.erb +++ b/app/assets/javascripts/controllers/admin/plans.coffee.erb @@ -78,8 +78,8 @@ class PlanController ## # Controller used in the plan creation form ## -Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', 'groups', 'plans', 'machines', 'prices', 'partners', 'CSRF', '$state', 'growl', '_t', '$locale' -, ($scope, $uibModal, groups, plans, machines, prices, partners, CSRF, $state, growl, _t, $locale) -> +Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', 'groups', 'plans', 'machines', 'prices', 'partners', 'CSRF', '$state', 'growl', '_t' +, ($scope, $uibModal, groups, plans, machines, prices, partners, CSRF, $state, growl, _t) -> @@ -119,10 +119,6 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', $scope.method = 'POST' - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - - ## # Checks if the partner contact is a valid data. Used in the form validation process @@ -187,8 +183,8 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', ## # Controller used in the plan edition form ## -Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'plans', 'planPromise', 'machines', 'prices', 'partners', 'CSRF', '$state', '$stateParams', 'growl', '$filter', '_t', '$locale', 'Plan' -, ($scope, groups, plans, planPromise, machines, prices, partners, CSRF, $state, $stateParams, growl, $filter, _t, $locale, Plan) -> +Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'plans', 'planPromise', 'machines', 'prices', 'partners', 'CSRF', '$state', '$stateParams', 'growl', '$filter', '_t', 'Plan' +, ($scope, groups, plans, planPromise, machines, prices, partners, CSRF, $state, $stateParams, growl, $filter, _t, Plan) -> @@ -208,10 +204,6 @@ Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'p $scope.method = 'PATCH' - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - - ## # If a parent plan was set ($scope.plan.parent), the prices will be copied from this parent plan into diff --git a/app/assets/javascripts/controllers/admin/pricing.coffee.erb b/app/assets/javascripts/controllers/admin/pricing.coffee.erb index 4d69bfae72..76bcf7cf68 100644 --- a/app/assets/javascripts/controllers/admin/pricing.coffee.erb +++ b/app/assets/javascripts/controllers/admin/pricing.coffee.erb @@ -3,8 +3,8 @@ ## # Controller used in the prices edition page ## -Application.Controllers.controller "EditPricingController", ["$scope", "$state", '$uibModal', 'TrainingsPricing', '$filter', 'Credit', 'Pricing', 'Plan', 'Coupon', 'plans', 'groups', 'growl', 'machinesPricesPromise', 'Price', 'dialogs', 'trainingsPricingsPromise', 'trainingsPromise', 'machineCreditsPromise', 'machinesPromise', 'trainingCreditsPromise', 'couponsPromise', '_t' -, ($scope, $state, $uibModal, TrainingsPricing, $filter, Credit, Pricing, Plan, Coupon, plans, groups, growl, machinesPricesPromise, Price, dialogs, trainingsPricingsPromise, trainingsPromise, machineCreditsPromise, machinesPromise, trainingCreditsPromise, couponsPromise, _t) -> +Application.Controllers.controller "EditPricingController", ["$scope", "$state", '$uibModal', '$filter', 'TrainingsPricing', 'Credit', 'Pricing', 'Plan', 'Coupon', 'plans', 'groups', 'growl', 'machinesPricesPromise', 'Price', 'dialogs', 'trainingsPricingsPromise', 'trainingsPromise', 'machineCreditsPromise', 'machinesPromise', 'trainingCreditsPromise', 'couponsPromise', '_t' +, ($scope, $state, $uibModal, $filter, TrainingsPricing, Credit, Pricing, Plan, Coupon, plans, groups, growl, machinesPricesPromise, Price, dialogs, trainingsPricingsPromise, trainingsPromise, machineCreditsPromise, machinesPromise, trainingCreditsPromise, couponsPromise, _t) -> ### PUBLIC SCOPE ### ## List of machines prices (not considering any plan) diff --git a/app/assets/javascripts/controllers/admin/settings.coffee b/app/assets/javascripts/controllers/admin/settings.coffee index ea83a15251..a1e3b94a84 100644 --- a/app/assets/javascripts/controllers/admin/settings.coffee +++ b/app/assets/javascripts/controllers/admin/settings.coffee @@ -45,6 +45,7 @@ Application.Controllers.controller "SettingsController", ["$scope", 'Setting', ' $scope.trainingExplicationsAlert = { name: 'training_explications_alert', value: settingsPromise.training_explications_alert } $scope.trainingInformationMessage = { name: 'training_information_message', value: settingsPromise.training_information_message} $scope.subscriptionExplicationsAlert = { name: 'subscription_explications_alert', value: settingsPromise.subscription_explications_alert } + $scope.eventExplicationsAlert = {name: 'event_explications_alert', value: settingsPromise.event_explications_alert } $scope.windowStart = { name: 'booking_window_start', value: settingsPromise.booking_window_start } $scope.windowEnd = { name: 'booking_window_end', value: settingsPromise.booking_window_end } $scope.mainColorSetting = { name: 'main_color', value: settingsPromise.main_color } @@ -73,7 +74,7 @@ Application.Controllers.controller "SettingsController", ["$scope", 'Setting', ' $scope.cancelDelay = name: 'booking_cancel_delay' value: parseInt(settingsPromise.booking_cancel_delay) - + $scope.enableReminder = name: 'reminder_enable' value: (settingsPromise.reminder_enable == 'true') diff --git a/app/assets/javascripts/controllers/application.coffee.erb b/app/assets/javascripts/controllers/application.coffee.erb index 095c50892a..51c42a6a36 100644 --- a/app/assets/javascripts/controllers/application.coffee.erb +++ b/app/assets/javascripts/controllers/application.coffee.erb @@ -1,7 +1,7 @@ 'use strict' -Application.Controllers.controller 'ApplicationController', ["$rootScope", "$scope", "$window", "Session", "AuthService", "Auth", "$uibModal", "$state", 'growl', 'Notification', '$interval', "Setting", '_t', 'Version' -, ($rootScope, $scope, $window, Session, AuthService, Auth, $uibModal, $state, growl, Notification, $interval, Setting, _t, Version) -> +Application.Controllers.controller 'ApplicationController', ["$rootScope", "$scope", "$window", '$locale', "Session", "AuthService", "Auth", "$uibModal", "$state", 'growl', 'Notification', '$interval', "Setting", '_t', 'Version' +, ($rootScope, $scope, $window, $locale, Session, AuthService, Auth, $uibModal, $state, growl, Notification, $interval, Setting, _t, Version) -> @@ -18,6 +18,10 @@ Application.Controllers.controller 'ApplicationController', ["$rootScope", "$sco $scope.version = version: '' + ## currency symbol for the current locale (cf. angular-i18n) + $rootScope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; + + ## # Set the current user to the provided value and initialize the session # @param user {Object} Rails/Devise user diff --git a/app/assets/javascripts/controllers/events.coffee.erb b/app/assets/javascripts/controllers/events.coffee.erb index 39083272f5..58ec0fe312 100644 --- a/app/assets/javascripts/controllers/events.coffee.erb +++ b/app/assets/javascripts/controllers/events.coffee.erb @@ -154,6 +154,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " tickets: {} toReserve: false amountTotal : 0 + totalNoCoupon: 0 totalSeats: 0 ## Discount coupon to apply to the basket, if any @@ -172,6 +173,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " ## Global config: delay in hours before a booking while changing the booking slot is forbidden $scope.moveBookingDelay = parseInt(settingsPromise.booking_move_delay) + ## Message displayed to the end user about rules that applies to events reservations + $scope.eventExplicationsAlert = settingsPromise.event_explications_alert + ## @@ -400,6 +404,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " r = mkReservation($scope.ctrl.member, $scope.reserve, $scope.event) Price.compute mkRequestParams(r, $scope.coupon.applied), (res) -> $scope.reserve.amountTotal = res.price + $scope.reserve.totalNoCoupon = res.price_without_coupon else $scope.reserve.amountTotal = null @@ -560,9 +565,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " member: $scope.ctrl.member coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'growl', 'wallet', 'helpers', '$locale', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, growl, wallet, helpers, $locale, $filter, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'growl', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, growl, wallet, helpers, $filter, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Price @@ -574,8 +579,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " # Reservation $scope.reservation = reservation - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - + # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') # Callback for the stripe payment authorization @@ -616,9 +620,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " Wallet.getWalletByUser({user_id: reservation.user_id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', '$locale', 'helpers', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, $locale, helpers, $filter, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, helpers, $filter, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Price @@ -630,8 +634,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " # Reservation $scope.reservation = reservation - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - + # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') # Button label @@ -675,6 +678,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " $scope.event.nb_free_places = $scope.event.nb_free_places - reservation.total_booked_seats resetEventReserve() $scope.reserveSuccess = true + $scope.coupon.applied = null $scope.reservations.push reservation if $scope.currentUser.role == 'admin' $scope.ctrl.member = null diff --git a/app/assets/javascripts/controllers/machines.coffee.erb b/app/assets/javascripts/controllers/machines.coffee.erb index 775dd441ab..6234165e52 100644 --- a/app/assets/javascripts/controllers/machines.coffee.erb +++ b/app/assets/javascripts/controllers/machines.coffee.erb @@ -315,6 +315,9 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat ## total amount of the bill to pay $scope.amountTotal = 0 + ## total amount of the elements in the cart, without considering any coupon + $scope.totalNoCoupon = 0 + ## Discount coupon to apply to the basket, if any $scope.coupon = applied: null @@ -661,6 +664,7 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat r = mkReservation($scope.ctrl.member, $scope.eventsReserved, $scope.selectedPlan) Price.compute mkRequestParams(r, $scope.coupon.applied), (res) -> $scope.amountTotal = res.price + $scope.totalNoCoupon = res.price_without_coupon setSlotsDetails(res.details) else # otherwise we alert, this error musn't occur when the current user is not admin @@ -782,8 +786,8 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat CustomAsset.get({name: 'cgv-file'}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'wallet', 'helpers', '$locale', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, wallet, helpers, $locale, $filter, coupon) -> + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, wallet, helpers, $filter, coupon) -> # user wallet amount $scope.walletAmount = wallet.amount @@ -796,9 +800,6 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat # Reservation $scope.reservation = reservation - # Currency symbol or abreviation for the current locale - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') @@ -815,9 +816,19 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat $uibModalInstance.close(reservation) , (response)-> $scope.alerts = [] - $scope.alerts.push - msg: response.data.card[0] - type: 'danger' + if response.status == 500 + $scope.alerts.push + msg: response.statusText + type: 'danger' + else + if response.data.card and response.data.card.join('').length > 0 + $scope.alerts.push + msg: response.data.card.join('. ') + type: 'danger' + else if response.data.payment and response.data.payment.join('').length > 0 + $scope.alerts.push + msg: response.data.payment.join('. ') + type: 'danger' $scope.attempting = false ] .result['finally'](null).then (reservation)-> @@ -842,8 +853,8 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat Wallet.getWalletByUser({user_id: reservation.user_id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', '$locale', 'coupon', - ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, helpers, $filter, $locale, coupon) -> + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, helpers, $filter, coupon) -> # user wallet amount $scope.walletAmount = wallet.amount @@ -857,9 +868,6 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat # Reservation $scope.reservation = reservation - # Currency symbol or abreviation for the current locale - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') @@ -942,6 +950,7 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat $scope.paidMachineSlots = $scope.eventsReserved $scope.eventsReserved = [] + $scope.coupon.applied = null if $scope.selectedPlan $scope.ctrl.member.subscribed_plan = angular.copy($scope.selectedPlan) diff --git a/app/assets/javascripts/controllers/plans.coffee.erb b/app/assets/javascripts/controllers/plans.coffee.erb index 14c74443e6..4396d03e9c 100644 --- a/app/assets/javascripts/controllers/plans.coffee.erb +++ b/app/assets/javascripts/controllers/plans.coffee.erb @@ -177,11 +177,14 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop updateCartPrice = -> # first we check that a user was selected if Object.keys($scope.ctrl.member).length > 0 - $scope.cart.total = $scope.selectedPlan.amount - # apply the coupon if any - if $scope.coupon.applied + $scope.cart.total = $scope.selectedPlan.amount + # apply the coupon if any + if $scope.coupon.applied + if $scope.coupon.applied.type == 'percent_off' discount = $scope.cart.total * $scope.coupon.applied.percent_off / 100 - $scope.cart.total -= discount + else if $scope.coupon.applied.type == 'amount_off' + discount = $scope.coupon.applied.amount_off + $scope.cart.total -= discount else $scope.reserve.amountTotal = null @@ -200,9 +203,9 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop wallet: -> Wallet.getWalletByUser({user_id: $scope.ctrl.member.id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'CustomAsset', 'wallet', 'helpers', '$locale', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, CustomAsset, wallet, helpers, $locale, $filter, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'CustomAsset', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, CustomAsset, wallet, helpers, $filter, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Final price to pay by the user @@ -211,9 +214,6 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop # The plan that the user is about to subscribe $scope.selectedPlan = selectedPlan - # Currency symbol or abreviation for the current locale - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') @@ -249,6 +249,7 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop Auth._currentUser.subscribed_plan = angular.copy($scope.selectedPlan) $scope.paid.plan = angular.copy($scope.selectedPlan) $scope.selectedPlan = null + $scope.coupon.applied = null @@ -266,8 +267,8 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop wallet: -> Wallet.getWalletByUser({user_id: $scope.ctrl.member.id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'wallet', 'helpers', '$locale', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, wallet, helpers, $locale, $filter, coupon) -> + controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, wallet, helpers, $filter, coupon) -> # user wallet amount $scope.walletAmount = wallet.amount @@ -277,9 +278,6 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop # price to pay $scope.amount = helpers.getAmountToPay($scope.price, wallet.amount) - # Currency symbol or abreviation for the current locale - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') @@ -329,6 +327,7 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop $scope.ctrl.member = null $scope.paid.plan = angular.copy($scope.selectedPlan) $scope.selectedPlan = null + $scope.coupon.applied = null diff --git a/app/assets/javascripts/controllers/projects.coffee.erb b/app/assets/javascripts/controllers/projects.coffee.erb index 5e7979e742..0252de56fc 100644 --- a/app/assets/javascripts/controllers/projects.coffee.erb +++ b/app/assets/javascripts/controllers/projects.coffee.erb @@ -217,10 +217,25 @@ Application.Controllers.controller "ProjectsController", ["$scope", "$state", 'P # Number of projects added to the page when the user clicks on 'load more projects' PROJECTS_PER_PAGE = 16 - $scope.openlabAppId = Fablab.openlabAppId + ### PUBLIC SCOPE ### - $scope.search = { q: ($location.$$search.q || ""), from: ($location.$$search.from || undefined), machine_id: (parseInt($location.$$search.machine_id) || undefined), component_id: (parseInt($location.$$search.component_id) || undefined), theme_id: (parseInt($location.$$search.theme_id) || undefined) } + + ## Fab-manager's instance ID in the openLab network + $scope.openlabAppId = Fablab.openlabAppId + + ## Is openLab enabled on the instance? + $scope.openlab = + projectsActive: Fablab.openlabProjectsActive + searchOverWholeNetwork: false + + ## default search parameters + $scope.search = + q: ($location.$$search.q || "") + from: ($location.$$search.from || undefined) + machine_id: (parseInt($location.$$search.machine_id) || undefined) + component_id: (parseInt($location.$$search.component_id) || undefined) + theme_id: (parseInt($location.$$search.theme_id) || undefined) ## list of projects to display $scope.projects = [] @@ -234,32 +249,14 @@ Application.Controllers.controller "ProjectsController", ["$scope", "$state", 'P ## list of components / used for filtering $scope.components = componentsPromise - $scope.openlab = {} - $scope.openlab.projectsActive = Fablab.openlabProjectsActive - - if $location.$$search.whole_network is 'f' - $scope.openlab.searchOverWholeNetwork = false - else - $scope.openlab.searchOverWholeNetwork = $scope.openlab.projectsActive || false - normalizeProjectsAttrs = (projects)-> - projects.map((project)-> - project.project_image = project.image_url - return project - ) $scope.searchOverWholeNetworkChanged = -> setTimeout -> $scope.resetFiltersAndTriggerSearch() , 150 - loadMoreCallback = (projectsPromise)-> - $scope.projects = $scope.projects.concat(projectsPromise.projects) - updateUrlParam('page', $scope.projectsPagination.currentPage) - loadMoreOpenlabCallback = (projectsPromise)-> - $scope.projects = $scope.projects.concat(normalizeProjectsAttrs(projectsPromise.projects)) - updateUrlParam('page', $scope.projectsPagination.currentPage) $scope.loadMore = -> if $scope.openlab.searchOverWholeNetwork is true @@ -268,6 +265,7 @@ Application.Controllers.controller "ProjectsController", ["$scope", "$state", 'P $scope.projectsPagination.loadMore(search: $scope.search) + $scope.resetFiltersAndTriggerSearch = -> $scope.search.q = "" $scope.search.from = undefined @@ -277,6 +275,8 @@ Application.Controllers.controller "ProjectsController", ["$scope", "$state", 'P $scope.setUrlQueryParams($scope.search) $scope.triggerSearch() + + $scope.triggerSearch = -> currentPage = parseInt($location.$$search.page) || 1 if $scope.openlab.searchOverWholeNetwork is true @@ -298,6 +298,8 @@ Application.Controllers.controller "ProjectsController", ["$scope", "$state", 'P $scope.projectsPagination.totalCount = projectsPromise.meta.total $scope.projects = projectsPromise.projects + + ## # Callback to switch the user's view to the detailled project page # @param project {{slug:string}} The project to display @@ -309,6 +311,8 @@ Application.Controllers.controller "ProjectsController", ["$scope", "$state", 'P else $state.go('app.public.projects_show', {id: project.slug}) + + ## # function to set all url query search parameters from search object ## @@ -320,6 +324,21 @@ Application.Controllers.controller "ProjectsController", ["$scope", "$state", 'P updateUrlParam('component_id', search.component_id) updateUrlParam('machine_id', search.machine_id) + + + ### PRIVATE SCOPE ### + + ## + # Kind of constructor: these actions will be realized first when the controller is loaded + ## + initialize = -> + if $location.$$search.whole_network is 'f' + $scope.openlab.searchOverWholeNetwork = false + else + $scope.openlab.searchOverWholeNetwork = $scope.openlab.projectsActive || false + $scope.triggerSearch() + + ## # function to update url query param, little hack to turn off reloadOnSearch and re-enable it after setting the params # params example: 'q' , 'presse-purée' @@ -330,9 +349,30 @@ Application.Controllers.controller "ProjectsController", ["$scope", "$state", 'P $timeout -> $state.current.reloadOnSearch = undefined - ## initialization - $scope.triggerSearch() + + loadMoreCallback = (projectsPromise)-> + $scope.projects = $scope.projects.concat(projectsPromise.projects) + updateUrlParam('page', $scope.projectsPagination.currentPage) + + + + loadMoreOpenlabCallback = (projectsPromise)-> + $scope.projects = $scope.projects.concat(normalizeProjectsAttrs(projectsPromise.projects)) + updateUrlParam('page', $scope.projectsPagination.currentPage) + + + + normalizeProjectsAttrs = (projects)-> + projects.map((project)-> + project.project_image = project.image_url + return project + ) + + + + ## !!! MUST BE CALLED AT THE END of the controller + initialize() ] diff --git a/app/assets/javascripts/controllers/trainings.coffee.erb b/app/assets/javascripts/controllers/trainings.coffee.erb index 2c6cdfa391..cdd4563b42 100644 --- a/app/assets/javascripts/controllers/trainings.coffee.erb +++ b/app/assets/javascripts/controllers/trainings.coffee.erb @@ -137,6 +137,12 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta $scope.coupon = applied: null + ## Total price of the cart, that the user will pay + $scope.amountTotal = 0 + + ## Total amount of the elements in the cart, without considering any coupon + $scope.totalNoCoupon = 0 + ## fullCalendar (v2) configuration $scope.calendarConfig = CalendarConfig minTime: moment.duration(moment(settingsPromise.booking_window_start).format('HH:mm:ss')) @@ -353,6 +359,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta r = mkReservation($scope.ctrl.member, $scope.selectedTraining, $scope.selectedPlan) Price.compute mkRequestParams(r, $scope.coupon.applied), (res) -> $scope.amountTotal = res.price + $scope.totalNoCoupon = res.price_without_coupon else $scope.amountTotal = null @@ -426,7 +433,6 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta if $scope.ctrl.member # reserve a training if this training will not be reserved and is not about to move and not is completed if !event.is_reserved && !$scope.slotToModify && !event.is_completed - $scope.coupon.applied = null if event != $scope.selectedTraining $scope.selectedTraining = event $scope.selectedTraining.offered = false @@ -533,9 +539,9 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta CustomAsset.get({name: 'cgv-file'}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'wallet', 'cgv', 'Auth', 'Reservation', '$locale', 'helpers', '$filter', 'coupon' - ($scope, $uibModalInstance, $state, reservation, price, wallet, cgv, Auth, Reservation, $locale, helpers, $filter, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'wallet', 'cgv', 'Auth', 'Reservation', 'helpers', '$filter', 'coupon' + ($scope, $uibModalInstance, $state, reservation, price, wallet, cgv, Auth, Reservation, helpers, $filter, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Price @@ -547,8 +553,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta # Reservation $scope.reservation = reservation - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - + # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') ## @@ -594,9 +599,9 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta Wallet.getWalletByUser({user_id: reservation.user_id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', '$filter', 'reservation', 'price', 'wallet', 'Auth', 'Reservation', '$locale', 'helpers', 'coupon' - ($scope, $uibModalInstance, $state, $filter, reservation, price, wallet, Auth, Reservation, $locale, helpers, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', '$filter', 'reservation', 'price', 'wallet', 'Auth', 'Reservation', 'helpers', 'coupon' + ($scope, $uibModalInstance, $state, $filter, reservation, price, wallet, Auth, Reservation, helpers, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Price @@ -608,8 +613,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta # Reservation $scope.reservation = reservation - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - + # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') # Button label @@ -649,7 +653,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta # first we check that a user was selected if Object.keys($scope.ctrl.member).length > 0 r = mkReservation($scope.ctrl.member, training) # reservation without any Plan -> we get the training price - Price.compute mkRequestParams(r, $scope.coupon.applied), (res) -> + Price.compute mkRequestParams(r), (res) -> $scope.selectedTrainingAmount = res.price else $scope.selectedTrainingAmount = null @@ -672,6 +676,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta $scope.selectedTraining = null $scope.trainingIsValid = false + $scope.coupon.applied = null if $scope.selectedPlan $scope.ctrl.member.subscribed_plan = angular.copy($scope.selectedPlan) diff --git a/app/assets/javascripts/directives/coupon.coffee.erb b/app/assets/javascripts/directives/coupon.coffee.erb index 2d1aa5812b..4392297bf7 100644 --- a/app/assets/javascripts/directives/coupon.coffee.erb +++ b/app/assets/javascripts/directives/coupon.coffee.erb @@ -1,11 +1,11 @@ -Application.Directives.directive 'coupon', [ 'Coupon', 'growl', '_t', (Coupon, growl, _t) -> +Application.Directives.directive 'coupon', [ '$rootScope', 'Coupon', 'growl', '_t', ($rootScope, Coupon, growl, _t) -> { restrict: 'E' scope: show: '=' coupon: '=' + total: '=' userId: '@' - hasSelectSlot: '=' templateUrl: '<%= asset_path "shared/_coupon.html" %>' link: ($scope, element, attributes) -> @@ -16,15 +16,13 @@ Application.Directives.directive 'coupon', [ 'Coupon', 'growl', '_t', (Coupon, g # Available status are: 'pending', 'valid', 'invalid' $scope.status = 'pending' - # Binding for the code inputed + # Binding for the code inputed (see the attached template) $scope.couponCode = null - $scope.$watch 'hasSelectSlot', (newValue) -> - unless newValue - $scope.coupon = null - $scope.couponCode = null - $scope.code.input = false - + # Re-compute if the code can be applied when the total of the cart changes + $scope.$watch 'total', (newValue, oldValue) -> + if newValue and newValue != oldValue and $scope.couponCode + $scope.validateCode() ## # Callback to validate the code @@ -34,10 +32,13 @@ Application.Directives.directive 'coupon', [ 'Coupon', 'growl', '_t', (Coupon, g $scope.status = 'pending' $scope.coupon = null else - Coupon.validate {code: $scope.couponCode, user_id: $scope.userId}, (res) -> + Coupon.validate {code: $scope.couponCode, user_id: $scope.userId, amount: $scope.total}, (res) -> $scope.status = 'valid' $scope.coupon = res - growl.success(_t('the_coupon_has_been_applied_you_get_PERCENT_discount', {PERCENT: res.percent_off})) + if res.type == 'percent_off' + growl.success(_t('the_coupon_has_been_applied_you_get_PERCENT_discount', {PERCENT: res.percent_off})) + else + growl.success(_t('the_coupon_has_been_applied_you_get_AMOUNT_CURRENCY', {AMOUNT: res.amount_off, CURRENCY: $rootScope.currencySymbol})) , (err) -> $scope.status = 'invalid' $scope.coupon = null diff --git a/app/assets/javascripts/router.coffee.erb b/app/assets/javascripts/router.coffee.erb index 5d7f16cc0e..b621517480 100644 --- a/app/assets/javascripts/router.coffee.erb +++ b/app/assets/javascripts/router.coffee.erb @@ -522,7 +522,7 @@ angular.module('application.router', ['ui.router']). PriceCategory.query().$promise ] settingsPromise: ['Setting', (Setting)-> - Setting.query(names: "['booking_move_enable', 'booking_move_delay']").$promise + Setting.query(names: "['booking_move_enable', 'booking_move_delay', 'event_explications_alert']").$promise ] translations: [ 'Translations', (Translations) -> Translations.query(['app.public.events_show', 'app.shared.member_select', 'app.shared.stripe', @@ -1037,6 +1037,7 @@ angular.module('application.router', ['ui.router']). 'training_explications_alert', 'training_information_message', 'subscription_explications_alert', + 'event_explications_alert', 'booking_window_start', 'booking_window_end', 'booking_move_enable', diff --git a/app/assets/stylesheets/app.utilities.scss b/app/assets/stylesheets/app.utilities.scss index eca31e6387..2457915158 100644 --- a/app/assets/stylesheets/app.utilities.scss +++ b/app/assets/stylesheets/app.utilities.scss @@ -56,6 +56,7 @@ p, .widget p { .block.hide{display: none;} .inline{display:inline-block !important;} .none{display: none;} +.pull-left{float: left;} .pull-right-lg{float: right;} .pull-none{float: none;} .rounded{border-radius: 500px;} diff --git a/app/assets/templates/admin/coupons/_form.html.erb b/app/assets/templates/admin/coupons/_form.html.erb index 81274bcc2c..4cc92c9f6e 100644 --- a/app/assets/templates/admin/coupons/_form.html.erb +++ b/app/assets/templates/admin/coupons/_form.html.erb @@ -21,7 +21,20 @@ {{ 'code_must_be_composed_of_capital_letters_digits_and_or_dashes' }} -
+ +
+ +<%= t('.body.enjoy_a_discount_of_PERCENT_with_code_CODE', - PERCENT: @attached_object.percent_off, - CODE: @attached_object.code - ) %> -
+<% if @attached_object.type == 'percent_off' %> +<%= t('.body.enjoy_a_discount_of_PERCENT_with_code_CODE', + PERCENT: @attached_object.percent_off, + CODE: @attached_object.code + ) %> +
+<% else %> +<%= t('.body.enjoy_a_discount_of_AMOUNT_with_code_CODE', + AMOUNT: number_to_currency(@attached_object.amount_off / 100.00), + CODE: @attached_object.code + ) %> +
+<% end %> <% # we must tell the use if he could use the code just once or many times (in case we won't specify) @@ -21,6 +29,7 @@ <%= _t('.body.this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases', { USAGE: usages, + TYPE: @attached_object.type, DATE: @attached_object.valid_until.nil? ? 'NO-DATE' : I18n.l(@attached_object.valid_until.to_date) }) # messageFormat diff --git a/app/workers/reservation_reminder_worker.rb b/app/workers/reservation_reminder_worker.rb index 5aff73febc..68d723dfce 100644 --- a/app/workers/reservation_reminder_worker.rb +++ b/app/workers/reservation_reminder_worker.rb @@ -16,7 +16,7 @@ def perform already_sent = Notification.where( attached_object_type: Reservation.name, attached_object_id: r.id, - notification_type_id: NotificationType.find_by_name('notify_member_reservation_reminder') + notification_type_id: NotificationType.find_by(name: 'notify_member_reservation_reminder') ).count unless already_sent > 0 NotificationCenter.call type: 'notify_member_reservation_reminder', diff --git a/app/workers/stripe_worker.rb b/app/workers/stripe_worker.rb index a7bfd8e49b..d3b8d0d5eb 100644 --- a/app/workers/stripe_worker.rb +++ b/app/workers/stripe_worker.rb @@ -20,8 +20,14 @@ def create_stripe_coupon(coupon_id) stp_coupon = { id: coupon.code, duration: coupon.validity_per_user, - percent_off: coupon.percent_off, } + if coupon.type == 'percent_off' + stp_coupon[:percent_off] = coupon.percent_off + elsif coupon.type == 'amount_off' + stp_coupon[:amount_off] = coupon.amount_off + stp_coupon[:currency] = Rails.application.secrets.stripe_currency + end + unless coupon.valid_until.nil? stp_coupon[:redeem_by] = coupon.valid_until.to_i end diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index d99c752871..bb0d52ad73 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -164,7 +164,7 @@ en: unable_to_delete_the_specified_subscription_an_error_occurred: "Unable to delete the specified subscription, an error occurred." coupons: "Coupons" list_of_the_coupons: "List of the coupons" - percentage_off: "Percentage off" + discount: "Discount" nb_of_usages: "Number of usages" status: "Status" add_a_new_coupon: "Add a new coupon" @@ -492,6 +492,7 @@ en: warning_message_of_the_training_booking_page: "Warning message of the training booking page:" information_message_of_the_training_reservation_page: "Information message of the training reservation page:" message_of_the_subscriptions_page: "Message of the subscriptions page:" + message_of_the_events_page: "Message of the events page:" legal_documents: "Legal documents" if_these_documents_are_not_filled_no_consent_about_them_will_be_asked_to_the_user: "If these documents are not filled, no consent about them will be asked." general_terms_and_conditions_(T&C): "General terms and conditions (T&C)" diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index d054fb3850..510652ebce 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -164,7 +164,7 @@ fr: unable_to_delete_the_specified_subscription_an_error_occurred: "Impossible de supprimer l'abonnement spécifié, une erreur s'est produite." coupons: "Codes promotionnels" list_of_the_coupons: "Liste des codes promotionnels" - percentage_off: "Pourcentage de réduction" + discount: "Réduction" nb_of_usages: "Nombre d'utilisations" status: "Statut" add_a_new_coupon: "Ajouter un code promotionnel" @@ -492,6 +492,7 @@ fr: warning_message_of_the_training_booking_page: "Message d'avertissement sur la page de réservation d'une formation :" information_message_of_the_training_reservation_page: "Message d'information sur la page de réservation d'une formation :" message_of_the_subscriptions_page: "Message sur la page des abonnements :" + message_of_the_events_page: "Message sur la page des évènements :" legal_documents: "Documents légaux" if_these_documents_are_not_filled_no_consent_about_them_will_be_asked_to_the_user: "Si ces documents ne sont pas renseignés, aucun consentement à leur sujet ne sera demandé à l'utilisateur." general_terms_and_conditions_(T&C): "Conditions générales de vente (CGV)" diff --git a/config/locales/app.shared.en.yml b/config/locales/app.shared.en.yml index 9fc367101e..8913ea48e6 100644 --- a/config/locales/app.shared.en.yml +++ b/config/locales/app.shared.en.yml @@ -346,6 +346,10 @@ en: code: "Code" code_is_required: "Code is required." code_must_be_composed_of_capital_letters_digits_and_or_dashes: "The code must be composed of capital letters, digits and/or dashes." + kind_of_coupon: "Kind of coupon" + percentage: "Percentage" + amount: "Amount" + amount_off: "Amount off" percent_off: "Percentage off" percent_off_is_required: "Percentage off is required." percentage_must_be_between_0_and_100: "Percentage must be between 0 and 100." @@ -363,9 +367,12 @@ en: # coupon (input zone for users) i_have_a_coupon: "I have a coupon!" code_: "Code:" - the_coupon_has_been_applied_you_get_PERCENT_discount: "The coupon has been applied. You get {{PERCENT}}% discount." # angular interpolation + the_coupon_has_been_applied_you_get_PERCENT_discount: "The coupon has been applied. You get a {{PERCENT}}% discount." # angular interpolation + the_coupon_has_been_applied_you_get_AMOUNT_CURRENCY: "The coupon has been applied. You get a discount of {{AMOUNT}} {{CURRENCY}}." # angular interpolation unable_to_apply_the_coupon_because_disabled: "Unable to apply the coupon: this code was disabled." unable_to_apply_the_coupon_because_expired: "Unable to apply the coupon: this code has expired." unable_to_apply_the_coupon_because_sold_out: "Unable to apply the coupon: this code reached its quota." unable_to_apply_the_coupon_because_already_used: "Unable to apply the coupon: you have already used this code once before." + unable_to_apply_the_coupon_because_amount_exceeded: "Unable to apply the coupon: the discount exceed the total amount of this purchase." + unable_to_apply_the_coupon_because_undefined: "Unable to apply the coupon: an unexpected error occurred, please contact the Fablab's manager." unable_to_apply_the_coupon_because_rejected: "This code does not exists." diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index 9e3c864f5a..fa1cdb010b 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -346,6 +346,10 @@ fr: code: "Code" code_is_required: "Le code est requis." code_must_be_composed_of_capital_letters_digits_and_or_dashes: "Le code doit être composé de lettres majuscules, de chiffres et/ou de tirets." + kind_of_coupon: "Type de réduction" + percentage: "Pourcentage" + amount: "Montant" + amount_off: "Montant de la réduction" percent_off: "Pourcentage de réduction" percent_off_is_required: "Le pourcentage de réduction est requis." percentage_must_be_between_0_and_100: "Le pourcentage doit être compris entre 0 et 100." @@ -364,8 +368,11 @@ fr: i_have_a_coupon: "J'ai un code promo !" code_: "Code :" the_coupon_has_been_applied_you_get_PERCENT_discount: "Le code promo a bien été appliqué. Vous bénéficiez d'une remise de {{PERCENT}} %." # angular interpolation + the_coupon_has_been_applied_you_get_AMOUNT_CURRENCY: "Le code promo a bien été appliqué. Vous bénéficiez d'une remise de {{AMOUNT}} {{CURRENCY}}." # angular interpolation unable_to_apply_the_coupon_because_disabled: "Impossible d'appliquer la réduction : ce code promo a été désactivé." unable_to_apply_the_coupon_because_expired: "Impossible d'appliquer la réduction : ce code promo a expiré." unable_to_apply_the_coupon_because_sold_out: "Impossible d'appliquer la réduction : ce code promo a atteint son quota." unable_to_apply_the_coupon_because_already_used: "Impossible d'appliquer la réduction : vous avez déjà utilisé ce code promo par le passé." + unable_to_apply_the_coupon_because_amount_exceeded: "Impossible d'appliquer la réduction : la réduction dépasse le total de cet achat." + unable_to_apply_the_coupon_because_undefined: "Impossible d'appliquer la réduction : une erreur inattendue s'est produite, veuillez contacter le gestionnaire du Fablab." unable_to_apply_the_coupon_because_rejected: "Ce code promo n'existe pas." \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index cb4689a00d..f30febc5e3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -87,7 +87,7 @@ en: one: "One %{NAME} ticket" other: "%{count} %{NAME} tickets" reservation_other: "Reservation (other)" - coupon_CODE_discount_of_PERCENT: "Coupon %{CODE}: discount of %{PERCENT}%" + coupon_CODE_discount_of_DISCOUNT: "Coupon {CODE}: discount of {DISCOUNT}{TYPE, select, percent_off{%} other{}}" # messageFormat interpolation total_including_all_taxes: "Total incl. all taxes" including_VAT_RATE: "Including VAT %{RATE}%" including_total_excluding_taxes: "Including Total excl. taxes" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index bef046965f..68bb7179cc 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -87,7 +87,7 @@ fr: one: "Une place %{NAME}" other: "%{count} places %{NAME}" reservation_other: "Réservation (autre)" - coupon_CODE_discount_of_PERCENT: "Code %{CODE} : remise de %{PERCENT} %" + coupon_CODE_discount_of_DISCOUNT: "Code {CODE} : remise de {DISCOUNT} {TYPE, select, percent_off{%} other{}}" # messageFormat interpolation total_including_all_taxes: "Total TTC" including_VAT_RATE: "Dont TVA %{RATE}%" including_total_excluding_taxes: "Dont total HT" diff --git a/config/locales/mails.en.yml b/config/locales/mails.en.yml index 38140941f9..56b7901f3c 100644 --- a/config/locales/mails.en.yml +++ b/config/locales/mails.en.yml @@ -278,7 +278,8 @@ en: subject: "Coupon" body: enjoy_a_discount_of_PERCENT_with_code_CODE: "Enjoy a discount of %{PERCENT}% on the whole site with the code %{CODE}." - this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases: "This coupon is valid {USAGE, plural, =1{just once} other{many times}}: for all your purchases, from now {DATE, select, NO-DATE{and without time limit} other{and until {DATE}}}." + enjoy_a_discount_of_AMOUNT_with_code_CODE: "Enjoy a discount of %{AMOUNT} on the whole site with the code %{CODE}." + this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases: "This coupon is valid {USAGE, plural, =1{just once} other{many times}}: for all your purchases {TYPE, select, amount_off{at least equal to the amount of the coupon} other{}}, from now {DATE, select, NO-DATE{and without time limit} other{and until {DATE}}}." shared: hello: "Hello %{user_name}" diff --git a/config/locales/mails.fr.yml b/config/locales/mails.fr.yml index 3efa19f5db..a34aff9c66 100644 --- a/config/locales/mails.fr.yml +++ b/config/locales/mails.fr.yml @@ -278,7 +278,8 @@ fr: subject: "Code promo" body: enjoy_a_discount_of_PERCENT_with_code_CODE: "Bénéficiez d'une remise de %{PERCENT} % sur tout le site en utilisant le code promo %{CODE}." - this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases: "Ce code promo est valable {USAGE, plural, =1{une seule fois} other{plusieurs fois}} : pour tous vos achats, dès maintenant {DATE, select, NO-DATE{et sans limitation de durée} other{et jusqu'au {DATE}}}." + enjoy_a_discount_of_AMOUNT_with_code_CODE: "Bénéficiez d'une remise de %{AMOUNT} sur tout le site en utilisant le code promo %{CODE}." + this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases: "Ce code promo est valable {USAGE, plural, =1{une seule fois} other{plusieurs fois}} : pour tous vos achats {TYPE, select, amount_off{dont le montant est au moins égal à celui du code promo} other{}}, dès maintenant {DATE, select, NO-DATE{et sans limitation de durée} other{et jusqu'au {DATE}}}." shared: hello: "Bonjour %{user_name}" diff --git a/db/migrate/20160830154719_migrate_event_reduced_amount_to_price_category.rb b/db/migrate/20160830154719_migrate_event_reduced_amount_to_price_category.rb index 7d4de61344..dccf986c5c 100644 --- a/db/migrate/20160830154719_migrate_event_reduced_amount_to_price_category.rb +++ b/db/migrate/20160830154719_migrate_event_reduced_amount_to_price_category.rb @@ -28,7 +28,7 @@ def up end def down - pc = PriceCategory.find_by_name(I18n.t('price_category.reduced_fare')) + pc = PriceCategory.find_by(name: I18n.t('price_category.reduced_fare')) EventPriceCategory.where(price_category_id: pc.id).each do |epc| epc.event.update_column(:reduced_amount, epc.amount) diff --git a/db/migrate/20160906145713_insert_custom_aggregations.rb b/db/migrate/20160906145713_insert_custom_aggregations.rb index 1b23072c10..2e28fd5f13 100644 --- a/db/migrate/20160906145713_insert_custom_aggregations.rb +++ b/db/migrate/20160906145713_insert_custom_aggregations.rb @@ -1,7 +1,7 @@ class InsertCustomAggregations < ActiveRecord::Migration def up # available reservations hours for machines - machine = StatisticIndex.find_by_es_type_key('machine') + machine = StatisticIndex.find_by(es_type_key: 'machine') machine_hours = StatisticType.find_by(key: 'hour', statistic_index_id: machine.id) available_hours = StatisticCustomAggregation.new({ @@ -14,7 +14,7 @@ def up available_hours.save! # available training tickets - training = StatisticIndex.find_by_es_type_key('training') + training = StatisticIndex.find_by(es_type_key: 'training') training_bookings = StatisticType.find_by(key: 'booking', statistic_index_id: training.id) available_tickets = StatisticCustomAggregation.new({ @@ -29,12 +29,12 @@ def up def down - machine = StatisticIndex.find_by_es_type_key('machine') + machine = StatisticIndex.find_by(es_type_key: 'machine') machine_hours = StatisticType.find_by(key: 'hour', statistic_index_id: machine.id) StatisticCustomAggregation.where(field: 'available_hours', statistic_type_id: machine_hours.id).first.destroy! - training = StatisticIndex.find_by_es_type_key('training') + training = StatisticIndex.find_by(es_type_key: 'training') training_bookings = StatisticType.find_by(key: 'booking', statistic_index_id: training.id) StatisticCustomAggregation.where(field: 'available_tickets', statistic_type_id: training_bookings.id).first.destroy! diff --git a/db/migrate/20161123104604_add_amount_off_to_coupons.rb b/db/migrate/20161123104604_add_amount_off_to_coupons.rb new file mode 100644 index 0000000000..69346c13f2 --- /dev/null +++ b/db/migrate/20161123104604_add_amount_off_to_coupons.rb @@ -0,0 +1,5 @@ +class AddAmountOffToCoupons < ActiveRecord::Migration + def change + add_column :coupons, :amount_off, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 24d8a73cd4..f42f20eb9c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160915105234) do +ActiveRecord::Schema.define(version: 20161123104604) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -114,6 +114,7 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "validity_per_user" + t.integer "amount_off" end create_table "credits", force: :cascade do |t| @@ -319,6 +320,7 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "profile_url" + t.string "logout_endpoint" end create_table "offer_days", force: :cascade do |t| diff --git a/lib/tasks/fablab.rake b/lib/tasks/fablab.rake index 0ba0837a03..13b0d58909 100644 --- a/lib/tasks/fablab.rake +++ b/lib/tasks/fablab.rake @@ -2,7 +2,7 @@ namespace :fablab do # desc "Get all stripe plans and create in fablab app" # task stripe_plan: :environment do # Stripe::Plan.all.data.each do |plan| - # unless Plan.find_by_stp_plan_id(plan.id) + # unless Plan.find_by(stp_plan_id: plan.id) # group = Group.friendly.find(plan.id.split('-').first) # if group # Plan.create(stp_plan_id: plan.id, name: plan.name, amount: plan.amount, interval: plan.interval, group_id: group.id, skip_create_stripe_plan: true) diff --git a/test/fixtures/availabilities.yml b/test/fixtures/availabilities.yml index 4929a833d2..ba934f8baf 100644 --- a/test/fixtures/availabilities.yml +++ b/test/fixtures/availabilities.yml @@ -159,3 +159,13 @@ availability_16: updated_at: 2016-04-04 15:44:04.023557000 Z nb_total_places: destroying: false + +availability_17: + id: 17 + start_at: <%= 10.days.from_now.utc.change({hour: 10}).strftime('%Y-%m-%d %H:%M:%S.%9N Z') %> + end_at: <%= 12.days.from_now.utc.change({hour: 18}).strftime('%Y-%m-%d %H:%M:%S.%9N Z') %> + available_type: machines + created_at: 2016-04-04 15:44:04.023557000 Z + updated_at: 2016-04-04 15:44:04.023557000 Z + nb_total_places: + destroying: false \ No newline at end of file diff --git a/test/fixtures/coupons.yml b/test/fixtures/coupons.yml index f5eb6d3626..41d78d4f43 100644 --- a/test/fixtures/coupons.yml +++ b/test/fixtures/coupons.yml @@ -17,3 +17,12 @@ two: max_usages: 10 active: true validity_per_user: always + +cash: + name: Cash Code + code: ZERG6H1R65H + amount_off: 10000 + valid_until: <%= 1.year.from_now.utc.strftime('%Y-%m-%d %H:%M:%S.%9N Z') %> + max_usages: 1 + active: true + validity_per_user: once \ No newline at end of file diff --git a/test/fixtures/event_price_categories.yml b/test/fixtures/event_price_categories.yml index e99967bbea..b351fc29e7 100644 --- a/test/fixtures/event_price_categories.yml +++ b/test/fixtures/event_price_categories.yml @@ -11,3 +11,15 @@ two: event_id: 2 price_category_id: 1 amount: 1700 + +radio_youngs: + id: 3 + event_id: 4 + price_category_id: 1 + amount: 7500 + +radio_unemployed: + id: 4 + event_id: 4 + price_category_id: 2 + amount: 8000 \ No newline at end of file diff --git a/test/fixtures/events.yml b/test/fixtures/events.yml index 66268f37e4..72fb6c4fc3 100644 --- a/test/fixtures/events.yml +++ b/test/fixtures/events.yml @@ -41,3 +41,16 @@ event_1: nb_free_places: 10 recurrence_id: 1 category_id: 2 + +event_4: + id: 4 + title: Radio numérique + description: "Confectionnez votre propre récepteur FM compatible avec la radio numérique terrestre (RNT) :\r\n- logiciel + embarqué\r\n- électronique\r\n- démodulation d'ondes porteuses\r\n- conception et réalisation du design" + created_at: 2016-11-28 10:52:50.615611000 Z + updated_at: 2016-11-28 10:52:50.615611000 Z + availability_id: 17 + amount: 10000 + nb_total_places: 10 + nb_free_places: 10 + category_id: 1 \ No newline at end of file diff --git a/test/integration/admins_test.rb b/test/integration/admins_test.rb index 8969b7697e..c37239fd2a 100644 --- a/test/integration/admins_test.rb +++ b/test/integration/admins_test.rb @@ -3,7 +3,7 @@ class AdminsTest < ActionDispatch::IntegrationTest # Called before every test method runs. Can be used # to set up fixture information. def setup - @admin = User.find_by_username('admin') + @admin = User.find_by(username: 'admin') login_as(@admin, scope: :user) end diff --git a/test/integration/availabilities/as_admin_test.rb b/test/integration/availabilities/as_admin_test.rb index 59b17106f3..46c214499e 100644 --- a/test/integration/availabilities/as_admin_test.rb +++ b/test/integration/availabilities/as_admin_test.rb @@ -20,7 +20,7 @@ class AsAdminTest < ActionDispatch::IntegrationTest end test 'get machine availabilities as admin' do - m = Machine.find_by_slug('decoupeuse-vinyle') + m = Machine.find_by(slug: 'decoupeuse-vinyle') get "/api/availabilities/machines/#{m.id}" diff --git a/test/integration/availabilities/as_user_test.rb b/test/integration/availabilities/as_user_test.rb index d616545257..88655fa7e5 100644 --- a/test/integration/availabilities/as_user_test.rb +++ b/test/integration/availabilities/as_user_test.rb @@ -1,11 +1,11 @@ class Availabilities::AsUserTest < ActionDispatch::IntegrationTest setup do - user = User.find_by_username('kdumas') + user = User.find_by(username: 'kdumas') login_as(user, scope: :user) end test 'get machine availabilities as user' do - m = Machine.find_by_slug('decoupeuse-vinyle') + m = Machine.find_by(slug: 'decoupeuse-vinyle') get "/api/availabilities/machines/#{m.id}" diff --git a/test/integration/events/as_admin_test.rb b/test/integration/events/as_admin_test.rb new file mode 100644 index 0000000000..4e2053f7af --- /dev/null +++ b/test/integration/events/as_admin_test.rb @@ -0,0 +1,206 @@ +module Events + class AsAdminTest < ActionDispatch::IntegrationTest + + setup do + admin = User.with_role(:admin).first + login_as(admin, scope: :user) + end + + test 'creation modification reservation and re-modification scenario' do + + # First, we create a new event + post '/api/events', + { + event: { + title: 'OpenLab discovery day', + description: 'A day to discover the Fablab and try its machines and possibilities.', + start_date: 1.week.from_now.utc, + start_time: 1.week.from_now.utc.change({hour: 16}), + end_date: 1.week.from_now.utc, + end_time: 1.week.from_now.utc.change({hour: 20}), + category_id: Category.first.id, + amount: 0 + } + }.to_json, + default_headers + + # Check response format & status + assert_equal 201, response.status, response.body + assert_equal Mime::JSON, response.content_type + + # Check the event was created correctly + event = json_response(response.body) + e = Event.where(id: event[:id]).first + assert_not_nil e, 'Event was not created in database' + + # Check the remaining free places are not defined + assert_nil e.nb_free_places, "Free places shouldn't be defined" + + # Then, modify the event to set a nb of places + put "/api/events/#{e.id}", + { + event: { + title: 'OpenLab discovery day', + description: 'A day to discover the Fablab and try its machines and possibilities.', + start_date: 1.week.from_now.utc, + start_time: 1.week.from_now.utc.change({hour: 16}), + end_date: 1.week.from_now.utc, + end_time: 1.week.from_now.utc.change({hour: 20}), + category_id: Category.first.id, + amount: 0, + nb_total_places: 10 + } + } + + # Check response format & status + assert_equal 200, response.status, response.body + assert_equal Mime::JSON, response.content_type + + # Check the places numbers were updated successfully + e = Event.where(id: event[:id]).first + assert_equal 10, e.nb_total_places, 'Total number of places was not updated' + assert_equal 10, e.nb_free_places, 'Number of free places was not updated' + + # Now, let's make a reservation on this event + post '/api/reservations', + { + reservation: { + user_id: User.find_by(username: 'pdurand').id, + reservable_id: e.id, + reservable_type: 'Event', + nb_reserve_places: 2, + slots_attributes: [ + { + start_at: e.availability.start_at, + end_at: e.availability.end_at, + availability_id: e.availability.id, + offered: false + } + ] + } + }.to_json, + default_headers + + # Check response format & status + assert_equal 201, response.status, response.body + assert_equal Mime::JSON, response.content_type + + # Check the remaining places were updated successfully + e = Event.where(id: event[:id]).first + assert_equal 8, e.nb_free_places, 'Number of free places was not updated' + + # Finally, modify the event to add some places + put "/api/events/#{e.id}", + { + event: { + title: 'OpenLab discovery day', + description: 'A day to discover the Fablab and try its machines and possibilities.', + start_date: 1.week.from_now.utc, + start_time: 1.week.from_now.utc.change({hour: 16}), + end_date: 1.week.from_now.utc, + end_time: 1.week.from_now.utc.change({hour: 20}), + category_id: Category.first.id, + amount: 0, + nb_total_places: 20 + } + } + + # Check response format & status + assert_equal 200, response.status, response.body + assert_equal Mime::JSON, response.content_type + + # Check the places numbers were updated successfully + e = Event.where(id: event[:id]).first + assert_equal 20, e.nb_total_places, 'Total number of places was not updated' + assert_equal 18, e.nb_free_places, 'Number of free places was not updated' + end + + test 'create event with custom price and reserve it with success' do + + price_category = PriceCategory.first + + # First, we create a new event + post '/api/events', + { + event: { + title: 'Electronics initiation', + description: 'A workshop about electronics and the abilities to create robots.', + start_date: 1.week.from_now.utc + 2.days, + start_time: 1.week.from_now.utc.change({hour: 18}) + 2.days, + end_date: 1.week.from_now.utc + 2.days, + end_time: 1.week.from_now.utc.change({hour: 22}) + 2.days, + category_id: Category.last.id, + amount: 20, + nb_total_places: 10, + event_price_categories_attributes: [ + { + price_category_id: price_category.id.to_s, + amount: 16.to_s + } + ] + } + }.to_json, + default_headers + + # Check response format & status + assert_equal 201, response.status, response.body + assert_equal Mime::JSON, response.content_type + + # Check the event was created correctly + event = json_response(response.body) + e = Event.where(id: event[:id]).first + assert_not_nil e, 'Event was not created in database' + + # Check the places numbers were set successfully + e = Event.where(id: event[:id]).first + assert_equal 10, e.nb_total_places, 'Total number of places was not updated' + assert_equal 10, e.nb_free_places, 'Number of free places was not updated' + + # Now, let's make a reservation on this event + post '/api/reservations', + { + reservation: { + user_id: User.find_by(username: 'lseguin').id, + reservable_id: e.id, + reservable_type: 'Event', + nb_reserve_places: 4, + slots_attributes: [ + { + start_at: e.availability.start_at, + end_at: e.availability.end_at, + availability_id: e.availability.id, + offered: false + } + ], + tickets_attributes: [ + { + event_price_category_id: e.event_price_categories.first.id, + booked: 4 + } + ] + } + }.to_json, + default_headers + + # Check response format & status + assert_equal 201, response.status, response.body + assert_equal Mime::JSON, response.content_type + + # Check the reservation match the required event + reservation = json_response(response.body) + r = Reservation.find(reservation[:id]) + + assert_equal e.id, r.reservable_id + assert_equal 'Event', r.reservable_type + + # Check the remaining places were updated successfully + e = Event.where(id: event[:id]).first + assert_equal 2, e.nb_free_places, 'Number of free places was not updated' + + # Check the resulting invoice generation and it has right price + assert_invoice_pdf r.invoice + assert_equal (4 * 20) + (4 * 16), r.invoice.total / 100.0 + + end + end +end \ No newline at end of file diff --git a/test/integration/events/as_user_test.rb b/test/integration/events/as_user_test.rb new file mode 100644 index 0000000000..8b32e4fcaa --- /dev/null +++ b/test/integration/events/as_user_test.rb @@ -0,0 +1,103 @@ +module Events + class AsUserTest < ActionDispatch::IntegrationTest + + test 'reserve event with many prices and payment means' do + + vlonchamp = User.find_by(username: 'vlonchamp') + login_as(vlonchamp, scope: :user) + + radio = Event.find(4) + availability = radio.availability + + reservations_count = Reservation.count + invoice_count = Invoice.count + invoice_items_count = InvoiceItem.count + users_credit_count = UsersCredit.count + wallet_transactions_count = WalletTransaction.count + + # Reserve the 'radio' event + VCR.use_cassette('reserve_event_with_many_prices_and_payment_means') do + post reservations_path, { + reservation: { + user_id: User.find_by(username: 'vlonchamp').id, + reservable_id: radio.id, + reservable_type: 'Event', + nb_reserve_places: 2, + card_token: stripe_card_token, + slots_attributes: [ + { + start_at: availability.start_at, + end_at: availability.end_at, + availability_id: availability.id, + offered: false + } + ], + tickets_attributes: [ + { + event_price_category_id: radio.event_price_categories[0].id, + booked: 2 + }, + { + event_price_category_id: radio.event_price_categories[1].id, + booked: 2 + } + ] + }, + coupon_code: 'SUNNYFABLAB' + }.to_json, default_headers + end + + # general assertions + assert_equal 201, response.status + assert_equal reservations_count + 1, Reservation.count + assert_equal invoice_count + 1, Invoice.count + assert_equal invoice_items_count + 1, InvoiceItem.count + assert_equal users_credit_count, UsersCredit.count + assert_equal wallet_transactions_count + 1, WalletTransaction.count + + # reservation assertions + reservation = Reservation.last + + assert reservation.invoice + refute reservation.stp_invoice_id.blank? + assert_equal 1, reservation.invoice.invoice_items.count + + # invoice assertions + invoice = reservation.invoice + + refute invoice.stp_invoice_id.blank? + refute invoice.total.blank? + assert_equal 43350, invoice.total # total minus coupon + + # invoice_items assertions + ## reservation + reservation_item = invoice.invoice_items.first + + assert_not_nil reservation_item + assert reservation_item.stp_invoice_item_id + assert_equal 51000, reservation_item.amount # full total + + # invoice assertions + invoice = Invoice.find_by(invoiced: reservation) + assert_invoice_pdf invoice + + VCR.use_cassette('reserve_event_with_many_prices_and_payment_means_retrieve_invoice_from_stripe') do + stp_invoice = Stripe::Invoice.retrieve(invoice.stp_invoice_id) + assert_equal stp_invoice.total, (invoice.total - invoice.wallet_amount) # total minus coupon minus wallet = amount really payed by the user + end + + # wallet assertions + assert_equal vlonchamp.wallet.amount, 0 + assert_equal vlonchamp.wallet.wallet_transactions.count, 2 + transaction = vlonchamp.wallet.wallet_transactions.last + assert_equal transaction.transaction_type, 'debit' + assert_equal transaction.amount, 10 + assert_equal transaction.amount, invoice.wallet_amount / 100.0 + + # notifications + assert_not_empty Notification.where(attached_object: reservation) + assert_not_empty Notification.where(attached_object: invoice) + + end + end +end \ No newline at end of file diff --git a/test/integration/events_test.rb b/test/integration/events_test.rb deleted file mode 100644 index f15c69f8d6..0000000000 --- a/test/integration/events_test.rb +++ /dev/null @@ -1,204 +0,0 @@ -class EventsTest < ActionDispatch::IntegrationTest - - setup do - admin = User.with_role(:admin).first - login_as(admin, scope: :user) - end - - test 'creation modification reservation and re-modification scenario' do - - # First, we create a new event - post '/api/events', - { - event: { - title: 'OpenLab discovery day', - description: 'A day to discover the Fablab and try its machines and possibilities.', - start_date: 1.week.from_now.utc, - start_time: 1.week.from_now.utc.change({hour: 16}), - end_date: 1.week.from_now.utc, - end_time: 1.week.from_now.utc.change({hour: 20}), - category_id: Category.first.id, - amount: 0 - } - }.to_json, - default_headers - - # Check response format & status - assert_equal 201, response.status, response.body - assert_equal Mime::JSON, response.content_type - - # Check the event was created correctly - event = json_response(response.body) - e = Event.where(id: event[:id]).first - assert_not_nil e, 'Event was not created in database' - - # Check the remaining free places are not defined - assert_nil e.nb_free_places, "Free places shouldn't be defined" - - # Then, modify the event to set a nb of places - put "/api/events/#{e.id}", - { - event: { - title: 'OpenLab discovery day', - description: 'A day to discover the Fablab and try its machines and possibilities.', - start_date: 1.week.from_now.utc, - start_time: 1.week.from_now.utc.change({hour: 16}), - end_date: 1.week.from_now.utc, - end_time: 1.week.from_now.utc.change({hour: 20}), - category_id: Category.first.id, - amount: 0, - nb_total_places: 10 - } - } - - # Check response format & status - assert_equal 200, response.status, response.body - assert_equal Mime::JSON, response.content_type - - # Check the places numbers were updated successfully - e = Event.where(id: event[:id]).first - assert_equal 10, e.nb_total_places, 'Total number of places was not updated' - assert_equal 10, e.nb_free_places, 'Number of free places was not updated' - - # Now, let's make a reservation on this event - post '/api/reservations', - { - reservation: { - user_id: User.find_by_username('pdurand').id, - reservable_id: e.id, - reservable_type: 'Event', - nb_reserve_places: 2, - slots_attributes: [ - { - start_at: e.availability.start_at, - end_at: e.availability.end_at, - availability_id: e.availability.id, - offered: false - } - ] - } - }.to_json, - default_headers - - # Check response format & status - assert_equal 201, response.status, response.body - assert_equal Mime::JSON, response.content_type - - # Check the remaining places were updated successfully - e = Event.where(id: event[:id]).first - assert_equal 8, e.nb_free_places, 'Number of free places was not updated' - - # Finally, modify the event to add some places - put "/api/events/#{e.id}", - { - event: { - title: 'OpenLab discovery day', - description: 'A day to discover the Fablab and try its machines and possibilities.', - start_date: 1.week.from_now.utc, - start_time: 1.week.from_now.utc.change({hour: 16}), - end_date: 1.week.from_now.utc, - end_time: 1.week.from_now.utc.change({hour: 20}), - category_id: Category.first.id, - amount: 0, - nb_total_places: 20 - } - } - - # Check response format & status - assert_equal 200, response.status, response.body - assert_equal Mime::JSON, response.content_type - - # Check the places numbers were updated successfully - e = Event.where(id: event[:id]).first - assert_equal 20, e.nb_total_places, 'Total number of places was not updated' - assert_equal 18, e.nb_free_places, 'Number of free places was not updated' - end - - test 'create event with custom price and reserve it with success' do - - price_category = PriceCategory.first - - # First, we create a new event - post '/api/events', - { - event: { - title: 'Electronics initiation', - description: 'A workshop about electronics and the abilities to create robots.', - start_date: 1.week.from_now.utc + 2.days, - start_time: 1.week.from_now.utc.change({hour: 18}) + 2.days, - end_date: 1.week.from_now.utc + 2.days, - end_time: 1.week.from_now.utc.change({hour: 22}) + 2.days, - category_id: Category.last.id, - amount: 20, - nb_total_places: 10, - event_price_categories_attributes: [ - { - price_category_id: price_category.id.to_s, - amount: 16.to_s - } - ] - } - }.to_json, - default_headers - - # Check response format & status - assert_equal 201, response.status, response.body - assert_equal Mime::JSON, response.content_type - - # Check the event was created correctly - event = json_response(response.body) - e = Event.where(id: event[:id]).first - assert_not_nil e, 'Event was not created in database' - - # Check the places numbers were set successfully - e = Event.where(id: event[:id]).first - assert_equal 10, e.nb_total_places, 'Total number of places was not updated' - assert_equal 10, e.nb_free_places, 'Number of free places was not updated' - - # Now, let's make a reservation on this event - post '/api/reservations', - { - reservation: { - user_id: User.find_by_username('lseguin').id, - reservable_id: e.id, - reservable_type: 'Event', - nb_reserve_places: 4, - slots_attributes: [ - { - start_at: e.availability.start_at, - end_at: e.availability.end_at, - availability_id: e.availability.id, - offered: false - } - ], - tickets_attributes: [ - { - event_price_category_id: e.event_price_categories.first.id, - booked: 4 - } - ] - } - }.to_json, - default_headers - - # Check response format & status - assert_equal 201, response.status, response.body - assert_equal Mime::JSON, response.content_type - - # Check the reservation match the required event - reservation = json_response(response.body) - r = Reservation.find(reservation[:id]) - - assert_equal e.id, r.reservable_id - assert_equal 'Event', r.reservable_type - - # Check the remaining places were updated successfully - e = Event.where(id: event[:id]).first - assert_equal 2, e.nb_free_places, 'Number of free places was not updated' - - # Check the resulting invoice generation and it has right price - assert_invoice_pdf r.invoice - assert_equal (4 * 20) + (4 * 16), r.invoice.total / 100.0 - - end -end diff --git a/test/integration/subscriptions/create_as_admin_test.rb b/test/integration/subscriptions/create_as_admin_test.rb index c23e3ccd4f..c0cee90c91 100644 --- a/test/integration/subscriptions/create_as_admin_test.rb +++ b/test/integration/subscriptions/create_as_admin_test.rb @@ -3,12 +3,12 @@ class CreateAsAdminTest < ActionDispatch::IntegrationTest setup do - @admin = User.find_by_username('admin') + @admin = User.find_by(username: 'admin') login_as(@admin, scope: :user) end test "admin successfully takes a subscription for a user" do - user = User.find_by_username('jdupond') + user = User.find_by(username: 'jdupond') plan = Plan.find_by(group_id: user.group.id, type: 'Plan', base_name: 'Mensuel') VCR.use_cassette("subscriptions_admin_create_success") do @@ -40,7 +40,7 @@ class CreateAsAdminTest < ActionDispatch::IntegrationTest assert_equal user.subscription.plan.training_credit_nb, plan.training_credit_nb, 'trainings credits were not allocated' # Check that the user benefit from prices of his plan - printer = Machine.find_by_slug('imprimante-3d') + printer = Machine.find_by(slug: 'imprimante-3d') assert_equal 15, (printer.prices.find_by(group_id: user.group_id, plan_id: user.subscription.plan_id).amount / 100), 'machine hourly price does not match' # Check notification was sent to the user diff --git a/test/integration/subscriptions/create_as_user_test.rb b/test/integration/subscriptions/create_as_user_test.rb index f9c8d32fc9..5060eeb3d1 100644 --- a/test/integration/subscriptions/create_as_user_test.rb +++ b/test/integration/subscriptions/create_as_user_test.rb @@ -2,7 +2,7 @@ class Subscriptions::CreateAsUserTest < ActionDispatch::IntegrationTest setup do - @user = User.find_by_username('jdupond') + @user = User.find_by(username: 'jdupond') login_as(@user, scope: :user) end @@ -38,7 +38,7 @@ class Subscriptions::CreateAsUserTest < ActionDispatch::IntegrationTest assert_equal @user.subscription.plan.training_credit_nb, plan.training_credit_nb, 'trainings credits were not allocated' # Check that the user benefit from prices of his plan - printer = Machine.find_by_slug('imprimante-3d') + printer = Machine.find_by(slug: 'imprimante-3d') assert_equal 15, (printer.prices.find_by(group_id: @user.group_id, plan_id: @user.subscription.plan_id).amount / 100), 'machine hourly price does not match' # Check notifications were sent for every admins @@ -118,7 +118,7 @@ class Subscriptions::CreateAsUserTest < ActionDispatch::IntegrationTest assert_equal @vlonchamp.subscription.plan.training_credit_nb, plan.training_credit_nb, 'trainings credits were not allocated' # Check that the user benefit from prices of his plan - printer = Machine.find_by_slug('imprimante-3d') + printer = Machine.find_by(slug: 'imprimante-3d') assert_equal 10, (printer.prices.find_by(group_id: @vlonchamp.group_id, plan_id: @vlonchamp.subscription.plan_id).amount / 100), 'machine hourly price does not match' # Check notifications were sent for every admins diff --git a/test/integration/subscriptions/renew_as_admin_test.rb b/test/integration/subscriptions/renew_as_admin_test.rb index 1253aca407..e5006036fb 100644 --- a/test/integration/subscriptions/renew_as_admin_test.rb +++ b/test/integration/subscriptions/renew_as_admin_test.rb @@ -1,13 +1,13 @@ class Subscriptions::RenewAsAdminTest < ActionDispatch::IntegrationTest setup do - @admin = User.find_by_username('admin') + @admin = User.find_by(username: 'admin') login_as(@admin, scope: :user) end test 'admin successfully renew a subscription before it has ended' do - user = User.find_by_username('kdumas') + user = User.find_by(username: 'kdumas') plan = Plan.find_by(base_name: 'Mensuel tarif réduit') VCR.use_cassette("subscriptions_admin_renew_success") do @@ -38,7 +38,7 @@ class Subscriptions::RenewAsAdminTest < ActionDispatch::IntegrationTest assert_equal user.subscription.plan.training_credit_nb, plan.training_credit_nb, 'trainings credits were not allocated' # Check that the user benefit from prices of his plan - printer = Machine.find_by_slug('imprimante-3d') + printer = Machine.find_by(slug: 'imprimante-3d') assert_equal 10, (printer.prices.find_by(group_id: user.group_id, plan_id: user.subscription.plan_id).amount / 100), 'machine hourly price does not match' # Check notification was sent to the user diff --git a/test/integration/subscriptions/renew_as_user_test.rb b/test/integration/subscriptions/renew_as_user_test.rb index 4c4cf5457e..3d0feb6cbd 100644 --- a/test/integration/subscriptions/renew_as_user_test.rb +++ b/test/integration/subscriptions/renew_as_user_test.rb @@ -2,7 +2,7 @@ class Subscriptions::RenewAsUserTest < ActionDispatch::IntegrationTest setup do - @user = User.find_by_username('lseguin') + @user = User.find_by(username: 'lseguin') login_as(@user, scope: :user) end diff --git a/test/integration/wallets_test.rb b/test/integration/wallets_test.rb index bc9c89aacf..19a68a1fa2 100644 --- a/test/integration/wallets_test.rb +++ b/test/integration/wallets_test.rb @@ -24,7 +24,7 @@ def teardown end test 'admin can get wallet by user id' do - @admin = User.find_by_username('admin') + @admin = User.find_by(username: 'admin') login_as(@admin, scope: :user) @user1 = User.first get "/api/wallet/by_user/#{@user1.id}" diff --git a/test/models/coupon_test.rb b/test/models/coupon_test.rb index 4ccdc535e5..f1cef7ee76 100644 --- a/test/models/coupon_test.rb +++ b/test/models/coupon_test.rb @@ -7,12 +7,22 @@ class CouponTest < ActiveSupport::TestCase end test 'expired coupon must return the proper status' do - c = Coupon.find_by_code('XMAS10') - assert c.status == 'expired' + c = Coupon.find_by(code: 'XMAS10') + assert_equal 'expired', c.status end test 'two coupons cannot have the same code' do c = Coupon.new({name: 'Summer deals', code: 'SUNNYFABLAB', percent_off: 15, validity_per_user: 'always'}) assert c.invalid? end + + test 'coupon with cash amount has amount_off type' do + c = Coupon.new({name: 'Essential Box', code: 'KWXX2M', amount_off: 2000, validity_per_user: 'once', max_usages: 1}) + assert_equal 'amount_off', c.type + end + + test 'coupon with cash amount cannot be used with cheaper cart' do + c = Coupon.new({name: 'Premium Box', code: '6DDX2T44MQ', amount_off: 20000, validity_per_user: 'once', max_usages: 1, active: true}) + assert_equal 'amount_exceeded', c.status(User.find_by(username: 'jdupond').id, 2000) + end end diff --git a/test/services/coupon_service_test.rb b/test/services/coupon_service_test.rb new file mode 100644 index 0000000000..884145caa9 --- /dev/null +++ b/test/services/coupon_service_test.rb @@ -0,0 +1,28 @@ +require 'test_helper' + +class CouponServiceTest < ActiveSupport::TestCase + setup do + @jdupond = User.find_by(username: 'jdupond') + @cash_coupon = Coupon.find_by(code: 'ZERG6H1R65H') + end + + test 'user apply percent coupon to cart' do + total = CouponService.new.apply(1000, 'SUNNYFABLAB', @jdupond.id) + assert_equal 850, total + end + + test 'user cannot apply excessive coupon to cart' do + total = CouponService.new.apply(1000, @cash_coupon, @jdupond.id) + assert_equal 1000, total + end + + test 'user cannot apply invalid coupon to cart' do + total = CouponService.new.apply(1000, 'INVALIDCODE', @jdupond.id) + assert_equal 1000, total + end + + test 'user cannot apply expired coupon to cart' do + total = CouponService.new.apply(1000, 'XMAS10', @jdupond.id) + assert_equal 1000, total + end +end 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 index b41abceb07..b9a3471f82 100644 --- a/test/vcr_cassettes/reservations_create_for_machine_with_subscription_success.yml +++ b/test/vcr_cassettes/reservations_create_for_machine_with_subscription_success.yml @@ -19,8 +19,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '81' response: @@ -90,7 +90,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 15:22:24 GMT - request: method: post @@ -111,8 +111,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '122' response: @@ -170,7 +170,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 15:22:25 GMT - request: method: post @@ -191,8 +191,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '125' response: @@ -250,7 +250,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 15:22:26 GMT - request: method: get @@ -271,8 +271,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -336,7 +336,7 @@ http_interactions: "url": "/v1/customers/cus_8CzKe50I0J1gaI/subscriptions" } } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 15:22:26 GMT - request: method: post @@ -357,8 +357,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '33' response: @@ -420,7 +420,7 @@ http_interactions: "name": null, "tokenization_method": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 15:22:27 GMT - request: method: post @@ -441,8 +441,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '27' response: @@ -557,7 +557,7 @@ http_interactions: "total": 1000, "webhooks_delivered_at": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 15:22:28 GMT - request: method: post @@ -578,8 +578,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '0' response: @@ -694,7 +694,7 @@ http_interactions: "total": 1000, "webhooks_delivered_at": 1459956148 } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 15:22:29 GMT - request: method: delete @@ -715,8 +715,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -755,6 +755,6 @@ http_interactions: "deleted": true, "id": "card_17xIU82sOmf47Nz94aVn3WmU" } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 15:22:30 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 index 47be47a368..c227a4456e 100644 --- a/test/vcr_cassettes/reservations_create_for_machine_without_subscription_success.yml +++ b/test/vcr_cassettes/reservations_create_for_machine_without_subscription_success.yml @@ -19,8 +19,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '81' response: @@ -90,7 +90,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 14:02:58 GMT - request: method: post @@ -111,8 +111,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '125' response: @@ -170,7 +170,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 14:02:58 GMT - request: method: get @@ -191,8 +191,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -349,7 +349,7 @@ http_interactions: "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" } } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 14:02:59 GMT - request: method: post @@ -370,8 +370,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '33' response: @@ -433,7 +433,7 @@ http_interactions: "name": null, "tokenization_method": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 14:03:00 GMT - request: method: post @@ -454,8 +454,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '44' response: @@ -639,7 +639,7 @@ http_interactions: "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" } } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 14:03:01 GMT - request: method: post @@ -660,8 +660,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '27' response: @@ -757,7 +757,7 @@ http_interactions: "total": 3200, "webhooks_delivered_at": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 14:03:02 GMT - request: method: post @@ -778,8 +778,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '0' response: @@ -875,7 +875,7 @@ http_interactions: "total": 3200, "webhooks_delivered_at": 1459951382 } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 14:03:03 GMT - request: method: delete @@ -896,8 +896,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -936,6 +936,6 @@ http_interactions: "deleted": true, "id": "card_17xHFG2sOmf47Nz95yErDQbL" } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 14:03:04 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 index c4fbf5854b..2ea2da5f81 100644 --- 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 @@ -19,8 +19,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '81' response: @@ -90,7 +90,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:41 GMT - request: method: post @@ -111,8 +111,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '122' response: @@ -170,7 +170,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:42 GMT - request: method: post @@ -191,8 +191,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '78' response: @@ -250,7 +250,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:43 GMT - request: method: get @@ -271,8 +271,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -364,7 +364,7 @@ http_interactions: bnVsbAogICAgICB9CiAgICBdLAogICAgImhhc19tb3JlIjogZmFsc2UsCiAg ICAidG90YWxfY291bnQiOiAxLAogICAgInVybCI6ICIvdjEvY3VzdG9tZXJz L2N1c184Q3pOdE0wOE5WbFNHTi9zdWJzY3JpcHRpb25zIgogIH0KfQo= - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:44 GMT - request: method: get @@ -385,8 +385,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -478,7 +478,7 @@ http_interactions: bnVsbAogICAgICB9CiAgICBdLAogICAgImhhc19tb3JlIjogZmFsc2UsCiAg ICAidG90YWxfY291bnQiOiAxLAogICAgInVybCI6ICIvdjEvY3VzdG9tZXJz L2N1c184Q3pOdE0wOE5WbFNHTi9zdWJzY3JpcHRpb25zIgogIH0KfQo= - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:45 GMT - request: method: post @@ -499,8 +499,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '90' response: @@ -558,7 +558,7 @@ http_interactions: MSwKICAic3RhcnQiOiAxNDY5MTA4NzQ1LAogICJzdGF0dXMiOiAiYWN0aXZl IiwKICAidGF4X3BlcmNlbnQiOiBudWxsLAogICJ0cmlhbF9lbmQiOiBudWxs LAogICJ0cmlhbF9zdGFydCI6IG51bGwKfQo= - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:46 GMT - request: method: get @@ -579,8 +579,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -692,7 +692,7 @@ http_interactions: bCI6IDEwMDAsCiAgICAgICJ3ZWJob29rc19kZWxpdmVyZWRfYXQiOiAxNDY5 MTA4NzQ2CiAgICB9CiAgXSwKICAiaGFzX21vcmUiOiB0cnVlLAogICJ1cmwi OiAiL3YxL2ludm9pY2VzIgp9Cg== - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:47 GMT - request: method: get @@ -713,8 +713,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -832,7 +832,7 @@ http_interactions: IjogZmFsc2UsCiAgICAidG90YWxfY291bnQiOiAyLAogICAgInVybCI6ICIv djEvY3VzdG9tZXJzL2N1c184Q3pOdE0wOE5WbFNHTi9zdWJzY3JpcHRpb25z IgogIH0KfQo= - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:48 GMT - request: method: get @@ -853,8 +853,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -910,7 +910,7 @@ http_interactions: MSwKICAic3RhcnQiOiAxNDY5MTA4NzQ1LAogICJzdGF0dXMiOiAiYWN0aXZl IiwKICAidGF4X3BlcmNlbnQiOiBudWxsLAogICJ0cmlhbF9lbmQiOiBudWxs LAogICJ0cmlhbF9zdGFydCI6IG51bGwKfQo= - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:49 GMT - request: method: delete @@ -931,8 +931,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -988,7 +988,7 @@ http_interactions: dHkiOiAxLAogICJzdGFydCI6IDE0NjkxMDg3NDUsCiAgInN0YXR1cyI6ICJh Y3RpdmUiLAogICJ0YXhfcGVyY2VudCI6IG51bGwsCiAgInRyaWFsX2VuZCI6 IG51bGwsCiAgInRyaWFsX3N0YXJ0IjogbnVsbAp9Cg== - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:50 GMT - request: method: get @@ -1009,8 +1009,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -1066,7 +1066,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:50 GMT - request: method: get @@ -1087,8 +1087,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin15","engine":"ruby","publisher":"stripe","uname":"Darwin - mbp-sleede-peng.home 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 - PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"mbp-sleede-peng.home"}' + integration 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 + PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -1144,6 +1144,6 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 21 Jul 2016 13:45:51 GMT recorded_with: VCR 3.0.1 diff --git a/test/vcr_cassettes/reservations_create_for_training_with_subscription_success.yml b/test/vcr_cassettes/reservations_create_for_training_with_subscription_success.yml index 0e3f2a47aa..80f07de117 100644 --- a/test/vcr_cassettes/reservations_create_for_training_with_subscription_success.yml +++ b/test/vcr_cassettes/reservations_create_for_training_with_subscription_success.yml @@ -19,8 +19,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '81' response: @@ -90,7 +90,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:06:59 GMT - request: method: post @@ -111,8 +111,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '123' response: @@ -170,7 +170,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:07:00 GMT - request: method: get @@ -191,8 +191,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -256,7 +256,7 @@ http_interactions: "url": "/v1/customers/cus_8CzKe50I0J1gaI/subscriptions" } } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:07:01 GMT - request: method: post @@ -277,8 +277,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '27' response: @@ -374,7 +374,7 @@ http_interactions: "total": 0, "webhooks_delivered_at": null } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:07:02 GMT - request: method: post @@ -395,8 +395,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '0' response: @@ -492,6 +492,6 @@ http_interactions: "total": 0, "webhooks_delivered_at": 1460041623 } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:07:04 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 index a90e48296c..6cc2a2bc15 100644 --- a/test/vcr_cassettes/reservations_create_for_training_without_subscription_success.yml +++ b/test/vcr_cassettes/reservations_create_for_training_without_subscription_success.yml @@ -19,8 +19,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '81' response: @@ -90,7 +90,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:02:21 GMT - request: method: post @@ -111,8 +111,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '126' response: @@ -170,7 +170,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:02:22 GMT - request: method: get @@ -191,8 +191,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -351,7 +351,7 @@ http_interactions: ICAgICAgfQogICAgXSwKICAgICJoYXNfbW9yZSI6IGZhbHNlLAogICAgInRv dGFsX2NvdW50IjogNCwKICAgICJ1cmwiOiAiL3YxL2N1c3RvbWVycy9jdXNf OERpMXdqZFZrdHY1a3Qvc3Vic2NyaXB0aW9ucyIKICB9Cn0K - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:02:23 GMT - request: method: post @@ -372,8 +372,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '33' response: @@ -435,7 +435,7 @@ http_interactions: "name": null, "tokenization_method": null } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:02:24 GMT - request: method: post @@ -456,8 +456,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '44' response: @@ -634,7 +634,7 @@ http_interactions: IjogbnVsbAogICAgICB9CiAgICBdLAogICAgImhhc19tb3JlIjogZmFsc2Us CiAgICAidG90YWxfY291bnQiOiA0LAogICAgInVybCI6ICIvdjEvY3VzdG9t ZXJzL2N1c184RGkxd2pkVmt0djVrdC9zdWJzY3JpcHRpb25zIgogIH0KfQo= - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:02:25 GMT - request: method: post @@ -655,8 +655,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '27' response: @@ -752,7 +752,7 @@ http_interactions: "total": 5100, "webhooks_delivered_at": null } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:02:26 GMT - request: method: post @@ -773,8 +773,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' Content-Length: - '0' response: @@ -870,7 +870,7 @@ http_interactions: "total": 5100, "webhooks_delivered_at": 1460041346 } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:02:27 GMT - request: method: delete @@ -891,8 +891,8 @@ http_interactions: - application/x-www-form-urlencoded X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-darwin14","engine":"ruby","publisher":"stripe","uname":"Darwin - MBP-sleede-Nicolas.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 - PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"MBP-sleede-Nicolas.local"}' + integration 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 + PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64","hostname":"integration"}' response: status: code: 200 @@ -931,6 +931,6 @@ http_interactions: "deleted": true, "id": "card_17xeeH2sOmf47Nz9qkD2jaiS" } - http_version: + http_version: recorded_at: Thu, 07 Apr 2016 15:02:28 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 index 9a9a8da5e1..6593ec84e9 100644 --- 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 @@ -20,7 +20,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -184,6 +184,6 @@ http_interactions: "total": 3825, "webhooks_delivered_at": 1473321652 } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:25:04 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 index 8d24dd2dbc..57caca9de2 100644 --- a/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml +++ b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml @@ -20,7 +20,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '81' response: @@ -90,7 +90,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:47 GMT - request: method: post @@ -112,7 +112,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '129' response: @@ -170,7 +170,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:48 GMT - request: method: post @@ -192,7 +192,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '83' response: @@ -250,7 +250,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:49 GMT - request: method: get @@ -272,7 +272,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -362,7 +362,7 @@ http_interactions: "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" } } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:49 GMT - request: method: get @@ -384,7 +384,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -474,7 +474,7 @@ http_interactions: "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" } } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:50 GMT - request: method: post @@ -496,7 +496,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '83' response: @@ -554,7 +554,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:51 GMT - request: method: post @@ -576,7 +576,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '78' response: @@ -648,7 +648,7 @@ http_interactions: "trial_end": null, "trial_start": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:53 GMT - request: method: get @@ -670,7 +670,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -841,7 +841,7 @@ http_interactions: "has_more": true, "url": "/v1/invoices" } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:53 GMT - request: method: get @@ -863,7 +863,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -989,7 +989,7 @@ http_interactions: "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" } } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:54 GMT - request: method: get @@ -1011,7 +1011,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -1081,7 +1081,7 @@ http_interactions: "trial_end": null, "trial_start": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:55 GMT - request: method: delete @@ -1103,7 +1103,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -1173,7 +1173,7 @@ http_interactions: "trial_end": null, "trial_start": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:57 GMT - request: method: get @@ -1195,7 +1195,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -1251,7 +1251,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:58 GMT - request: method: get @@ -1273,7 +1273,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -1329,6 +1329,6 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 08:00:58 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 index 6b3432d1ef..d70f98432c 100644 --- a/test/vcr_cassettes/reservations_training_with_expired_coupon_error.yml +++ b/test/vcr_cassettes/reservations_training_with_expired_coupon_error.yml @@ -20,7 +20,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '81' response: @@ -90,7 +90,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:45:30 GMT - request: method: post @@ -112,7 +112,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '130' response: @@ -170,7 +170,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:45:31 GMT - request: method: post @@ -192,7 +192,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '78' response: @@ -250,7 +250,7 @@ http_interactions: "quantity": null, "subscription": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:45:32 GMT - request: method: get @@ -272,7 +272,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -398,7 +398,7 @@ http_interactions: "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" } } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:45:33 GMT - request: method: post @@ -420,7 +420,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '33' response: @@ -482,7 +482,7 @@ http_interactions: "name": null, "tokenization_method": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:45:34 GMT - request: method: post @@ -504,7 +504,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '44' response: @@ -657,7 +657,7 @@ http_interactions: "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" } } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:45:35 GMT - request: method: post @@ -679,7 +679,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '27' response: @@ -794,7 +794,7 @@ http_interactions: "total": 4590, "webhooks_delivered_at": null } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:45:36 GMT - request: method: post @@ -816,7 +816,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' Content-Length: - '0' response: @@ -931,7 +931,7 @@ http_interactions: "total": 4590, "webhooks_delivered_at": 1473338736 } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:45:37 GMT - request: method: delete @@ -953,7 +953,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu - 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -992,6 +992,6 @@ http_interactions: "deleted": true, "id": "card_18rRuI2sOmf47Nz9TSeEZ96o" } - http_version: + http_version: recorded_at: Thu, 08 Sep 2016 12:45:38 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 new file mode 100644 index 0000000000..6a007d4981 --- /dev/null +++ b/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means.yml @@ -0,0 +1,954 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/tokens + body: + encoding: UTF-8 + string: card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2017&card[cvc]=314 + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '81' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:21 GMT + Content-Type: + - application/json + Content-Length: + - '779' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4YKniSPeMq2N + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "tok_19KmOv2sOmf47Nz90KKaBGgJ", + "object": "token", + "card": { + "id": "card_19KmOv2sOmf47Nz94YYaGGHa", + "object": "card", + "address_city": null, + "address_country": null, + "address_line1": null, + "address_line1_check": null, + "address_line2": null, + "address_state": null, + "address_zip": null, + "address_zip_check": null, + "brand": "Visa", + "country": "US", + "cvc_check": "unchecked", + "dynamic_last4": null, + "exp_month": 4, + "exp_year": 2017, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "last4": "4242", + "metadata": {}, + "name": null, + "tokenization_method": null + }, + "client_ip": "90.52.237.73", + "created": 1480329021, + "livemode": false, + "type": "card", + "used": false + } + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:21 GMT +- request: + method: post + uri: https://api.stripe.com/v1/invoiceitems + body: + encoding: UTF-8 + string: customer=cus_8CzNtM08NVlSGN&amount=51000¤cy=usd&description=Radio+num%C3%A9rique+%0ADecember+08%2C+2016+11%3A00+AM+-+07%3A00+PM%0ADecember+09%2C+2016+11%3A00+AM+-+07%3A00+PM%0ADecember+10%2C+2016+11%3A00+AM+-+07%3A00+PM + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '225' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:22 GMT + Content-Type: + - application/json + Content-Length: + - '552' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4Y3qKoP2Yqmq + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: ASCII-8BIT + string: !binary |- + ewogICJpZCI6ICJpaV8xOUttT3cyc09tZjQ3Tno5ZjBQYktiSHEiLAogICJv + YmplY3QiOiAiaW52b2ljZWl0ZW0iLAogICJhbW91bnQiOiA1MTAwMCwKICAi + Y3VycmVuY3kiOiAidXNkIiwKICAiY3VzdG9tZXIiOiAiY3VzXzhDek50TTA4 + TlZsU0dOIiwKICAiZGF0ZSI6IDE0ODAzMjkwMjIsCiAgImRlc2NyaXB0aW9u + IjogIlJhZGlvIG51bcOpcmlxdWUgXG5EZWNlbWJlciAwOCwgMjAxNiAxMTow + MCBBTSAtIDA3OjAwIFBNXG5EZWNlbWJlciAwOSwgMjAxNiAxMTowMCBBTSAt + IDA3OjAwIFBNXG5EZWNlbWJlciAxMCwgMjAxNiAxMTowMCBBTSAtIDA3OjAw + IFBNIiwKICAiZGlzY291bnRhYmxlIjogdHJ1ZSwKICAiaW52b2ljZSI6IG51 + bGwsCiAgImxpdmVtb2RlIjogZmFsc2UsCiAgIm1ldGFkYXRhIjoge30sCiAg + InBlcmlvZCI6IHsKICAgICJzdGFydCI6IDE0ODAzMjkwMjIsCiAgICAiZW5k + IjogMTQ4MDMyOTAyMgogIH0sCiAgInBsYW4iOiBudWxsLAogICJwcm9yYXRp + b24iOiBmYWxzZSwKICAicXVhbnRpdHkiOiBudWxsLAogICJzdWJzY3JpcHRp + b24iOiBudWxsCn0K + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:22 GMT +- request: + method: post + uri: https://api.stripe.com/v1/invoiceitems + body: + encoding: UTF-8 + string: customer=cus_8CzNtM08NVlSGN&amount=-7650¤cy=usd&description=coupon+SUNNYFABLAB+-+reservation + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '98' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:23 GMT + Content-Type: + - application/json + Content-Length: + - '451' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4YzTw5ITNQ7t + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "ii_19KmOw2sOmf47Nz9fMgjHIhg", + "object": "invoiceitem", + "amount": -7650, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "date": 1480329022, + "description": "coupon SUNNYFABLAB - reservation", + "discountable": false, + "invoice": null, + "livemode": false, + "metadata": {}, + "period": { + "start": 1480329022, + "end": 1480329022 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null + } + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:23 GMT +- request: + method: post + uri: https://api.stripe.com/v1/invoiceitems + body: + encoding: UTF-8 + string: customer=cus_8CzNtM08NVlSGN&amount=-1000¤cy=usd&description=wallet+-10.0 + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '78' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:23 GMT + Content-Type: + - application/json + Content-Length: + - '431' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4YHcxKC6TIpx + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "ii_19KmOx2sOmf47Nz9XIzvTjLC", + "object": "invoiceitem", + "amount": -1000, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "date": 1480329023, + "description": "wallet -10.0", + "discountable": false, + "invoice": null, + "livemode": false, + "metadata": {}, + "period": { + "start": 1480329023, + "end": 1480329023 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null + } + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:23 GMT +- request: + method: get + uri: https://api.stripe.com/v1/customers/cus_8CzNtM08NVlSGN + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:24 GMT + Content-Type: + - application/json + Content-Length: + - '1415' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4YUv3IAopxIK + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "cus_8CzNtM08NVlSGN", + "object": "customer", + "account_balance": 0, + "created": 1459782849, + "currency": "usd", + "default_source": "card_18ZhUf2sOmf47Nz9LhkQeEmO", + "delinquent": false, + "description": "Vanessa Lonchamp", + "discount": null, + "email": "vanessa.lonchamp@sfr.fr", + "livemode": false, + "metadata": {}, + "shipping": null, + "sources": { + "object": "list", + "data": [ + { + "id": "card_18ZhUf2sOmf47Nz9LhkQeEmO", + "object": "card", + "address_city": null, + "address_country": null, + "address_line1": null, + "address_line1_check": null, + "address_line2": null, + "address_state": null, + "address_zip": null, + "address_zip_check": null, + "brand": "Visa", + "country": "US", + "customer": "cus_8CzNtM08NVlSGN", + "cvc_check": "pass", + "dynamic_last4": null, + "exp_month": 4, + "exp_year": 2017, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "last4": "4242", + "metadata": {}, + "name": null, + "tokenization_method": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/customers/cus_8CzNtM08NVlSGN/sources" + }, + "subscriptions": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/customers/cus_8CzNtM08NVlSGN/subscriptions" + } + } + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:24 GMT +- request: + method: post + uri: https://api.stripe.com/v1/customers/cus_8CzNtM08NVlSGN/sources + body: + encoding: UTF-8 + string: card=tok_19KmOv2sOmf47Nz90KKaBGgJ + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '33' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:25 GMT + Content-Type: + - application/json + Content-Length: + - '577' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4Ychb7UhSBol + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "card_19KmOv2sOmf47Nz94YYaGGHa", + "object": "card", + "address_city": null, + "address_country": null, + "address_line1": null, + "address_line1_check": null, + "address_line2": null, + "address_state": null, + "address_zip": null, + "address_zip_check": null, + "brand": "Visa", + "country": "US", + "customer": "cus_8CzNtM08NVlSGN", + "cvc_check": "pass", + "dynamic_last4": null, + "exp_month": 4, + "exp_year": 2017, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "last4": "4242", + "metadata": {}, + "name": null, + "tokenization_method": null + } + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:25 GMT +- request: + method: post + uri: https://api.stripe.com/v1/customers/cus_8CzNtM08NVlSGN + body: + encoding: UTF-8 + string: default_source=card_19KmOv2sOmf47Nz94YYaGGHa + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '44' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:26 GMT + Content-Type: + - application/json + Content-Length: + - '2143' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4Y7M4v5B4FLQ + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "cus_8CzNtM08NVlSGN", + "object": "customer", + "account_balance": 0, + "created": 1459782849, + "currency": "usd", + "default_source": "card_19KmOv2sOmf47Nz94YYaGGHa", + "delinquent": false, + "description": "Vanessa Lonchamp", + "discount": null, + "email": "vanessa.lonchamp@sfr.fr", + "livemode": false, + "metadata": {}, + "shipping": null, + "sources": { + "object": "list", + "data": [ + { + "id": "card_19KmOv2sOmf47Nz94YYaGGHa", + "object": "card", + "address_city": null, + "address_country": null, + "address_line1": null, + "address_line1_check": null, + "address_line2": null, + "address_state": null, + "address_zip": null, + "address_zip_check": null, + "brand": "Visa", + "country": "US", + "customer": "cus_8CzNtM08NVlSGN", + "cvc_check": "pass", + "dynamic_last4": null, + "exp_month": 4, + "exp_year": 2017, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "last4": "4242", + "metadata": {}, + "name": null, + "tokenization_method": null + }, + { + "id": "card_18ZhUf2sOmf47Nz9LhkQeEmO", + "object": "card", + "address_city": null, + "address_country": null, + "address_line1": null, + "address_line1_check": null, + "address_line2": null, + "address_state": null, + "address_zip": null, + "address_zip_check": null, + "brand": "Visa", + "country": "US", + "customer": "cus_8CzNtM08NVlSGN", + "cvc_check": "pass", + "dynamic_last4": null, + "exp_month": 4, + "exp_year": 2017, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "last4": "4242", + "metadata": {}, + "name": null, + "tokenization_method": null + } + ], + "has_more": false, + "total_count": 2, + "url": "/v1/customers/cus_8CzNtM08NVlSGN/sources" + }, + "subscriptions": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/customers/cus_8CzNtM08NVlSGN/subscriptions" + } + } + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:26 GMT +- request: + method: post + uri: https://api.stripe.com/v1/invoices + body: + encoding: UTF-8 + string: customer=cus_8CzNtM08NVlSGN + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '27' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:27 GMT + Content-Type: + - application/json + Content-Length: + - '2516' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4YqC96ZArjnb + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: ASCII-8BIT + string: !binary |- + ewogICJpZCI6ICJpbl8xOUttUDEyc09tZjQ3Tno5Umw2YUtXRjgiLAogICJv + YmplY3QiOiAiaW52b2ljZSIsCiAgImFtb3VudF9kdWUiOiA0MjM1MCwKICAi + YXBwbGljYXRpb25fZmVlIjogbnVsbCwKICAiYXR0ZW1wdF9jb3VudCI6IDAs + CiAgImF0dGVtcHRlZCI6IGZhbHNlLAogICJjaGFyZ2UiOiBudWxsLAogICJj + bG9zZWQiOiBmYWxzZSwKICAiY3VycmVuY3kiOiAidXNkIiwKICAiY3VzdG9t + ZXIiOiAiY3VzXzhDek50TTA4TlZsU0dOIiwKICAiZGF0ZSI6IDE0ODAzMjkw + MjcsCiAgImRlc2NyaXB0aW9uIjogbnVsbCwKICAiZGlzY291bnQiOiBudWxs + LAogICJlbmRpbmdfYmFsYW5jZSI6IG51bGwsCiAgImZvcmdpdmVuIjogZmFs + c2UsCiAgImxpbmVzIjogewogICAgIm9iamVjdCI6ICJsaXN0IiwKICAgICJk + YXRhIjogWwogICAgICB7CiAgICAgICAgImlkIjogImlpXzE5S21PeDJzT21m + NDdOejlYSXp2VGpMQyIsCiAgICAgICAgIm9iamVjdCI6ICJsaW5lX2l0ZW0i + LAogICAgICAgICJhbW91bnQiOiAtMTAwMCwKICAgICAgICAiY3VycmVuY3ki + OiAidXNkIiwKICAgICAgICAiZGVzY3JpcHRpb24iOiAid2FsbGV0IC0xMC4w + IiwKICAgICAgICAiZGlzY291bnRhYmxlIjogZmFsc2UsCiAgICAgICAgImxp + dmVtb2RlIjogZmFsc2UsCiAgICAgICAgIm1ldGFkYXRhIjoge30sCiAgICAg + ICAgInBlcmlvZCI6IHsKICAgICAgICAgICJzdGFydCI6IDE0ODAzMjkwMjMs + CiAgICAgICAgICAiZW5kIjogMTQ4MDMyOTAyMwogICAgICAgIH0sCiAgICAg + ICAgInBsYW4iOiBudWxsLAogICAgICAgICJwcm9yYXRpb24iOiBmYWxzZSwK + ICAgICAgICAicXVhbnRpdHkiOiBudWxsLAogICAgICAgICJzdWJzY3JpcHRp + b24iOiBudWxsLAogICAgICAgICJ0eXBlIjogImludm9pY2VpdGVtIgogICAg + ICB9LAogICAgICB7CiAgICAgICAgImlkIjogImlpXzE5S21PdzJzT21mNDdO + ejlmTWdqSEloZyIsCiAgICAgICAgIm9iamVjdCI6ICJsaW5lX2l0ZW0iLAog + ICAgICAgICJhbW91bnQiOiAtNzY1MCwKICAgICAgICAiY3VycmVuY3kiOiAi + dXNkIiwKICAgICAgICAiZGVzY3JpcHRpb24iOiAiY291cG9uIFNVTk5ZRkFC + TEFCIC0gcmVzZXJ2YXRpb24iLAogICAgICAgICJkaXNjb3VudGFibGUiOiBm + YWxzZSwKICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICAgICAibWV0 + YWRhdGEiOiB7fSwKICAgICAgICAicGVyaW9kIjogewogICAgICAgICAgInN0 + YXJ0IjogMTQ4MDMyOTAyMiwKICAgICAgICAgICJlbmQiOiAxNDgwMzI5MDIy + CiAgICAgICAgfSwKICAgICAgICAicGxhbiI6IG51bGwsCiAgICAgICAgInBy + b3JhdGlvbiI6IGZhbHNlLAogICAgICAgICJxdWFudGl0eSI6IG51bGwsCiAg + ICAgICAgInN1YnNjcmlwdGlvbiI6IG51bGwsCiAgICAgICAgInR5cGUiOiAi + aW52b2ljZWl0ZW0iCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAiaWQiOiAi + aWlfMTlLbU93MnNPbWY0N056OWYwUGJLYkhxIiwKICAgICAgICAib2JqZWN0 + IjogImxpbmVfaXRlbSIsCiAgICAgICAgImFtb3VudCI6IDUxMDAwLAogICAg + ICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAgICAgICJkZXNjcmlwdGlvbiI6 + ICJSYWRpbyBudW3DqXJpcXVlIFxuRGVjZW1iZXIgMDgsIDIwMTYgMTE6MDAg + QU0gLSAwNzowMCBQTVxuRGVjZW1iZXIgMDksIDIwMTYgMTE6MDAgQU0gLSAw + NzowMCBQTVxuRGVjZW1iZXIgMTAsIDIwMTYgMTE6MDAgQU0gLSAwNzowMCBQ + TSIsCiAgICAgICAgImRpc2NvdW50YWJsZSI6IHRydWUsCiAgICAgICAgImxp + dmVtb2RlIjogZmFsc2UsCiAgICAgICAgIm1ldGFkYXRhIjoge30sCiAgICAg + ICAgInBlcmlvZCI6IHsKICAgICAgICAgICJzdGFydCI6IDE0ODAzMjkwMjIs + CiAgICAgICAgICAiZW5kIjogMTQ4MDMyOTAyMgogICAgICAgIH0sCiAgICAg + ICAgInBsYW4iOiBudWxsLAogICAgICAgICJwcm9yYXRpb24iOiBmYWxzZSwK + ICAgICAgICAicXVhbnRpdHkiOiBudWxsLAogICAgICAgICJzdWJzY3JpcHRp + b24iOiBudWxsLAogICAgICAgICJ0eXBlIjogImludm9pY2VpdGVtIgogICAg + ICB9CiAgICBdLAogICAgImhhc19tb3JlIjogZmFsc2UsCiAgICAidG90YWxf + Y291bnQiOiAzLAogICAgInVybCI6ICIvdjEvaW52b2ljZXMvaW5fMTlLbVAx + MnNPbWY0N056OVJsNmFLV0Y4L2xpbmVzIgogIH0sCiAgImxpdmVtb2RlIjog + ZmFsc2UsCiAgIm1ldGFkYXRhIjoge30sCiAgIm5leHRfcGF5bWVudF9hdHRl + bXB0IjogMTQ4MDMzMjYyNywKICAicGFpZCI6IGZhbHNlLAogICJwZXJpb2Rf + ZW5kIjogMTQ4MDMyOTAyNywKICAicGVyaW9kX3N0YXJ0IjogMTQ4MDMyOTAy + NywKICAicmVjZWlwdF9udW1iZXIiOiBudWxsLAogICJzdGFydGluZ19iYWxh + bmNlIjogMCwKICAic3RhdGVtZW50X2Rlc2NyaXB0b3IiOiBudWxsLAogICJz + dWJzY3JpcHRpb24iOiBudWxsLAogICJzdWJ0b3RhbCI6IDQyMzUwLAogICJ0 + YXgiOiBudWxsLAogICJ0YXhfcGVyY2VudCI6IG51bGwsCiAgInRvdGFsIjog + NDIzNTAsCiAgIndlYmhvb2tzX2RlbGl2ZXJlZF9hdCI6IG51bGwKfQo= + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:27 GMT +- request: + method: post + uri: https://api.stripe.com/v1/invoices/in_19KmP12sOmf47Nz9Rl6aKWF8/pay + body: + encoding: ASCII-8BIT + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '0' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:28 GMT + Content-Type: + - application/json + Content-Length: + - '2535' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4Y7QI51Jw753 + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: ASCII-8BIT + string: !binary |- + ewogICJpZCI6ICJpbl8xOUttUDEyc09tZjQ3Tno5Umw2YUtXRjgiLAogICJv + YmplY3QiOiAiaW52b2ljZSIsCiAgImFtb3VudF9kdWUiOiA0MjM1MCwKICAi + YXBwbGljYXRpb25fZmVlIjogbnVsbCwKICAiYXR0ZW1wdF9jb3VudCI6IDEs + CiAgImF0dGVtcHRlZCI6IHRydWUsCiAgImNoYXJnZSI6ICJjaF8xOUttUDIy + c09tZjQ3Tno5M2lmYklVMmkiLAogICJjbG9zZWQiOiB0cnVlLAogICJjdXJy + ZW5jeSI6ICJ1c2QiLAogICJjdXN0b21lciI6ICJjdXNfOEN6TnRNMDhOVmxT + R04iLAogICJkYXRlIjogMTQ4MDMyOTAyNywKICAiZGVzY3JpcHRpb24iOiBu + dWxsLAogICJkaXNjb3VudCI6IG51bGwsCiAgImVuZGluZ19iYWxhbmNlIjog + MCwKICAiZm9yZ2l2ZW4iOiBmYWxzZSwKICAibGluZXMiOiB7CiAgICAib2Jq + ZWN0IjogImxpc3QiLAogICAgImRhdGEiOiBbCiAgICAgIHsKICAgICAgICAi + aWQiOiAiaWlfMTlLbU94MnNPbWY0N056OVhJenZUakxDIiwKICAgICAgICAi + b2JqZWN0IjogImxpbmVfaXRlbSIsCiAgICAgICAgImFtb3VudCI6IC0xMDAw + LAogICAgICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAgICAgICJkZXNjcmlw + dGlvbiI6ICJ3YWxsZXQgLTEwLjAiLAogICAgICAgICJkaXNjb3VudGFibGUi + OiBmYWxzZSwKICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICAgICAi + bWV0YWRhdGEiOiB7fSwKICAgICAgICAicGVyaW9kIjogewogICAgICAgICAg + InN0YXJ0IjogMTQ4MDMyOTAyMywKICAgICAgICAgICJlbmQiOiAxNDgwMzI5 + MDIzCiAgICAgICAgfSwKICAgICAgICAicGxhbiI6IG51bGwsCiAgICAgICAg + InByb3JhdGlvbiI6IGZhbHNlLAogICAgICAgICJxdWFudGl0eSI6IG51bGws + CiAgICAgICAgInN1YnNjcmlwdGlvbiI6IG51bGwsCiAgICAgICAgInR5cGUi + OiAiaW52b2ljZWl0ZW0iCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAiaWQi + OiAiaWlfMTlLbU93MnNPbWY0N056OWZNZ2pISWhnIiwKICAgICAgICAib2Jq + ZWN0IjogImxpbmVfaXRlbSIsCiAgICAgICAgImFtb3VudCI6IC03NjUwLAog + ICAgICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAgICAgICJkZXNjcmlwdGlv + biI6ICJjb3Vwb24gU1VOTllGQUJMQUIgLSByZXNlcnZhdGlvbiIsCiAgICAg + ICAgImRpc2NvdW50YWJsZSI6IGZhbHNlLAogICAgICAgICJsaXZlbW9kZSI6 + IGZhbHNlLAogICAgICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICJwZXJp + b2QiOiB7CiAgICAgICAgICAic3RhcnQiOiAxNDgwMzI5MDIyLAogICAgICAg + ICAgImVuZCI6IDE0ODAzMjkwMjIKICAgICAgICB9LAogICAgICAgICJwbGFu + IjogbnVsbCwKICAgICAgICAicHJvcmF0aW9uIjogZmFsc2UsCiAgICAgICAg + InF1YW50aXR5IjogbnVsbCwKICAgICAgICAic3Vic2NyaXB0aW9uIjogbnVs + bCwKICAgICAgICAidHlwZSI6ICJpbnZvaWNlaXRlbSIKICAgICAgfSwKICAg + ICAgewogICAgICAgICJpZCI6ICJpaV8xOUttT3cyc09tZjQ3Tno5ZjBQYkti + SHEiLAogICAgICAgICJvYmplY3QiOiAibGluZV9pdGVtIiwKICAgICAgICAi + YW1vdW50IjogNTEwMDAsCiAgICAgICAgImN1cnJlbmN5IjogInVzZCIsCiAg + ICAgICAgImRlc2NyaXB0aW9uIjogIlJhZGlvIG51bcOpcmlxdWUgXG5EZWNl + bWJlciAwOCwgMjAxNiAxMTowMCBBTSAtIDA3OjAwIFBNXG5EZWNlbWJlciAw + OSwgMjAxNiAxMTowMCBBTSAtIDA3OjAwIFBNXG5EZWNlbWJlciAxMCwgMjAx + NiAxMTowMCBBTSAtIDA3OjAwIFBNIiwKICAgICAgICAiZGlzY291bnRhYmxl + IjogdHJ1ZSwKICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICAgICAi + bWV0YWRhdGEiOiB7fSwKICAgICAgICAicGVyaW9kIjogewogICAgICAgICAg + InN0YXJ0IjogMTQ4MDMyOTAyMiwKICAgICAgICAgICJlbmQiOiAxNDgwMzI5 + MDIyCiAgICAgICAgfSwKICAgICAgICAicGxhbiI6IG51bGwsCiAgICAgICAg + InByb3JhdGlvbiI6IGZhbHNlLAogICAgICAgICJxdWFudGl0eSI6IG51bGws + CiAgICAgICAgInN1YnNjcmlwdGlvbiI6IG51bGwsCiAgICAgICAgInR5cGUi + OiAiaW52b2ljZWl0ZW0iCiAgICAgIH0KICAgIF0sCiAgICAiaGFzX21vcmUi + OiBmYWxzZSwKICAgICJ0b3RhbF9jb3VudCI6IDMsCiAgICAidXJsIjogIi92 + MS9pbnZvaWNlcy9pbl8xOUttUDEyc09tZjQ3Tno5Umw2YUtXRjgvbGluZXMi + CiAgfSwKICAibGl2ZW1vZGUiOiBmYWxzZSwKICAibWV0YWRhdGEiOiB7fSwK + ICAibmV4dF9wYXltZW50X2F0dGVtcHQiOiBudWxsLAogICJwYWlkIjogdHJ1 + ZSwKICAicGVyaW9kX2VuZCI6IDE0ODAzMjkwMjcsCiAgInBlcmlvZF9zdGFy + dCI6IDE0ODAzMjkwMjcsCiAgInJlY2VpcHRfbnVtYmVyIjogbnVsbCwKICAi + c3RhcnRpbmdfYmFsYW5jZSI6IDAsCiAgInN0YXRlbWVudF9kZXNjcmlwdG9y + IjogbnVsbCwKICAic3Vic2NyaXB0aW9uIjogbnVsbCwKICAic3VidG90YWwi + OiA0MjM1MCwKICAidGF4IjogbnVsbCwKICAidGF4X3BlcmNlbnQiOiBudWxs + LAogICJ0b3RhbCI6IDQyMzUwLAogICJ3ZWJob29rc19kZWxpdmVyZWRfYXQi + OiAxNDgwMzI5MDI3Cn0K + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:28 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/customers/cus_8CzNtM08NVlSGN/sources/card_19KmOv2sOmf47Nz94YYaGGHa + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:30:29 GMT + Content-Type: + - application/json + Content-Length: + - '63' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4YMgucjzDaXM + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "deleted": true, + "id": "card_19KmOv2sOmf47Nz94YYaGGHa" + } + http_version: + recorded_at: Mon, 28 Nov 2016 10:30:29 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 new file mode 100644 index 0000000000..c332f1b376 --- /dev/null +++ b/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means_retrieve_invoice_from_stripe.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.stripe.com/v1/invoices/in_19KmP12sOmf47Nz9Rl6aKWF8 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 4.4.0-47-generic (buildd@lcy01-03) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 28 Nov 2016 10:42:47 GMT + Content-Type: + - application/json + Content-Length: + - '2535' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_9e4kXKKT6XjyhI + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: ASCII-8BIT + string: !binary |- + ewogICJpZCI6ICJpbl8xOUttUDEyc09tZjQ3Tno5Umw2YUtXRjgiLAogICJv + YmplY3QiOiAiaW52b2ljZSIsCiAgImFtb3VudF9kdWUiOiA0MjM1MCwKICAi + YXBwbGljYXRpb25fZmVlIjogbnVsbCwKICAiYXR0ZW1wdF9jb3VudCI6IDEs + CiAgImF0dGVtcHRlZCI6IHRydWUsCiAgImNoYXJnZSI6ICJjaF8xOUttUDIy + c09tZjQ3Tno5M2lmYklVMmkiLAogICJjbG9zZWQiOiB0cnVlLAogICJjdXJy + ZW5jeSI6ICJ1c2QiLAogICJjdXN0b21lciI6ICJjdXNfOEN6TnRNMDhOVmxT + R04iLAogICJkYXRlIjogMTQ4MDMyOTAyNywKICAiZGVzY3JpcHRpb24iOiBu + dWxsLAogICJkaXNjb3VudCI6IG51bGwsCiAgImVuZGluZ19iYWxhbmNlIjog + MCwKICAiZm9yZ2l2ZW4iOiBmYWxzZSwKICAibGluZXMiOiB7CiAgICAib2Jq + ZWN0IjogImxpc3QiLAogICAgImRhdGEiOiBbCiAgICAgIHsKICAgICAgICAi + aWQiOiAiaWlfMTlLbU94MnNPbWY0N056OVhJenZUakxDIiwKICAgICAgICAi + b2JqZWN0IjogImxpbmVfaXRlbSIsCiAgICAgICAgImFtb3VudCI6IC0xMDAw + LAogICAgICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAgICAgICJkZXNjcmlw + dGlvbiI6ICJ3YWxsZXQgLTEwLjAiLAogICAgICAgICJkaXNjb3VudGFibGUi + OiBmYWxzZSwKICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICAgICAi + bWV0YWRhdGEiOiB7fSwKICAgICAgICAicGVyaW9kIjogewogICAgICAgICAg + InN0YXJ0IjogMTQ4MDMyOTAyMywKICAgICAgICAgICJlbmQiOiAxNDgwMzI5 + MDIzCiAgICAgICAgfSwKICAgICAgICAicGxhbiI6IG51bGwsCiAgICAgICAg + InByb3JhdGlvbiI6IGZhbHNlLAogICAgICAgICJxdWFudGl0eSI6IG51bGws + CiAgICAgICAgInN1YnNjcmlwdGlvbiI6IG51bGwsCiAgICAgICAgInR5cGUi + OiAiaW52b2ljZWl0ZW0iCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAiaWQi + OiAiaWlfMTlLbU93MnNPbWY0N056OWZNZ2pISWhnIiwKICAgICAgICAib2Jq + ZWN0IjogImxpbmVfaXRlbSIsCiAgICAgICAgImFtb3VudCI6IC03NjUwLAog + ICAgICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAgICAgICJkZXNjcmlwdGlv + biI6ICJjb3Vwb24gU1VOTllGQUJMQUIgLSByZXNlcnZhdGlvbiIsCiAgICAg + ICAgImRpc2NvdW50YWJsZSI6IGZhbHNlLAogICAgICAgICJsaXZlbW9kZSI6 + IGZhbHNlLAogICAgICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICJwZXJp + b2QiOiB7CiAgICAgICAgICAic3RhcnQiOiAxNDgwMzI5MDIyLAogICAgICAg + ICAgImVuZCI6IDE0ODAzMjkwMjIKICAgICAgICB9LAogICAgICAgICJwbGFu + IjogbnVsbCwKICAgICAgICAicHJvcmF0aW9uIjogZmFsc2UsCiAgICAgICAg + InF1YW50aXR5IjogbnVsbCwKICAgICAgICAic3Vic2NyaXB0aW9uIjogbnVs + bCwKICAgICAgICAidHlwZSI6ICJpbnZvaWNlaXRlbSIKICAgICAgfSwKICAg + ICAgewogICAgICAgICJpZCI6ICJpaV8xOUttT3cyc09tZjQ3Tno5ZjBQYkti + SHEiLAogICAgICAgICJvYmplY3QiOiAibGluZV9pdGVtIiwKICAgICAgICAi + YW1vdW50IjogNTEwMDAsCiAgICAgICAgImN1cnJlbmN5IjogInVzZCIsCiAg + ICAgICAgImRlc2NyaXB0aW9uIjogIlJhZGlvIG51bcOpcmlxdWUgXG5EZWNl + bWJlciAwOCwgMjAxNiAxMTowMCBBTSAtIDA3OjAwIFBNXG5EZWNlbWJlciAw + OSwgMjAxNiAxMTowMCBBTSAtIDA3OjAwIFBNXG5EZWNlbWJlciAxMCwgMjAx + NiAxMTowMCBBTSAtIDA3OjAwIFBNIiwKICAgICAgICAiZGlzY291bnRhYmxl + IjogdHJ1ZSwKICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICAgICAi + bWV0YWRhdGEiOiB7fSwKICAgICAgICAicGVyaW9kIjogewogICAgICAgICAg + InN0YXJ0IjogMTQ4MDMyOTAyMiwKICAgICAgICAgICJlbmQiOiAxNDgwMzI5 + MDIyCiAgICAgICAgfSwKICAgICAgICAicGxhbiI6IG51bGwsCiAgICAgICAg + InByb3JhdGlvbiI6IGZhbHNlLAogICAgICAgICJxdWFudGl0eSI6IG51bGws + CiAgICAgICAgInN1YnNjcmlwdGlvbiI6IG51bGwsCiAgICAgICAgInR5cGUi + OiAiaW52b2ljZWl0ZW0iCiAgICAgIH0KICAgIF0sCiAgICAiaGFzX21vcmUi + OiBmYWxzZSwKICAgICJ0b3RhbF9jb3VudCI6IDMsCiAgICAidXJsIjogIi92 + MS9pbnZvaWNlcy9pbl8xOUttUDEyc09tZjQ3Tno5Umw2YUtXRjgvbGluZXMi + CiAgfSwKICAibGl2ZW1vZGUiOiBmYWxzZSwKICAibWV0YWRhdGEiOiB7fSwK + ICAibmV4dF9wYXltZW50X2F0dGVtcHQiOiBudWxsLAogICJwYWlkIjogdHJ1 + ZSwKICAicGVyaW9kX2VuZCI6IDE0ODAzMjkwMjcsCiAgInBlcmlvZF9zdGFy + dCI6IDE0ODAzMjkwMjcsCiAgInJlY2VpcHRfbnVtYmVyIjogbnVsbCwKICAi + c3RhcnRpbmdfYmFsYW5jZSI6IDAsCiAgInN0YXRlbWVudF9kZXNjcmlwdG9y + IjogbnVsbCwKICAic3Vic2NyaXB0aW9uIjogbnVsbCwKICAic3VidG90YWwi + OiA0MjM1MCwKICAidGF4IjogbnVsbCwKICAidGF4X3BlcmNlbnQiOiBudWxs + LAogICJ0b3RhbCI6IDQyMzUwLAogICJ3ZWJob29rc19kZWxpdmVyZWRfYXQi + OiAxNDgwMzI5MDI3Cn0K + http_version: + recorded_at: Mon, 28 Nov 2016 10:42:47 GMT +recorded_with: VCR 3.0.1 diff --git a/test/vcr_cassettes/subscriptions_admin_create_success.yml b/test/vcr_cassettes/subscriptions_admin_create_success.yml index 2a7c2bf106..e119708308 100644 --- a/test/vcr_cassettes/subscriptions_admin_create_success.yml +++ b/test/vcr_cassettes/subscriptions_admin_create_success.yml @@ -20,7 +20,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 3.13.0-83-generic (buildd@lgw01-55) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) - ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"sylvain-sleede-pc"}' + ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -177,7 +177,7 @@ http_interactions: "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" } } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 16:16:21 GMT - request: method: post @@ -199,7 +199,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 3.13.0-83-generic (buildd@lgw01-55) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) - ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"sylvain-sleede-pc"}' + ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"integration"}' Content-Length: - '42' response: @@ -269,7 +269,7 @@ http_interactions: "trial_end": null, "trial_start": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 16:16:22 GMT - request: method: get @@ -291,7 +291,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 3.13.0-83-generic (buildd@lgw01-55) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) - ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"sylvain-sleede-pc"}' + ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -405,7 +405,7 @@ http_interactions: "has_more": true, "url": "/v1/invoices" } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 16:16:23 GMT - request: method: get @@ -427,7 +427,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 3.13.0-83-generic (buildd@lgw01-55) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) - ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"sylvain-sleede-pc"}' + ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -617,7 +617,7 @@ http_interactions: "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" } } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 16:16:25 GMT - request: method: get @@ -639,7 +639,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 3.13.0-83-generic (buildd@lgw01-55) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) - ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"sylvain-sleede-pc"}' + ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -707,7 +707,7 @@ http_interactions: "trial_end": null, "trial_start": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 16:16:25 GMT - request: method: delete @@ -729,7 +729,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 3.13.0-83-generic (buildd@lgw01-55) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) - ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"sylvain-sleede-pc"}' + ) #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016","hostname":"integration"}' response: status: code: 200 @@ -797,6 +797,6 @@ http_interactions: "trial_end": null, "trial_start": null } - http_version: + http_version: recorded_at: Wed, 06 Apr 2016 16:16:26 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 index b32669f29b..47509a3e3c 100644 --- a/test/vcr_cassettes/subscriptions_user_create_failed.yml +++ b/test/vcr_cassettes/subscriptions_user_create_failed.yml @@ -20,7 +20,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' Content-Length: - '81' response: @@ -90,7 +90,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:39 GMT - request: method: get @@ -112,7 +112,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' response: status: code: 200 @@ -180,6 +180,6 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:40 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 index 4f945c009d..5e3d4f9d79 100644 --- a/test/vcr_cassettes/subscriptions_user_create_success.yml +++ b/test/vcr_cassettes/subscriptions_user_create_success.yml @@ -20,7 +20,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' Content-Length: - '81' response: @@ -90,7 +90,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:41 GMT - request: method: get @@ -112,7 +112,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' response: status: code: 200 @@ -180,7 +180,7 @@ http_interactions: "type": "card", "used": false } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:42 GMT - request: method: get @@ -202,7 +202,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' response: status: code: 200 @@ -361,7 +361,7 @@ http_interactions: ICAgICAgfQogICAgXSwKICAgICJoYXNfbW9yZSI6IGZhbHNlLAogICAgInRv dGFsX2NvdW50IjogNCwKICAgICJ1cmwiOiAiL3YxL2N1c3RvbWVycy9jdXNf OERpMXdqZFZrdHY1a3Qvc3Vic2NyaXB0aW9ucyIKICB9Cn0K - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:42 GMT - request: method: post @@ -383,7 +383,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' Content-Length: - '76' response: @@ -453,7 +453,7 @@ http_interactions: "trial_end": null, "trial_start": null } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:44 GMT - request: method: get @@ -475,7 +475,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' response: status: code: 200 @@ -589,7 +589,7 @@ http_interactions: "has_more": true, "url": "/v1/invoices" } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:47 GMT - request: method: get @@ -611,7 +611,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' response: status: code: 200 @@ -793,7 +793,7 @@ http_interactions: ICAgICJoYXNfbW9yZSI6IGZhbHNlLAogICAgInRvdGFsX2NvdW50IjogNSwK ICAgICJ1cmwiOiAiL3YxL2N1c3RvbWVycy9jdXNfOERpMXdqZFZrdHY1a3Qv c3Vic2NyaXB0aW9ucyIKICB9Cn0K - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:48 GMT - request: method: get @@ -815,7 +815,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' response: status: code: 200 @@ -883,7 +883,7 @@ http_interactions: "trial_end": null, "trial_start": null } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:49 GMT - request: method: delete @@ -905,7 +905,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' response: status: code: 200 @@ -973,6 +973,6 @@ http_interactions: "trial_end": null, "trial_start": null } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:43:50 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 index 29e03a51c6..8beb57922a 100644 --- a/test/vcr_cassettes/subscriptions_user_renew_failed.yml +++ b/test/vcr_cassettes/subscriptions_user_renew_failed.yml @@ -20,7 +20,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' response: status: code: 400 @@ -60,7 +60,7 @@ http_interactions: "param": "token" } } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:47:34 GMT - request: method: get @@ -82,7 +82,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' response: status: code: 200 @@ -305,7 +305,7 @@ http_interactions: "url": "/v1/customers/cus_8E2ys9zDZgetWX/subscriptions" } } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:47:35 GMT - request: method: post @@ -327,7 +327,7 @@ http_interactions: X-Stripe-Client-User-Agent: - '{"bindings_version":"1.30.2","lang":"ruby","lang_version":"2.3.0 p0 (2015-12-25)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux version 4.4.5-1-ARCH (builduser@tobias) (gcc version 5.3.0 (GCC) ) #1 SMP - PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"Sylvain-desktop"}' + PREEMPT Thu Mar 10 07:38:19 CET 2016","hostname":"integration"}' Content-Length: - '66' response: @@ -369,6 +369,6 @@ http_interactions: "param": "card" } } - http_version: + http_version: recorded_at: Mon, 11 Apr 2016 15:47:36 GMT recorded_with: VCR 3.0.1