diff --git a/app/controllers/api/subscriptions_controller.rb b/app/controllers/api/subscriptions_controller.rb index 368286558..20bcdc709 100644 --- a/app/controllers/api/subscriptions_controller.rb +++ b/app/controllers/api/subscriptions_controller.rb @@ -14,16 +14,18 @@ class API::SubscriptionsController < API::ApiController else if current_user.is_admin? @subscription = Subscription.find_or_initialize_by(user_id: subscription_params[:user_id]) - # @subscription.expired_at = nil @subscription.update_column(:expired_at, nil) unless @subscription.new_record? # very important @subscription.attributes = subscription_params is_subscribe = @subscription.save_with_local_payment(!User.find(subscription_params[:user_id]).invoicing_disabled?) else @subscription = Subscription.find_or_initialize_by(user_id: current_user.id) - # @subscription.expired_at = nil - @subscription.update_column(:expired_at, nil) unless @subscription.new_record? # very important - @subscription.attributes = subscription_params.merge(user_id: current_user.id) - is_subscribe = @subscription.save_with_payment + if valid_card_token?(subscription_params[:card_token]) + @subscription.update_column(:expired_at, nil) unless @subscription.new_record? # very important + @subscription.attributes = subscription_params.merge(user_id: current_user.id) + is_subscribe = @subscription.save_with_payment + else + is_subscribe = false + end end if is_subscribe render :show, status: :created, location: @subscription @@ -61,4 +63,14 @@ class API::SubscriptionsController < API::ApiController def subscription_update_params params.require(:subscription).permit(:expired_at) end + + # TODO refactor subscriptions logic and move this in model/validator + def valid_card_token?(token) + begin + Stripe::Token.retrieve(token) + rescue Stripe::InvalidRequestError => e + @subscription.errors[:card_token] << e.message + false + end + end end diff --git a/app/pdfs/pdf/invoice.rb b/app/pdfs/pdf/invoice.rb index ce890dad0..6e2120159 100644 --- a/app/pdfs/pdf/invoice.rb +++ b/app/pdfs/pdf/invoice.rb @@ -139,8 +139,8 @@ module PDF vat_rate = Setting.find_by({name: 'invoice_VAT-rate'}).value.to_f vat = total / (vat_rate / 100 + 1) - data += [ [I18n.t('invoices.including_VAT_RATE', RATE: vat_rate), number_to_currency(vat)] ] - data += [ [I18n.t('invoices.including_total_excluding_taxes'), number_to_currency(total-vat)] ] + data += [ [I18n.t('invoices.including_VAT_RATE', RATE: vat_rate), number_to_currency(total-vat)] ] + data += [ [I18n.t('invoices.including_total_excluding_taxes'), number_to_currency(vat)] ] data += [ [I18n.t('invoices.including_amount_payed_on_ordering'), number_to_currency(total)] ] # checking the round number diff --git a/app/validators/stripe_card_token_validator.rb b/app/validators/stripe_card_token_validator.rb new file mode 100644 index 000000000..1d7a78165 --- /dev/null +++ b/app/validators/stripe_card_token_validator.rb @@ -0,0 +1,15 @@ + +class StripeCardTokenValidator + def validate(record) + if options[:token] + begin + res = Stripe::Token.retrieve(options[:token]) + if res[:id] != options[:token] + record.errors[:card_token] << "A problem occurred while retrieving the card with the specified token: #{res.id}" + end + rescue Stripe::InvalidRequestError => e + record.errors[:card_token] << e + end + end + end +end \ No newline at end of file diff --git a/test/integration/subscriptions/renew_as_user_test.rb b/test/integration/subscriptions/renew_as_user_test.rb index 4def40e4e..d534776ab 100644 --- a/test/integration/subscriptions/renew_as_user_test.rb +++ b/test/integration/subscriptions/renew_as_user_test.rb @@ -76,7 +76,7 @@ class Subscriptions::RenewAsUserTest < ActionDispatch::IntegrationTest assert_match /No such token/, response.body # Check that the user's subscription has not changed - #FIXME assert_equal previous_expiration, @user.subscription.expired_at.to_i, "user's subscription has changed" + assert_equal previous_expiration, @user.subscription.expired_at.to_i, "user's subscription has changed" end end \ No newline at end of file diff --git a/test/vcr_cassettes/subscriptions_user_create_failed.yml b/test/vcr_cassettes/subscriptions_user_create_failed.yml index 5475de74e..bce52ebeb 100644 --- a/test/vcr_cassettes/subscriptions_user_create_failed.yml +++ b/test/vcr_cassettes/subscriptions_user_create_failed.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-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"}' + 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"}' Content-Length: - '81' response: @@ -31,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Thu, 07 Apr 2016 09:34:23 GMT + - Mon, 11 Apr 2016 15:43:39 GMT Content-Type: - application/json Content-Length: - - '780' + - '779' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -49,7 +49,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8E1aDuJqtjQOj4 + - req_8FcRQTmptYozzo Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -58,10 +58,10 @@ http_interactions: encoding: UTF-8 string: | { - "id": "tok_17xZWt2sOmf47Nz906Kkg4Q3", + "id": "tok_17z7CR2sOmf47Nz9uppKBmeh", "object": "token", "card": { - "id": "card_17xZWt2sOmf47Nz9eVUCi53A", + "id": "card_17z7CR2sOmf47Nz9ruv5qwpH", "object": "card", "address_city": null, "address_country": null, @@ -84,17 +84,17 @@ http_interactions: "name": null, "tokenization_method": null }, - "client_ip": "90.52.157.226", - "created": 1460021663, + "client_ip": "90.42.87.235", + "created": 1460389419, "livemode": false, "type": "card", "used": false } http_version: - recorded_at: Thu, 07 Apr 2016 09:34:23 GMT + recorded_at: Mon, 11 Apr 2016 15:43:39 GMT - request: method: get - uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt + uri: https://api.stripe.com/v1/tokens/tok_17z7CR2sOmf47Nz9uppKBmeh body: encoding: US-ASCII string: '' @@ -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-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"}' + 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"}' response: status: code: 200 @@ -121,11 +121,11 @@ http_interactions: Server: - nginx Date: - - Thu, 07 Apr 2016 09:34:24 GMT + - Mon, 11 Apr 2016 15:43:40 GMT Content-Type: - application/json Content-Length: - - '4487' + - '779' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -139,7 +139,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8E1aHv4p7a59Gy + - req_8FcRRKMMyEf0bI Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -148,682 +148,38 @@ http_interactions: encoding: UTF-8 string: | { - "id": "cus_8Di1wjdVktv5kt", - "object": "customer", - "account_balance": 0, - "created": 1459948888, - "currency": "usd", - "default_source": "card_17xGjJ2sOmf47Nz9UrQOP8Cl", - "delinquent": false, - "description": "Jean Dupond", - "discount": null, - "email": "jean.dupond@gmail.com", - "livemode": false, - "metadata": {}, - "shipping": null, - "sources": { - "object": "list", - "data": [ - { - "id": "card_17xGjJ2sOmf47Nz9UrQOP8Cl", - "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_8Di1wjdVktv5kt", - "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_8Di1wjdVktv5kt/sources" + "id": "tok_17z7CR2sOmf47Nz9uppKBmeh", + "object": "token", + "card": { + "id": "card_17z7CR2sOmf47Nz9ruv5qwpH", + "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 }, - "subscriptions": { - "object": "list", - "data": [ - { - "id": "sub_8DkqBcR1bQvr5G", - "object": "subscription", - "application_fee_percent": null, - "cancel_at_period_end": true, - "canceled_at": 1459959386, - "current_period_end": 1462551382, - "current_period_start": 1459959382, - "customer": "cus_8Di1wjdVktv5kt", - "discount": null, - "ended_at": null, - "metadata": {}, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "name": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null - }, - "quantity": 1, - "start": 1459959382, - "status": "active", - "tax_percent": null, - "trial_end": null, - "trial_start": null - }, - { - "id": "sub_8Di9gqPLwt5IIC", - "object": "subscription", - "application_fee_percent": null, - "cancel_at_period_end": true, - "canceled_at": 1459949404, - "current_period_end": 1462541399, - "current_period_start": 1459949399, - "customer": "cus_8Di1wjdVktv5kt", - "discount": null, - "ended_at": null, - "metadata": {}, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "name": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null - }, - "quantity": 1, - "start": 1459949399, - "status": "active", - "tax_percent": null, - "trial_end": null, - "trial_start": null - }, - { - "id": "sub_8Di2VadRvr7A99", - "object": "subscription", - "application_fee_percent": null, - "cancel_at_period_end": true, - "canceled_at": 1459948972, - "current_period_end": 1462540968, - "current_period_start": 1459948968, - "customer": "cus_8Di1wjdVktv5kt", - "discount": null, - "ended_at": null, - "metadata": {}, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "name": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null - }, - "quantity": 1, - "start": 1459948968, - "status": "active", - "tax_percent": null, - "trial_end": null, - "trial_start": null - } - ], - "has_more": false, - "total_count": 3, - "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" - } + "client_ip": "90.42.87.235", + "created": 1460389419, + "livemode": false, + "type": "card", + "used": false } http_version: - recorded_at: Thu, 07 Apr 2016 09:34:24 GMT -- request: - method: post - uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions - body: - encoding: UTF-8 - string: plan=mensuel-tarif-reduit-student-month-20160404171827&card=tok_17xZWt2sOmf47Nz906Kkg4Q3 - headers: - Accept: - - "*/*; q=0.5, application/xml" - Accept-Encoding: - - gzip, deflate - User-Agent: - - Stripe/v1 RubyBindings/1.30.2 - Authorization: - - Bearer sk_test_mGokO9TGtrVxMOyK4yZiktBE - 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 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"}' - Content-Length: - - '88' - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Thu, 07 Apr 2016 09:34:25 GMT - Content-Type: - - application/json - Content-Length: - - '880' - 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_8E1ac4ihRJHesp - Stripe-Version: - - '2015-10-16' - Strict-Transport-Security: - - max-age=31556926; includeSubDomains - body: - encoding: ASCII-8BIT - string: !binary |- - ewogICJpZCI6ICJzdWJfOEUxYWZrVEJuMmRjMUQiLAogICJvYmplY3QiOiAi - c3Vic2NyaXB0aW9uIiwKICAiYXBwbGljYXRpb25fZmVlX3BlcmNlbnQiOiBu - dWxsLAogICJjYW5jZWxfYXRfcGVyaW9kX2VuZCI6IGZhbHNlLAogICJjYW5j - ZWxlZF9hdCI6IG51bGwsCiAgImN1cnJlbnRfcGVyaW9kX2VuZCI6IDE0NjI2 - MTM2NjUsCiAgImN1cnJlbnRfcGVyaW9kX3N0YXJ0IjogMTQ2MDAyMTY2NSwK - ICAiY3VzdG9tZXIiOiAiY3VzXzhEaTF3amRWa3R2NWt0IiwKICAiZGlzY291 - bnQiOiBudWxsLAogICJlbmRlZF9hdCI6IG51bGwsCiAgIm1ldGFkYXRhIjog - e30sCiAgInBsYW4iOiB7CiAgICAiaWQiOiAibWVuc3VlbC10YXJpZi1yZWR1 - aXQtc3R1ZGVudC1tb250aC0yMDE2MDQwNDE3MTgyNyIsCiAgICAib2JqZWN0 - IjogInBsYW4iLAogICAgImFtb3VudCI6IDIwMDAsCiAgICAiY3JlYXRlZCI6 - IDE0NTk3ODMxMDgsCiAgICAiY3VycmVuY3kiOiAidXNkIiwKICAgICJpbnRl - cnZhbCI6ICJtb250aCIsCiAgICAiaW50ZXJ2YWxfY291bnQiOiAxLAogICAg - ImxpdmVtb2RlIjogZmFsc2UsCiAgICAibWV0YWRhdGEiOiB7fSwKICAgICJu - YW1lIjogIk1lbnN1ZWwgdGFyaWYgcsOpZHVpdCAtIMOpdHVkaWFudCwgLSBk - ZSAyNSBhbnMsIGVuc2VpZ25hbnQsIGRlbWFuZGV1ciBkJ2VtcGxvaSAtIG1v - bnRoIiwKICAgICJzdGF0ZW1lbnRfZGVzY3JpcHRvciI6IG51bGwsCiAgICAi - dHJpYWxfcGVyaW9kX2RheXMiOiBudWxsCiAgfSwKICAicXVhbnRpdHkiOiAx - LAogICJzdGFydCI6IDE0NjAwMjE2NjUsCiAgInN0YXR1cyI6ICJhY3RpdmUi - LAogICJ0YXhfcGVyY2VudCI6IG51bGwsCiAgInRyaWFsX2VuZCI6IG51bGws - CiAgInRyaWFsX3N0YXJ0IjogbnVsbAp9Cg== - http_version: - recorded_at: Thu, 07 Apr 2016 09:34:26 GMT -- request: - method: get - uri: https://api.stripe.com/v1/invoices?customer=cus_8Di1wjdVktv5kt&limit=1 - 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_mGokO9TGtrVxMOyK4yZiktBE - 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 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"}' - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Thu, 07 Apr 2016 09:34:27 GMT - Content-Type: - - application/json - Content-Length: - - '2266' - 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_8E1aqh5kH5Jx71 - Stripe-Version: - - '2015-10-16' - Strict-Transport-Security: - - max-age=31556926; includeSubDomains - body: - encoding: ASCII-8BIT - string: !binary |- - ewogICJvYmplY3QiOiAibGlzdCIsCiAgImRhdGEiOiBbCiAgICB7CiAgICAg - ICJpZCI6ICJpbl8xN3haV3Yyc09tZjQ3Tno5UVZ5UG8zWHYiLAogICAgICAi - b2JqZWN0IjogImludm9pY2UiLAogICAgICAiYW1vdW50X2R1ZSI6IDIwMDAs - CiAgICAgICJhcHBsaWNhdGlvbl9mZWUiOiBudWxsLAogICAgICAiYXR0ZW1w - dF9jb3VudCI6IDEsCiAgICAgICJhdHRlbXB0ZWQiOiB0cnVlLAogICAgICAi - Y2hhcmdlIjogImNoXzE3eFpXdjJzT21mNDdOejlFOWtIUTV5OCIsCiAgICAg - ICJjbG9zZWQiOiB0cnVlLAogICAgICAiY3VycmVuY3kiOiAidXNkIiwKICAg - ICAgImN1c3RvbWVyIjogImN1c184RGkxd2pkVmt0djVrdCIsCiAgICAgICJk - YXRlIjogMTQ2MDAyMTY2NSwKICAgICAgImRlc2NyaXB0aW9uIjogbnVsbCwK - ICAgICAgImRpc2NvdW50IjogbnVsbCwKICAgICAgImVuZGluZ19iYWxhbmNl - IjogMCwKICAgICAgImZvcmdpdmVuIjogZmFsc2UsCiAgICAgICJsaW5lcyI6 - IHsKICAgICAgICAib2JqZWN0IjogImxpc3QiLAogICAgICAgICJkYXRhIjog - WwogICAgICAgICAgewogICAgICAgICAgICAiaWQiOiAic3ViXzhFMWFma1RC - bjJkYzFEIiwKICAgICAgICAgICAgIm9iamVjdCI6ICJsaW5lX2l0ZW0iLAog - ICAgICAgICAgICAiYW1vdW50IjogMjAwMCwKICAgICAgICAgICAgImN1cnJl - bmN5IjogInVzZCIsCiAgICAgICAgICAgICJkZXNjcmlwdGlvbiI6IG51bGws - CiAgICAgICAgICAgICJkaXNjb3VudGFibGUiOiB0cnVlLAogICAgICAgICAg - ICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICAgICAgICAgIm1ldGFkYXRhIjog - e30sCiAgICAgICAgICAgICJwZXJpb2QiOiB7CiAgICAgICAgICAgICAgInN0 - YXJ0IjogMTQ2MDAyMTY2NSwKICAgICAgICAgICAgICAiZW5kIjogMTQ2MjYx - MzY2NQogICAgICAgICAgICB9LAogICAgICAgICAgICAicGxhbiI6IHsKICAg - ICAgICAgICAgICAiaWQiOiAibWVuc3VlbC10YXJpZi1yZWR1aXQtc3R1ZGVu - dC1tb250aC0yMDE2MDQwNDE3MTgyNyIsCiAgICAgICAgICAgICAgIm9iamVj - dCI6ICJwbGFuIiwKICAgICAgICAgICAgICAiYW1vdW50IjogMjAwMCwKICAg - ICAgICAgICAgICAiY3JlYXRlZCI6IDE0NTk3ODMxMDgsCiAgICAgICAgICAg - ICAgImN1cnJlbmN5IjogInVzZCIsCiAgICAgICAgICAgICAgImludGVydmFs - IjogIm1vbnRoIiwKICAgICAgICAgICAgICAiaW50ZXJ2YWxfY291bnQiOiAx - LAogICAgICAgICAgICAgICJsaXZlbW9kZSI6IGZhbHNlLAogICAgICAgICAg - ICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICAgICAgICJuYW1lIjogIk1l - bnN1ZWwgdGFyaWYgcsOpZHVpdCAtIMOpdHVkaWFudCwgLSBkZSAyNSBhbnMs - IGVuc2VpZ25hbnQsIGRlbWFuZGV1ciBkJ2VtcGxvaSAtIG1vbnRoIiwKICAg - ICAgICAgICAgICAic3RhdGVtZW50X2Rlc2NyaXB0b3IiOiBudWxsLAogICAg - ICAgICAgICAgICJ0cmlhbF9wZXJpb2RfZGF5cyI6IG51bGwKICAgICAgICAg - ICAgfSwKICAgICAgICAgICAgInByb3JhdGlvbiI6IGZhbHNlLAogICAgICAg - ICAgICAicXVhbnRpdHkiOiAxLAogICAgICAgICAgICAic3Vic2NyaXB0aW9u - IjogbnVsbCwKICAgICAgICAgICAgInR5cGUiOiAic3Vic2NyaXB0aW9uIgog - ICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImhhc19tb3JlIjogZmFs - c2UsCiAgICAgICAgInRvdGFsX2NvdW50IjogMSwKICAgICAgICAidXJsIjog - Ii92MS9pbnZvaWNlcy9pbl8xN3haV3Yyc09tZjQ3Tno5UVZ5UG8zWHYvbGlu - ZXMiCiAgICAgIH0sCiAgICAgICJsaXZlbW9kZSI6IGZhbHNlLAogICAgICAi - bWV0YWRhdGEiOiB7fSwKICAgICAgIm5leHRfcGF5bWVudF9hdHRlbXB0Ijog - bnVsbCwKICAgICAgInBhaWQiOiB0cnVlLAogICAgICAicGVyaW9kX2VuZCI6 - IDE0NjAwMjE2NjUsCiAgICAgICJwZXJpb2Rfc3RhcnQiOiAxNDU5OTQ4OTY4 - LAogICAgICAicmVjZWlwdF9udW1iZXIiOiBudWxsLAogICAgICAic3RhcnRp - bmdfYmFsYW5jZSI6IDAsCiAgICAgICJzdGF0ZW1lbnRfZGVzY3JpcHRvciI6 - IG51bGwsCiAgICAgICJzdWJzY3JpcHRpb24iOiAic3ViXzhFMWFma1RCbjJk - YzFEIiwKICAgICAgInN1YnRvdGFsIjogMjAwMCwKICAgICAgInRheCI6IG51 - bGwsCiAgICAgICJ0YXhfcGVyY2VudCI6IG51bGwsCiAgICAgICJ0b3RhbCI6 - IDIwMDAsCiAgICAgICJ3ZWJob29rc19kZWxpdmVyZWRfYXQiOiAxNDYwMDIx - NjY1CiAgICB9CiAgXSwKICAiaGFzX21vcmUiOiB0cnVlLAogICJ1cmwiOiAi - L3YxL2ludm9pY2VzIgp9Cg== - http_version: - recorded_at: Thu, 07 Apr 2016 09:34:27 GMT -- request: - method: get - uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt - 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_mGokO9TGtrVxMOyK4yZiktBE - 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 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"}' - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Thu, 07 Apr 2016 09:34:28 GMT - Content-Type: - - application/json - Content-Length: - - '5566' - 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_8E1a2ZYS5iN1tJ - Stripe-Version: - - '2015-10-16' - Strict-Transport-Security: - - max-age=31556926; includeSubDomains - body: - encoding: ASCII-8BIT - string: !binary |- - ewogICJpZCI6ICJjdXNfOERpMXdqZFZrdHY1a3QiLAogICJvYmplY3QiOiAi - Y3VzdG9tZXIiLAogICJhY2NvdW50X2JhbGFuY2UiOiAwLAogICJjcmVhdGVk - IjogMTQ1OTk0ODg4OCwKICAiY3VycmVuY3kiOiAidXNkIiwKICAiZGVmYXVs - dF9zb3VyY2UiOiAiY2FyZF8xN3haV3Qyc09tZjQ3Tno5ZVZVQ2k1M0EiLAog - ICJkZWxpbnF1ZW50IjogZmFsc2UsCiAgImRlc2NyaXB0aW9uIjogIkplYW4g - RHVwb25kIiwKICAiZGlzY291bnQiOiBudWxsLAogICJlbWFpbCI6ICJqZWFu - LmR1cG9uZEBnbWFpbC5jb20iLAogICJsaXZlbW9kZSI6IGZhbHNlLAogICJt - ZXRhZGF0YSI6IHt9LAogICJzaGlwcGluZyI6IG51bGwsCiAgInNvdXJjZXMi - OiB7CiAgICAib2JqZWN0IjogImxpc3QiLAogICAgImRhdGEiOiBbCiAgICAg - IHsKICAgICAgICAiaWQiOiAiY2FyZF8xN3haV3Qyc09tZjQ3Tno5ZVZVQ2k1 - M0EiLAogICAgICAgICJvYmplY3QiOiAiY2FyZCIsCiAgICAgICAgImFkZHJl - c3NfY2l0eSI6IG51bGwsCiAgICAgICAgImFkZHJlc3NfY291bnRyeSI6IG51 - bGwsCiAgICAgICAgImFkZHJlc3NfbGluZTEiOiBudWxsLAogICAgICAgICJh - ZGRyZXNzX2xpbmUxX2NoZWNrIjogbnVsbCwKICAgICAgICAiYWRkcmVzc19s - aW5lMiI6IG51bGwsCiAgICAgICAgImFkZHJlc3Nfc3RhdGUiOiBudWxsLAog - ICAgICAgICJhZGRyZXNzX3ppcCI6IG51bGwsCiAgICAgICAgImFkZHJlc3Nf - emlwX2NoZWNrIjogbnVsbCwKICAgICAgICAiYnJhbmQiOiAiVmlzYSIsCiAg - ICAgICAgImNvdW50cnkiOiAiVVMiLAogICAgICAgICJjdXN0b21lciI6ICJj - dXNfOERpMXdqZFZrdHY1a3QiLAogICAgICAgICJjdmNfY2hlY2siOiAicGFz - cyIsCiAgICAgICAgImR5bmFtaWNfbGFzdDQiOiBudWxsLAogICAgICAgICJl - eHBfbW9udGgiOiA0LAogICAgICAgICJleHBfeWVhciI6IDIwMTcsCiAgICAg - ICAgImZpbmdlcnByaW50IjogIm81Mmp5YlI3Ym5tTm42QVQiLAogICAgICAg - ICJmdW5kaW5nIjogImNyZWRpdCIsCiAgICAgICAgImxhc3Q0IjogIjQyNDIi - LAogICAgICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICJuYW1lIjogbnVs - bCwKICAgICAgICAidG9rZW5pemF0aW9uX21ldGhvZCI6IG51bGwKICAgICAg - fQogICAgXSwKICAgICJoYXNfbW9yZSI6IGZhbHNlLAogICAgInRvdGFsX2Nv - dW50IjogMSwKICAgICJ1cmwiOiAiL3YxL2N1c3RvbWVycy9jdXNfOERpMXdq - ZFZrdHY1a3Qvc291cmNlcyIKICB9LAogICJzdWJzY3JpcHRpb25zIjogewog - ICAgIm9iamVjdCI6ICJsaXN0IiwKICAgICJkYXRhIjogWwogICAgICB7CiAg - ICAgICAgImlkIjogInN1Yl84RTFhZmtUQm4yZGMxRCIsCiAgICAgICAgIm9i - amVjdCI6ICJzdWJzY3JpcHRpb24iLAogICAgICAgICJhcHBsaWNhdGlvbl9m - ZWVfcGVyY2VudCI6IG51bGwsCiAgICAgICAgImNhbmNlbF9hdF9wZXJpb2Rf - ZW5kIjogZmFsc2UsCiAgICAgICAgImNhbmNlbGVkX2F0IjogbnVsbCwKICAg - ICAgICAiY3VycmVudF9wZXJpb2RfZW5kIjogMTQ2MjYxMzY2NSwKICAgICAg - ICAiY3VycmVudF9wZXJpb2Rfc3RhcnQiOiAxNDYwMDIxNjY1LAogICAgICAg - ICJjdXN0b21lciI6ICJjdXNfOERpMXdqZFZrdHY1a3QiLAogICAgICAgICJk - aXNjb3VudCI6IG51bGwsCiAgICAgICAgImVuZGVkX2F0IjogbnVsbCwKICAg - ICAgICAibWV0YWRhdGEiOiB7fSwKICAgICAgICAicGxhbiI6IHsKICAgICAg - ICAgICJpZCI6ICJtZW5zdWVsLXRhcmlmLXJlZHVpdC1zdHVkZW50LW1vbnRo - LTIwMTYwNDA0MTcxODI3IiwKICAgICAgICAgICJvYmplY3QiOiAicGxhbiIs - CiAgICAgICAgICAiYW1vdW50IjogMjAwMCwKICAgICAgICAgICJjcmVhdGVk - IjogMTQ1OTc4MzEwOCwKICAgICAgICAgICJjdXJyZW5jeSI6ICJ1c2QiLAog - ICAgICAgICAgImludGVydmFsIjogIm1vbnRoIiwKICAgICAgICAgICJpbnRl - cnZhbF9jb3VudCI6IDEsCiAgICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwK - ICAgICAgICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICAgIm5hbWUiOiAi - TWVuc3VlbCB0YXJpZiByw6lkdWl0IC0gw6l0dWRpYW50LCAtIGRlIDI1IGFu - cywgZW5zZWlnbmFudCwgZGVtYW5kZXVyIGQnZW1wbG9pIC0gbW9udGgiLAog - ICAgICAgICAgInN0YXRlbWVudF9kZXNjcmlwdG9yIjogbnVsbCwKICAgICAg - ICAgICJ0cmlhbF9wZXJpb2RfZGF5cyI6IG51bGwKICAgICAgICB9LAogICAg - ICAgICJxdWFudGl0eSI6IDEsCiAgICAgICAgInN0YXJ0IjogMTQ2MDAyMTY2 - NSwKICAgICAgICAic3RhdHVzIjogImFjdGl2ZSIsCiAgICAgICAgInRheF9w - ZXJjZW50IjogbnVsbCwKICAgICAgICAidHJpYWxfZW5kIjogbnVsbCwKICAg - ICAgICAidHJpYWxfc3RhcnQiOiBudWxsCiAgICAgIH0sCiAgICAgIHsKICAg - ICAgICAiaWQiOiAic3ViXzhEa3FCY1IxYlF2cjVHIiwKICAgICAgICAib2Jq - ZWN0IjogInN1YnNjcmlwdGlvbiIsCiAgICAgICAgImFwcGxpY2F0aW9uX2Zl - ZV9wZXJjZW50IjogbnVsbCwKICAgICAgICAiY2FuY2VsX2F0X3BlcmlvZF9l - bmQiOiB0cnVlLAogICAgICAgICJjYW5jZWxlZF9hdCI6IDE0NTk5NTkzODYs - CiAgICAgICAgImN1cnJlbnRfcGVyaW9kX2VuZCI6IDE0NjI1NTEzODIsCiAg - ICAgICAgImN1cnJlbnRfcGVyaW9kX3N0YXJ0IjogMTQ1OTk1OTM4MiwKICAg - ICAgICAiY3VzdG9tZXIiOiAiY3VzXzhEaTF3amRWa3R2NWt0IiwKICAgICAg - ICAiZGlzY291bnQiOiBudWxsLAogICAgICAgICJlbmRlZF9hdCI6IG51bGws - CiAgICAgICAgIm1ldGFkYXRhIjoge30sCiAgICAgICAgInBsYW4iOiB7CiAg - ICAgICAgICAiaWQiOiAibWVuc3VlbC1zdGFuZGFyZC1tb250aC0yMDE2MDQw - NDE3MTUxOSIsCiAgICAgICAgICAib2JqZWN0IjogInBsYW4iLAogICAgICAg - ICAgImFtb3VudCI6IDMwMDAsCiAgICAgICAgICAiY3JlYXRlZCI6IDE0NTk3 - ODI5MjEsCiAgICAgICAgICAiY3VycmVuY3kiOiAidXNkIiwKICAgICAgICAg - ICJpbnRlcnZhbCI6ICJtb250aCIsCiAgICAgICAgICAiaW50ZXJ2YWxfY291 - bnQiOiAxLAogICAgICAgICAgImxpdmVtb2RlIjogZmFsc2UsCiAgICAgICAg - ICAibWV0YWRhdGEiOiB7fSwKICAgICAgICAgICJuYW1lIjogIk1lbnN1ZWwg - LSBzdGFuZGFyZCwgYXNzb2NpYXRpb24gLSBtb250aCIsCiAgICAgICAgICAi - c3RhdGVtZW50X2Rlc2NyaXB0b3IiOiBudWxsLAogICAgICAgICAgInRyaWFs - X3BlcmlvZF9kYXlzIjogbnVsbAogICAgICAgIH0sCiAgICAgICAgInF1YW50 - aXR5IjogMSwKICAgICAgICAic3RhcnQiOiAxNDU5OTU5MzgyLAogICAgICAg - ICJzdGF0dXMiOiAiYWN0aXZlIiwKICAgICAgICAidGF4X3BlcmNlbnQiOiBu - dWxsLAogICAgICAgICJ0cmlhbF9lbmQiOiBudWxsLAogICAgICAgICJ0cmlh - bF9zdGFydCI6IG51bGwKICAgICAgfSwKICAgICAgewogICAgICAgICJpZCI6 - ICJzdWJfOERpOWdxUEx3dDVJSUMiLAogICAgICAgICJvYmplY3QiOiAic3Vi - c2NyaXB0aW9uIiwKICAgICAgICAiYXBwbGljYXRpb25fZmVlX3BlcmNlbnQi - OiBudWxsLAogICAgICAgICJjYW5jZWxfYXRfcGVyaW9kX2VuZCI6IHRydWUs - CiAgICAgICAgImNhbmNlbGVkX2F0IjogMTQ1OTk0OTQwNCwKICAgICAgICAi - Y3VycmVudF9wZXJpb2RfZW5kIjogMTQ2MjU0MTM5OSwKICAgICAgICAiY3Vy - cmVudF9wZXJpb2Rfc3RhcnQiOiAxNDU5OTQ5Mzk5LAogICAgICAgICJjdXN0 - b21lciI6ICJjdXNfOERpMXdqZFZrdHY1a3QiLAogICAgICAgICJkaXNjb3Vu - dCI6IG51bGwsCiAgICAgICAgImVuZGVkX2F0IjogbnVsbCwKICAgICAgICAi - bWV0YWRhdGEiOiB7fSwKICAgICAgICAicGxhbiI6IHsKICAgICAgICAgICJp - ZCI6ICJtZW5zdWVsLXN0YW5kYXJkLW1vbnRoLTIwMTYwNDA0MTcxNTE5IiwK - ICAgICAgICAgICJvYmplY3QiOiAicGxhbiIsCiAgICAgICAgICAiYW1vdW50 - IjogMzAwMCwKICAgICAgICAgICJjcmVhdGVkIjogMTQ1OTc4MjkyMSwKICAg - ICAgICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAgICAgICAgImludGVydmFs - IjogIm1vbnRoIiwKICAgICAgICAgICJpbnRlcnZhbF9jb3VudCI6IDEsCiAg - ICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICAgICAgICJtZXRhZGF0 - YSI6IHt9LAogICAgICAgICAgIm5hbWUiOiAiTWVuc3VlbCAtIHN0YW5kYXJk - LCBhc3NvY2lhdGlvbiAtIG1vbnRoIiwKICAgICAgICAgICJzdGF0ZW1lbnRf - ZGVzY3JpcHRvciI6IG51bGwsCiAgICAgICAgICAidHJpYWxfcGVyaW9kX2Rh - eXMiOiBudWxsCiAgICAgICAgfSwKICAgICAgICAicXVhbnRpdHkiOiAxLAog - ICAgICAgICJzdGFydCI6IDE0NTk5NDkzOTksCiAgICAgICAgInN0YXR1cyI6 - ICJhY3RpdmUiLAogICAgICAgICJ0YXhfcGVyY2VudCI6IG51bGwsCiAgICAg - ICAgInRyaWFsX2VuZCI6IG51bGwsCiAgICAgICAgInRyaWFsX3N0YXJ0Ijog - bnVsbAogICAgICB9LAogICAgICB7CiAgICAgICAgImlkIjogInN1Yl84RGky - VmFkUnZyN0E5OSIsCiAgICAgICAgIm9iamVjdCI6ICJzdWJzY3JpcHRpb24i - LAogICAgICAgICJhcHBsaWNhdGlvbl9mZWVfcGVyY2VudCI6IG51bGwsCiAg - ICAgICAgImNhbmNlbF9hdF9wZXJpb2RfZW5kIjogdHJ1ZSwKICAgICAgICAi - Y2FuY2VsZWRfYXQiOiAxNDU5OTQ4OTcyLAogICAgICAgICJjdXJyZW50X3Bl - cmlvZF9lbmQiOiAxNDYyNTQwOTY4LAogICAgICAgICJjdXJyZW50X3Blcmlv - ZF9zdGFydCI6IDE0NTk5NDg5NjgsCiAgICAgICAgImN1c3RvbWVyIjogImN1 - c184RGkxd2pkVmt0djVrdCIsCiAgICAgICAgImRpc2NvdW50IjogbnVsbCwK - ICAgICAgICAiZW5kZWRfYXQiOiBudWxsLAogICAgICAgICJtZXRhZGF0YSI6 - IHt9LAogICAgICAgICJwbGFuIjogewogICAgICAgICAgImlkIjogIm1lbnN1 - ZWwtc3RhbmRhcmQtbW9udGgtMjAxNjA0MDQxNzE1MTkiLAogICAgICAgICAg - Im9iamVjdCI6ICJwbGFuIiwKICAgICAgICAgICJhbW91bnQiOiAzMDAwLAog - ICAgICAgICAgImNyZWF0ZWQiOiAxNDU5NzgyOTIxLAogICAgICAgICAgImN1 - cnJlbmN5IjogInVzZCIsCiAgICAgICAgICAiaW50ZXJ2YWwiOiAibW9udGgi - LAogICAgICAgICAgImludGVydmFsX2NvdW50IjogMSwKICAgICAgICAgICJs - aXZlbW9kZSI6IGZhbHNlLAogICAgICAgICAgIm1ldGFkYXRhIjoge30sCiAg - ICAgICAgICAibmFtZSI6ICJNZW5zdWVsIC0gc3RhbmRhcmQsIGFzc29jaWF0 - aW9uIC0gbW9udGgiLAogICAgICAgICAgInN0YXRlbWVudF9kZXNjcmlwdG9y - IjogbnVsbCwKICAgICAgICAgICJ0cmlhbF9wZXJpb2RfZGF5cyI6IG51bGwK - ICAgICAgICB9LAogICAgICAgICJxdWFudGl0eSI6IDEsCiAgICAgICAgInN0 - YXJ0IjogMTQ1OTk0ODk2OCwKICAgICAgICAic3RhdHVzIjogImFjdGl2ZSIs - CiAgICAgICAgInRheF9wZXJjZW50IjogbnVsbCwKICAgICAgICAidHJpYWxf - ZW5kIjogbnVsbCwKICAgICAgICAidHJpYWxfc3RhcnQiOiBudWxsCiAgICAg - IH0KICAgIF0sCiAgICAiaGFzX21vcmUiOiBmYWxzZSwKICAgICJ0b3RhbF9j - b3VudCI6IDQsCiAgICAidXJsIjogIi92MS9jdXN0b21lcnMvY3VzXzhEaTF3 - amRWa3R2NWt0L3N1YnNjcmlwdGlvbnMiCiAgfQp9Cg== - http_version: - recorded_at: Thu, 07 Apr 2016 09:34:28 GMT -- request: - method: get - uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions/sub_8E1afkTBn2dc1D - 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_mGokO9TGtrVxMOyK4yZiktBE - 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 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"}' - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Thu, 07 Apr 2016 09:34:29 GMT - Content-Type: - - application/json - Content-Length: - - '880' - 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_8E1a72YcNQrLBo - Stripe-Version: - - '2015-10-16' - Strict-Transport-Security: - - max-age=31556926; includeSubDomains - body: - encoding: ASCII-8BIT - string: !binary |- - ewogICJpZCI6ICJzdWJfOEUxYWZrVEJuMmRjMUQiLAogICJvYmplY3QiOiAi - c3Vic2NyaXB0aW9uIiwKICAiYXBwbGljYXRpb25fZmVlX3BlcmNlbnQiOiBu - dWxsLAogICJjYW5jZWxfYXRfcGVyaW9kX2VuZCI6IGZhbHNlLAogICJjYW5j - ZWxlZF9hdCI6IG51bGwsCiAgImN1cnJlbnRfcGVyaW9kX2VuZCI6IDE0NjI2 - MTM2NjUsCiAgImN1cnJlbnRfcGVyaW9kX3N0YXJ0IjogMTQ2MDAyMTY2NSwK - ICAiY3VzdG9tZXIiOiAiY3VzXzhEaTF3amRWa3R2NWt0IiwKICAiZGlzY291 - bnQiOiBudWxsLAogICJlbmRlZF9hdCI6IG51bGwsCiAgIm1ldGFkYXRhIjog - e30sCiAgInBsYW4iOiB7CiAgICAiaWQiOiAibWVuc3VlbC10YXJpZi1yZWR1 - aXQtc3R1ZGVudC1tb250aC0yMDE2MDQwNDE3MTgyNyIsCiAgICAib2JqZWN0 - IjogInBsYW4iLAogICAgImFtb3VudCI6IDIwMDAsCiAgICAiY3JlYXRlZCI6 - IDE0NTk3ODMxMDgsCiAgICAiY3VycmVuY3kiOiAidXNkIiwKICAgICJpbnRl - cnZhbCI6ICJtb250aCIsCiAgICAiaW50ZXJ2YWxfY291bnQiOiAxLAogICAg - ImxpdmVtb2RlIjogZmFsc2UsCiAgICAibWV0YWRhdGEiOiB7fSwKICAgICJu - YW1lIjogIk1lbnN1ZWwgdGFyaWYgcsOpZHVpdCAtIMOpdHVkaWFudCwgLSBk - ZSAyNSBhbnMsIGVuc2VpZ25hbnQsIGRlbWFuZGV1ciBkJ2VtcGxvaSAtIG1v - bnRoIiwKICAgICJzdGF0ZW1lbnRfZGVzY3JpcHRvciI6IG51bGwsCiAgICAi - dHJpYWxfcGVyaW9kX2RheXMiOiBudWxsCiAgfSwKICAicXVhbnRpdHkiOiAx - LAogICJzdGFydCI6IDE0NjAwMjE2NjUsCiAgInN0YXR1cyI6ICJhY3RpdmUi - LAogICJ0YXhfcGVyY2VudCI6IG51bGwsCiAgInRyaWFsX2VuZCI6IG51bGws - CiAgInRyaWFsX3N0YXJ0IjogbnVsbAp9Cg== - http_version: - recorded_at: Thu, 07 Apr 2016 09:34:29 GMT -- request: - method: delete - uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions/sub_8E1afkTBn2dc1D?at_period_end=true - 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_mGokO9TGtrVxMOyK4yZiktBE - 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 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"}' - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Thu, 07 Apr 2016 09:34:30 GMT - Content-Type: - - application/json - Content-Length: - - '885' - 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_8E1aMVW98tCB7l - Stripe-Version: - - '2015-10-16' - Strict-Transport-Security: - - max-age=31556926; includeSubDomains - body: - encoding: ASCII-8BIT - string: !binary |- - ewogICJpZCI6ICJzdWJfOEUxYWZrVEJuMmRjMUQiLAogICJvYmplY3QiOiAi - c3Vic2NyaXB0aW9uIiwKICAiYXBwbGljYXRpb25fZmVlX3BlcmNlbnQiOiBu - dWxsLAogICJjYW5jZWxfYXRfcGVyaW9kX2VuZCI6IHRydWUsCiAgImNhbmNl - bGVkX2F0IjogMTQ2MDAyMTY3MCwKICAiY3VycmVudF9wZXJpb2RfZW5kIjog - MTQ2MjYxMzY2NSwKICAiY3VycmVudF9wZXJpb2Rfc3RhcnQiOiAxNDYwMDIx - NjY1LAogICJjdXN0b21lciI6ICJjdXNfOERpMXdqZFZrdHY1a3QiLAogICJk - aXNjb3VudCI6IG51bGwsCiAgImVuZGVkX2F0IjogbnVsbCwKICAibWV0YWRh - dGEiOiB7fSwKICAicGxhbiI6IHsKICAgICJpZCI6ICJtZW5zdWVsLXRhcmlm - LXJlZHVpdC1zdHVkZW50LW1vbnRoLTIwMTYwNDA0MTcxODI3IiwKICAgICJv - YmplY3QiOiAicGxhbiIsCiAgICAiYW1vdW50IjogMjAwMCwKICAgICJjcmVh - dGVkIjogMTQ1OTc4MzEwOCwKICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAg - ImludGVydmFsIjogIm1vbnRoIiwKICAgICJpbnRlcnZhbF9jb3VudCI6IDEs - CiAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICJtZXRhZGF0YSI6IHt9LAog - ICAgIm5hbWUiOiAiTWVuc3VlbCB0YXJpZiByw6lkdWl0IC0gw6l0dWRpYW50 - LCAtIGRlIDI1IGFucywgZW5zZWlnbmFudCwgZGVtYW5kZXVyIGQnZW1wbG9p - IC0gbW9udGgiLAogICAgInN0YXRlbWVudF9kZXNjcmlwdG9yIjogbnVsbCwK - ICAgICJ0cmlhbF9wZXJpb2RfZGF5cyI6IG51bGwKICB9LAogICJxdWFudGl0 - eSI6IDEsCiAgInN0YXJ0IjogMTQ2MDAyMTY2NSwKICAic3RhdHVzIjogImFj - dGl2ZSIsCiAgInRheF9wZXJjZW50IjogbnVsbCwKICAidHJpYWxfZW5kIjog - bnVsbCwKICAidHJpYWxfc3RhcnQiOiBudWxsCn0K - http_version: - recorded_at: Thu, 07 Apr 2016 09:34:30 GMT + 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 7f76d38ae..6f650ef27 100644 --- a/test/vcr_cassettes/subscriptions_user_create_success.yml +++ b/test/vcr_cassettes/subscriptions_user_create_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-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"}' + 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"}' Content-Length: - '81' response: @@ -31,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Wed, 06 Apr 2016 13:29:57 GMT + - Mon, 11 Apr 2016 15:43:41 GMT Content-Type: - application/json Content-Length: - - '780' + - '779' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -49,7 +49,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8Di9AmOR7uXw9z + - req_8FcRwZhpRvOW2K Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -58,10 +58,10 @@ http_interactions: encoding: UTF-8 string: | { - "id": "tok_17xGjJ2sOmf47Nz9PLqUZge2", + "id": "tok_17z7CT2sOmf47Nz9bO1WBtba", "object": "token", "card": { - "id": "card_17xGjJ2sOmf47Nz9UrQOP8Cl", + "id": "card_17z7CT2sOmf47Nz9wtWkhGor", "object": "card", "address_city": null, "address_country": null, @@ -84,14 +84,104 @@ http_interactions: "name": null, "tokenization_method": null }, - "client_ip": "90.52.157.226", - "created": 1459949397, + "client_ip": "90.42.87.235", + "created": 1460389421, "livemode": false, "type": "card", "used": false } http_version: - recorded_at: Wed, 06 Apr 2016 13:29:57 GMT + recorded_at: Mon, 11 Apr 2016 15:43:41 GMT +- request: + method: get + uri: https://api.stripe.com/v1/tokens/tok_17z7CT2sOmf47Nz9bO1WBtba + 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_mGokO9TGtrVxMOyK4yZiktBE + 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.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"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 11 Apr 2016 15:43:41 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_8FcRgivvsrn6Jy + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "tok_17z7CT2sOmf47Nz9bO1WBtba", + "object": "token", + "card": { + "id": "card_17z7CT2sOmf47Nz9wtWkhGor", + "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.42.87.235", + "created": 1460389421, + "livemode": false, + "type": "card", + "used": false + } + http_version: + recorded_at: Mon, 11 Apr 2016 15:43:42 GMT - request: method: get uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt @@ -111,8 +201,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-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"}' + 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"}' response: status: code: 200 @@ -121,11 +211,11 @@ http_interactions: Server: - nginx Date: - - Wed, 06 Apr 2016 13:29:58 GMT + - Mon, 11 Apr 2016 15:43:42 GMT Content-Type: - application/json Content-Length: - - '2437' + - '5571' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -139,111 +229,146 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8Di9uNBvnRw9C0 + - req_8FcRWeqA3l7Zyc Stripe-Version: - '2015-10-16' Strict-Transport-Security: - max-age=31556926; includeSubDomains body: - encoding: UTF-8 - string: | - { - "id": "cus_8Di1wjdVktv5kt", - "object": "customer", - "account_balance": 0, - "created": 1459948888, - "currency": "usd", - "default_source": "card_17xGcM2sOmf47Nz9CxYGRvdo", - "delinquent": false, - "description": "Jean Dupond", - "discount": null, - "email": "jean.dupond@gmail.com", - "livemode": false, - "metadata": {}, - "shipping": null, - "sources": { - "object": "list", - "data": [ - { - "id": "card_17xGcM2sOmf47Nz9CxYGRvdo", - "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_8Di1wjdVktv5kt", - "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_8Di1wjdVktv5kt/sources" - }, - "subscriptions": { - "object": "list", - "data": [ - { - "id": "sub_8Di2VadRvr7A99", - "object": "subscription", - "application_fee_percent": null, - "cancel_at_period_end": true, - "canceled_at": 1459948972, - "current_period_end": 1462540968, - "current_period_start": 1459948968, - "customer": "cus_8Di1wjdVktv5kt", - "discount": null, - "ended_at": null, - "metadata": {}, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "name": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null - }, - "quantity": 1, - "start": 1459948968, - "status": "active", - "tax_percent": null, - "trial_end": null, - "trial_start": null - } - ], - "has_more": false, - "total_count": 1, - "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" - } - } + encoding: ASCII-8BIT + string: !binary |- + ewogICJpZCI6ICJjdXNfOERpMXdqZFZrdHY1a3QiLAogICJvYmplY3QiOiAi + Y3VzdG9tZXIiLAogICJhY2NvdW50X2JhbGFuY2UiOiAwLAogICJjcmVhdGVk + IjogMTQ1OTk0ODg4OCwKICAiY3VycmVuY3kiOiAidXNkIiwKICAiZGVmYXVs + dF9zb3VyY2UiOiAiY2FyZF8xN3haV3Qyc09tZjQ3Tno5ZVZVQ2k1M0EiLAog + ICJkZWxpbnF1ZW50IjogZmFsc2UsCiAgImRlc2NyaXB0aW9uIjogIkplYW4g + RHVwb25kIiwKICAiZGlzY291bnQiOiBudWxsLAogICJlbWFpbCI6ICJqZWFu + LmR1cG9uZEBnbWFpbC5jb20iLAogICJsaXZlbW9kZSI6IGZhbHNlLAogICJt + ZXRhZGF0YSI6IHt9LAogICJzaGlwcGluZyI6IG51bGwsCiAgInNvdXJjZXMi + OiB7CiAgICAib2JqZWN0IjogImxpc3QiLAogICAgImRhdGEiOiBbCiAgICAg + IHsKICAgICAgICAiaWQiOiAiY2FyZF8xN3haV3Qyc09tZjQ3Tno5ZVZVQ2k1 + M0EiLAogICAgICAgICJvYmplY3QiOiAiY2FyZCIsCiAgICAgICAgImFkZHJl + c3NfY2l0eSI6IG51bGwsCiAgICAgICAgImFkZHJlc3NfY291bnRyeSI6IG51 + bGwsCiAgICAgICAgImFkZHJlc3NfbGluZTEiOiBudWxsLAogICAgICAgICJh + ZGRyZXNzX2xpbmUxX2NoZWNrIjogbnVsbCwKICAgICAgICAiYWRkcmVzc19s + aW5lMiI6IG51bGwsCiAgICAgICAgImFkZHJlc3Nfc3RhdGUiOiBudWxsLAog + ICAgICAgICJhZGRyZXNzX3ppcCI6IG51bGwsCiAgICAgICAgImFkZHJlc3Nf + emlwX2NoZWNrIjogbnVsbCwKICAgICAgICAiYnJhbmQiOiAiVmlzYSIsCiAg + ICAgICAgImNvdW50cnkiOiAiVVMiLAogICAgICAgICJjdXN0b21lciI6ICJj + dXNfOERpMXdqZFZrdHY1a3QiLAogICAgICAgICJjdmNfY2hlY2siOiAicGFz + cyIsCiAgICAgICAgImR5bmFtaWNfbGFzdDQiOiBudWxsLAogICAgICAgICJl + eHBfbW9udGgiOiA0LAogICAgICAgICJleHBfeWVhciI6IDIwMTcsCiAgICAg + ICAgImZpbmdlcnByaW50IjogIm81Mmp5YlI3Ym5tTm42QVQiLAogICAgICAg + ICJmdW5kaW5nIjogImNyZWRpdCIsCiAgICAgICAgImxhc3Q0IjogIjQyNDIi + LAogICAgICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICJuYW1lIjogbnVs + bCwKICAgICAgICAidG9rZW5pemF0aW9uX21ldGhvZCI6IG51bGwKICAgICAg + fQogICAgXSwKICAgICJoYXNfbW9yZSI6IGZhbHNlLAogICAgInRvdGFsX2Nv + dW50IjogMSwKICAgICJ1cmwiOiAiL3YxL2N1c3RvbWVycy9jdXNfOERpMXdq + ZFZrdHY1a3Qvc291cmNlcyIKICB9LAogICJzdWJzY3JpcHRpb25zIjogewog + ICAgIm9iamVjdCI6ICJsaXN0IiwKICAgICJkYXRhIjogWwogICAgICB7CiAg + ICAgICAgImlkIjogInN1Yl84RTFhZmtUQm4yZGMxRCIsCiAgICAgICAgIm9i + amVjdCI6ICJzdWJzY3JpcHRpb24iLAogICAgICAgICJhcHBsaWNhdGlvbl9m + ZWVfcGVyY2VudCI6IG51bGwsCiAgICAgICAgImNhbmNlbF9hdF9wZXJpb2Rf + ZW5kIjogdHJ1ZSwKICAgICAgICAiY2FuY2VsZWRfYXQiOiAxNDYwMDIxNjcw + LAogICAgICAgICJjdXJyZW50X3BlcmlvZF9lbmQiOiAxNDYyNjEzNjY1LAog + ICAgICAgICJjdXJyZW50X3BlcmlvZF9zdGFydCI6IDE0NjAwMjE2NjUsCiAg + ICAgICAgImN1c3RvbWVyIjogImN1c184RGkxd2pkVmt0djVrdCIsCiAgICAg + ICAgImRpc2NvdW50IjogbnVsbCwKICAgICAgICAiZW5kZWRfYXQiOiBudWxs + LAogICAgICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICJwbGFuIjogewog + ICAgICAgICAgImlkIjogIm1lbnN1ZWwtdGFyaWYtcmVkdWl0LXN0dWRlbnQt + bW9udGgtMjAxNjA0MDQxNzE4MjciLAogICAgICAgICAgIm9iamVjdCI6ICJw + bGFuIiwKICAgICAgICAgICJhbW91bnQiOiAyMDAwLAogICAgICAgICAgImNy + ZWF0ZWQiOiAxNDU5NzgzMTA4LAogICAgICAgICAgImN1cnJlbmN5IjogInVz + ZCIsCiAgICAgICAgICAiaW50ZXJ2YWwiOiAibW9udGgiLAogICAgICAgICAg + ImludGVydmFsX2NvdW50IjogMSwKICAgICAgICAgICJsaXZlbW9kZSI6IGZh + bHNlLAogICAgICAgICAgIm1ldGFkYXRhIjoge30sCiAgICAgICAgICAibmFt + ZSI6ICJNZW5zdWVsIHRhcmlmIHLDqWR1aXQgLSDDqXR1ZGlhbnQsIC0gZGUg + MjUgYW5zLCBlbnNlaWduYW50LCBkZW1hbmRldXIgZCdlbXBsb2kgLSBtb250 + aCIsCiAgICAgICAgICAic3RhdGVtZW50X2Rlc2NyaXB0b3IiOiBudWxsLAog + ICAgICAgICAgInRyaWFsX3BlcmlvZF9kYXlzIjogbnVsbAogICAgICAgIH0s + CiAgICAgICAgInF1YW50aXR5IjogMSwKICAgICAgICAic3RhcnQiOiAxNDYw + MDIxNjY1LAogICAgICAgICJzdGF0dXMiOiAiYWN0aXZlIiwKICAgICAgICAi + dGF4X3BlcmNlbnQiOiBudWxsLAogICAgICAgICJ0cmlhbF9lbmQiOiBudWxs + LAogICAgICAgICJ0cmlhbF9zdGFydCI6IG51bGwKICAgICAgfSwKICAgICAg + ewogICAgICAgICJpZCI6ICJzdWJfOERrcUJjUjFiUXZyNUciLAogICAgICAg + ICJvYmplY3QiOiAic3Vic2NyaXB0aW9uIiwKICAgICAgICAiYXBwbGljYXRp + b25fZmVlX3BlcmNlbnQiOiBudWxsLAogICAgICAgICJjYW5jZWxfYXRfcGVy + aW9kX2VuZCI6IHRydWUsCiAgICAgICAgImNhbmNlbGVkX2F0IjogMTQ1OTk1 + OTM4NiwKICAgICAgICAiY3VycmVudF9wZXJpb2RfZW5kIjogMTQ2MjU1MTM4 + MiwKICAgICAgICAiY3VycmVudF9wZXJpb2Rfc3RhcnQiOiAxNDU5OTU5Mzgy + LAogICAgICAgICJjdXN0b21lciI6ICJjdXNfOERpMXdqZFZrdHY1a3QiLAog + ICAgICAgICJkaXNjb3VudCI6IG51bGwsCiAgICAgICAgImVuZGVkX2F0Ijog + bnVsbCwKICAgICAgICAibWV0YWRhdGEiOiB7fSwKICAgICAgICAicGxhbiI6 + IHsKICAgICAgICAgICJpZCI6ICJtZW5zdWVsLXN0YW5kYXJkLW1vbnRoLTIw + MTYwNDA0MTcxNTE5IiwKICAgICAgICAgICJvYmplY3QiOiAicGxhbiIsCiAg + ICAgICAgICAiYW1vdW50IjogMzAwMCwKICAgICAgICAgICJjcmVhdGVkIjog + MTQ1OTc4MjkyMSwKICAgICAgICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAg + ICAgICAgImludGVydmFsIjogIm1vbnRoIiwKICAgICAgICAgICJpbnRlcnZh + bF9jb3VudCI6IDEsCiAgICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAg + ICAgICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICAgIm5hbWUiOiAiTWVu + c3VlbCAtIHN0YW5kYXJkLCBhc3NvY2lhdGlvbiAtIG1vbnRoIiwKICAgICAg + ICAgICJzdGF0ZW1lbnRfZGVzY3JpcHRvciI6IG51bGwsCiAgICAgICAgICAi + dHJpYWxfcGVyaW9kX2RheXMiOiBudWxsCiAgICAgICAgfSwKICAgICAgICAi + cXVhbnRpdHkiOiAxLAogICAgICAgICJzdGFydCI6IDE0NTk5NTkzODIsCiAg + ICAgICAgInN0YXR1cyI6ICJhY3RpdmUiLAogICAgICAgICJ0YXhfcGVyY2Vu + dCI6IG51bGwsCiAgICAgICAgInRyaWFsX2VuZCI6IG51bGwsCiAgICAgICAg + InRyaWFsX3N0YXJ0IjogbnVsbAogICAgICB9LAogICAgICB7CiAgICAgICAg + ImlkIjogInN1Yl84RGk5Z3FQTHd0NUlJQyIsCiAgICAgICAgIm9iamVjdCI6 + ICJzdWJzY3JpcHRpb24iLAogICAgICAgICJhcHBsaWNhdGlvbl9mZWVfcGVy + Y2VudCI6IG51bGwsCiAgICAgICAgImNhbmNlbF9hdF9wZXJpb2RfZW5kIjog + dHJ1ZSwKICAgICAgICAiY2FuY2VsZWRfYXQiOiAxNDU5OTQ5NDA0LAogICAg + ICAgICJjdXJyZW50X3BlcmlvZF9lbmQiOiAxNDYyNTQxMzk5LAogICAgICAg + ICJjdXJyZW50X3BlcmlvZF9zdGFydCI6IDE0NTk5NDkzOTksCiAgICAgICAg + ImN1c3RvbWVyIjogImN1c184RGkxd2pkVmt0djVrdCIsCiAgICAgICAgImRp + c2NvdW50IjogbnVsbCwKICAgICAgICAiZW5kZWRfYXQiOiBudWxsLAogICAg + ICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICJwbGFuIjogewogICAgICAg + ICAgImlkIjogIm1lbnN1ZWwtc3RhbmRhcmQtbW9udGgtMjAxNjA0MDQxNzE1 + MTkiLAogICAgICAgICAgIm9iamVjdCI6ICJwbGFuIiwKICAgICAgICAgICJh + bW91bnQiOiAzMDAwLAogICAgICAgICAgImNyZWF0ZWQiOiAxNDU5NzgyOTIx + LAogICAgICAgICAgImN1cnJlbmN5IjogInVzZCIsCiAgICAgICAgICAiaW50 + ZXJ2YWwiOiAibW9udGgiLAogICAgICAgICAgImludGVydmFsX2NvdW50Ijog + MSwKICAgICAgICAgICJsaXZlbW9kZSI6IGZhbHNlLAogICAgICAgICAgIm1l + dGFkYXRhIjoge30sCiAgICAgICAgICAibmFtZSI6ICJNZW5zdWVsIC0gc3Rh + bmRhcmQsIGFzc29jaWF0aW9uIC0gbW9udGgiLAogICAgICAgICAgInN0YXRl + bWVudF9kZXNjcmlwdG9yIjogbnVsbCwKICAgICAgICAgICJ0cmlhbF9wZXJp + b2RfZGF5cyI6IG51bGwKICAgICAgICB9LAogICAgICAgICJxdWFudGl0eSI6 + IDEsCiAgICAgICAgInN0YXJ0IjogMTQ1OTk0OTM5OSwKICAgICAgICAic3Rh + dHVzIjogImFjdGl2ZSIsCiAgICAgICAgInRheF9wZXJjZW50IjogbnVsbCwK + ICAgICAgICAidHJpYWxfZW5kIjogbnVsbCwKICAgICAgICAidHJpYWxfc3Rh + cnQiOiBudWxsCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAiaWQiOiAic3Vi + XzhEaTJWYWRSdnI3QTk5IiwKICAgICAgICAib2JqZWN0IjogInN1YnNjcmlw + dGlvbiIsCiAgICAgICAgImFwcGxpY2F0aW9uX2ZlZV9wZXJjZW50IjogbnVs + bCwKICAgICAgICAiY2FuY2VsX2F0X3BlcmlvZF9lbmQiOiB0cnVlLAogICAg + ICAgICJjYW5jZWxlZF9hdCI6IDE0NTk5NDg5NzIsCiAgICAgICAgImN1cnJl + bnRfcGVyaW9kX2VuZCI6IDE0NjI1NDA5NjgsCiAgICAgICAgImN1cnJlbnRf + cGVyaW9kX3N0YXJ0IjogMTQ1OTk0ODk2OCwKICAgICAgICAiY3VzdG9tZXIi + OiAiY3VzXzhEaTF3amRWa3R2NWt0IiwKICAgICAgICAiZGlzY291bnQiOiBu + dWxsLAogICAgICAgICJlbmRlZF9hdCI6IG51bGwsCiAgICAgICAgIm1ldGFk + YXRhIjoge30sCiAgICAgICAgInBsYW4iOiB7CiAgICAgICAgICAiaWQiOiAi + bWVuc3VlbC1zdGFuZGFyZC1tb250aC0yMDE2MDQwNDE3MTUxOSIsCiAgICAg + ICAgICAib2JqZWN0IjogInBsYW4iLAogICAgICAgICAgImFtb3VudCI6IDMw + MDAsCiAgICAgICAgICAiY3JlYXRlZCI6IDE0NTk3ODI5MjEsCiAgICAgICAg + ICAiY3VycmVuY3kiOiAidXNkIiwKICAgICAgICAgICJpbnRlcnZhbCI6ICJt + b250aCIsCiAgICAgICAgICAiaW50ZXJ2YWxfY291bnQiOiAxLAogICAgICAg + ICAgImxpdmVtb2RlIjogZmFsc2UsCiAgICAgICAgICAibWV0YWRhdGEiOiB7 + fSwKICAgICAgICAgICJuYW1lIjogIk1lbnN1ZWwgLSBzdGFuZGFyZCwgYXNz + b2NpYXRpb24gLSBtb250aCIsCiAgICAgICAgICAic3RhdGVtZW50X2Rlc2Ny + aXB0b3IiOiBudWxsLAogICAgICAgICAgInRyaWFsX3BlcmlvZF9kYXlzIjog + bnVsbAogICAgICAgIH0sCiAgICAgICAgInF1YW50aXR5IjogMSwKICAgICAg + ICAic3RhcnQiOiAxNDU5OTQ4OTY4LAogICAgICAgICJzdGF0dXMiOiAiYWN0 + aXZlIiwKICAgICAgICAidGF4X3BlcmNlbnQiOiBudWxsLAogICAgICAgICJ0 + cmlhbF9lbmQiOiBudWxsLAogICAgICAgICJ0cmlhbF9zdGFydCI6IG51bGwK + ICAgICAgfQogICAgXSwKICAgICJoYXNfbW9yZSI6IGZhbHNlLAogICAgInRv + dGFsX2NvdW50IjogNCwKICAgICJ1cmwiOiAiL3YxL2N1c3RvbWVycy9jdXNf + OERpMXdqZFZrdHY1a3Qvc3Vic2NyaXB0aW9ucyIKICB9Cn0K http_version: - recorded_at: Wed, 06 Apr 2016 13:29:58 GMT + recorded_at: Mon, 11 Apr 2016 15:43:42 GMT - request: method: post uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions body: encoding: UTF-8 - string: plan=mensuel-standard-month-20160404171519&card=tok_17xGjJ2sOmf47Nz9PLqUZge2 + string: plan=mensuel-standard-month-20160404171519&card=tok_17z7CT2sOmf47Nz9bO1WBtba headers: Accept: - "*/*; q=0.5, application/xml" @@ -257,8 +382,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-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"}' + 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"}' Content-Length: - '76' response: @@ -269,7 +394,7 @@ http_interactions: Server: - nginx Date: - - Wed, 06 Apr 2016 13:29:59 GMT + - Mon, 11 Apr 2016 15:43:44 GMT Content-Type: - application/json Content-Length: @@ -287,7 +412,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8Di9LpzecLQFba + - req_8FcRItYpDN04OA Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -296,13 +421,13 @@ http_interactions: encoding: UTF-8 string: | { - "id": "sub_8Di9gqPLwt5IIC", + "id": "sub_8FcRar5XrAGnL0", "object": "subscription", "application_fee_percent": null, "cancel_at_period_end": false, "canceled_at": null, - "current_period_end": 1462541399, - "current_period_start": 1459949399, + "current_period_end": 1462981423, + "current_period_start": 1460389423, "customer": "cus_8Di1wjdVktv5kt", "discount": null, "ended_at": null, @@ -322,14 +447,14 @@ http_interactions: "trial_period_days": null }, "quantity": 1, - "start": 1459949399, + "start": 1460389423, "status": "active", "tax_percent": null, "trial_end": null, "trial_start": null } http_version: - recorded_at: Wed, 06 Apr 2016 13:29:59 GMT + recorded_at: Mon, 11 Apr 2016 15:43:44 GMT - request: method: get uri: https://api.stripe.com/v1/invoices?customer=cus_8Di1wjdVktv5kt&limit=1 @@ -349,8 +474,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-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"}' + 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"}' response: status: code: 200 @@ -359,7 +484,7 @@ http_interactions: Server: - nginx Date: - - Wed, 06 Apr 2016 13:30:00 GMT + - Mon, 11 Apr 2016 15:43:47 GMT Content-Type: - application/json Content-Length: @@ -377,7 +502,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8Di9FX8V833C25 + - req_8FcRkV7kaP4d74 Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -389,17 +514,17 @@ http_interactions: "object": "list", "data": [ { - "id": "in_17xGjL2sOmf47Nz976QQJRnZ", + "id": "in_17z7CV2sOmf47Nz9GowUoPMG", "object": "invoice", "amount_due": 3000, "application_fee": null, "attempt_count": 1, "attempted": true, - "charge": "ch_17xGjL2sOmf47Nz9H8wfSmBa", + "charge": "ch_17z7CV2sOmf47Nz9v4oKnmLc", "closed": true, "currency": "usd", "customer": "cus_8Di1wjdVktv5kt", - "date": 1459949399, + "date": 1460389423, "description": null, "discount": null, "ending_balance": 0, @@ -408,7 +533,7 @@ http_interactions: "object": "list", "data": [ { - "id": "sub_8Di9gqPLwt5IIC", + "id": "sub_8FcRar5XrAGnL0", "object": "line_item", "amount": 3000, "currency": "usd", @@ -417,8 +542,8 @@ http_interactions: "livemode": false, "metadata": {}, "period": { - "start": 1459949399, - "end": 1462541399 + "start": 1460389423, + "end": 1462981423 }, "plan": { "id": "mensuel-standard-month-20160404171519", @@ -442,30 +567,30 @@ http_interactions: ], "has_more": false, "total_count": 1, - "url": "/v1/invoices/in_17xGjL2sOmf47Nz976QQJRnZ/lines" + "url": "/v1/invoices/in_17z7CV2sOmf47Nz9GowUoPMG/lines" }, "livemode": false, "metadata": {}, "next_payment_attempt": null, "paid": true, - "period_end": 1459949399, + "period_end": 1460389423, "period_start": 1459948968, "receipt_number": null, "starting_balance": 0, "statement_descriptor": null, - "subscription": "sub_8Di9gqPLwt5IIC", + "subscription": "sub_8FcRar5XrAGnL0", "subtotal": 3000, "tax": null, "tax_percent": null, "total": 3000, - "webhooks_delivered_at": 1459949399 + "webhooks_delivered_at": 1460389424 } ], "has_more": true, "url": "/v1/invoices" } http_version: - recorded_at: Wed, 06 Apr 2016 13:30:00 GMT + recorded_at: Mon, 11 Apr 2016 15:43:47 GMT - request: method: get uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt @@ -485,8 +610,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-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"}' + 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"}' response: status: code: 200 @@ -495,11 +620,11 @@ http_interactions: Server: - nginx Date: - - Wed, 06 Apr 2016 13:30:02 GMT + - Mon, 11 Apr 2016 15:43:48 GMT Content-Type: - application/json Content-Length: - - '3457' + - '6591' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -513,141 +638,166 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8Di9aIVqbT9ubZ + - req_8FcRzywC1ZKG1q Stripe-Version: - '2015-10-16' Strict-Transport-Security: - max-age=31556926; includeSubDomains body: - encoding: UTF-8 - string: | - { - "id": "cus_8Di1wjdVktv5kt", - "object": "customer", - "account_balance": 0, - "created": 1459948888, - "currency": "usd", - "default_source": "card_17xGjJ2sOmf47Nz9UrQOP8Cl", - "delinquent": false, - "description": "Jean Dupond", - "discount": null, - "email": "jean.dupond@gmail.com", - "livemode": false, - "metadata": {}, - "shipping": null, - "sources": { - "object": "list", - "data": [ - { - "id": "card_17xGjJ2sOmf47Nz9UrQOP8Cl", - "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_8Di1wjdVktv5kt", - "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_8Di1wjdVktv5kt/sources" - }, - "subscriptions": { - "object": "list", - "data": [ - { - "id": "sub_8Di9gqPLwt5IIC", - "object": "subscription", - "application_fee_percent": null, - "cancel_at_period_end": false, - "canceled_at": null, - "current_period_end": 1462541399, - "current_period_start": 1459949399, - "customer": "cus_8Di1wjdVktv5kt", - "discount": null, - "ended_at": null, - "metadata": {}, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "name": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null - }, - "quantity": 1, - "start": 1459949399, - "status": "active", - "tax_percent": null, - "trial_end": null, - "trial_start": null - }, - { - "id": "sub_8Di2VadRvr7A99", - "object": "subscription", - "application_fee_percent": null, - "cancel_at_period_end": true, - "canceled_at": 1459948972, - "current_period_end": 1462540968, - "current_period_start": 1459948968, - "customer": "cus_8Di1wjdVktv5kt", - "discount": null, - "ended_at": null, - "metadata": {}, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "name": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null - }, - "quantity": 1, - "start": 1459948968, - "status": "active", - "tax_percent": null, - "trial_end": null, - "trial_start": null - } - ], - "has_more": false, - "total_count": 2, - "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" - } - } + encoding: ASCII-8BIT + string: !binary |- + ewogICJpZCI6ICJjdXNfOERpMXdqZFZrdHY1a3QiLAogICJvYmplY3QiOiAi + Y3VzdG9tZXIiLAogICJhY2NvdW50X2JhbGFuY2UiOiAwLAogICJjcmVhdGVk + IjogMTQ1OTk0ODg4OCwKICAiY3VycmVuY3kiOiAidXNkIiwKICAiZGVmYXVs + dF9zb3VyY2UiOiAiY2FyZF8xN3o3Q1Qyc09tZjQ3Tno5d3RXa2hHb3IiLAog + ICJkZWxpbnF1ZW50IjogZmFsc2UsCiAgImRlc2NyaXB0aW9uIjogIkplYW4g + RHVwb25kIiwKICAiZGlzY291bnQiOiBudWxsLAogICJlbWFpbCI6ICJqZWFu + LmR1cG9uZEBnbWFpbC5jb20iLAogICJsaXZlbW9kZSI6IGZhbHNlLAogICJt + ZXRhZGF0YSI6IHt9LAogICJzaGlwcGluZyI6IG51bGwsCiAgInNvdXJjZXMi + OiB7CiAgICAib2JqZWN0IjogImxpc3QiLAogICAgImRhdGEiOiBbCiAgICAg + IHsKICAgICAgICAiaWQiOiAiY2FyZF8xN3o3Q1Qyc09tZjQ3Tno5d3RXa2hH + b3IiLAogICAgICAgICJvYmplY3QiOiAiY2FyZCIsCiAgICAgICAgImFkZHJl + c3NfY2l0eSI6IG51bGwsCiAgICAgICAgImFkZHJlc3NfY291bnRyeSI6IG51 + bGwsCiAgICAgICAgImFkZHJlc3NfbGluZTEiOiBudWxsLAogICAgICAgICJh + ZGRyZXNzX2xpbmUxX2NoZWNrIjogbnVsbCwKICAgICAgICAiYWRkcmVzc19s + aW5lMiI6IG51bGwsCiAgICAgICAgImFkZHJlc3Nfc3RhdGUiOiBudWxsLAog + ICAgICAgICJhZGRyZXNzX3ppcCI6IG51bGwsCiAgICAgICAgImFkZHJlc3Nf + emlwX2NoZWNrIjogbnVsbCwKICAgICAgICAiYnJhbmQiOiAiVmlzYSIsCiAg + ICAgICAgImNvdW50cnkiOiAiVVMiLAogICAgICAgICJjdXN0b21lciI6ICJj + dXNfOERpMXdqZFZrdHY1a3QiLAogICAgICAgICJjdmNfY2hlY2siOiAicGFz + cyIsCiAgICAgICAgImR5bmFtaWNfbGFzdDQiOiBudWxsLAogICAgICAgICJl + eHBfbW9udGgiOiA0LAogICAgICAgICJleHBfeWVhciI6IDIwMTcsCiAgICAg + ICAgImZpbmdlcnByaW50IjogIm81Mmp5YlI3Ym5tTm42QVQiLAogICAgICAg + ICJmdW5kaW5nIjogImNyZWRpdCIsCiAgICAgICAgImxhc3Q0IjogIjQyNDIi + LAogICAgICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAgICJuYW1lIjogbnVs + bCwKICAgICAgICAidG9rZW5pemF0aW9uX21ldGhvZCI6IG51bGwKICAgICAg + fQogICAgXSwKICAgICJoYXNfbW9yZSI6IGZhbHNlLAogICAgInRvdGFsX2Nv + dW50IjogMSwKICAgICJ1cmwiOiAiL3YxL2N1c3RvbWVycy9jdXNfOERpMXdq + ZFZrdHY1a3Qvc291cmNlcyIKICB9LAogICJzdWJzY3JpcHRpb25zIjogewog + ICAgIm9iamVjdCI6ICJsaXN0IiwKICAgICJkYXRhIjogWwogICAgICB7CiAg + ICAgICAgImlkIjogInN1Yl84RmNSYXI1WHJBR25MMCIsCiAgICAgICAgIm9i + amVjdCI6ICJzdWJzY3JpcHRpb24iLAogICAgICAgICJhcHBsaWNhdGlvbl9m + ZWVfcGVyY2VudCI6IG51bGwsCiAgICAgICAgImNhbmNlbF9hdF9wZXJpb2Rf + ZW5kIjogZmFsc2UsCiAgICAgICAgImNhbmNlbGVkX2F0IjogbnVsbCwKICAg + ICAgICAiY3VycmVudF9wZXJpb2RfZW5kIjogMTQ2Mjk4MTQyMywKICAgICAg + ICAiY3VycmVudF9wZXJpb2Rfc3RhcnQiOiAxNDYwMzg5NDIzLAogICAgICAg + ICJjdXN0b21lciI6ICJjdXNfOERpMXdqZFZrdHY1a3QiLAogICAgICAgICJk + aXNjb3VudCI6IG51bGwsCiAgICAgICAgImVuZGVkX2F0IjogbnVsbCwKICAg + ICAgICAibWV0YWRhdGEiOiB7fSwKICAgICAgICAicGxhbiI6IHsKICAgICAg + ICAgICJpZCI6ICJtZW5zdWVsLXN0YW5kYXJkLW1vbnRoLTIwMTYwNDA0MTcx + NTE5IiwKICAgICAgICAgICJvYmplY3QiOiAicGxhbiIsCiAgICAgICAgICAi + YW1vdW50IjogMzAwMCwKICAgICAgICAgICJjcmVhdGVkIjogMTQ1OTc4Mjky + MSwKICAgICAgICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAgICAgICAgImlu + dGVydmFsIjogIm1vbnRoIiwKICAgICAgICAgICJpbnRlcnZhbF9jb3VudCI6 + IDEsCiAgICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICAgICAgICJt + ZXRhZGF0YSI6IHt9LAogICAgICAgICAgIm5hbWUiOiAiTWVuc3VlbCAtIHN0 + YW5kYXJkLCBhc3NvY2lhdGlvbiAtIG1vbnRoIiwKICAgICAgICAgICJzdGF0 + ZW1lbnRfZGVzY3JpcHRvciI6IG51bGwsCiAgICAgICAgICAidHJpYWxfcGVy + aW9kX2RheXMiOiBudWxsCiAgICAgICAgfSwKICAgICAgICAicXVhbnRpdHki + OiAxLAogICAgICAgICJzdGFydCI6IDE0NjAzODk0MjMsCiAgICAgICAgInN0 + YXR1cyI6ICJhY3RpdmUiLAogICAgICAgICJ0YXhfcGVyY2VudCI6IG51bGws + CiAgICAgICAgInRyaWFsX2VuZCI6IG51bGwsCiAgICAgICAgInRyaWFsX3N0 + YXJ0IjogbnVsbAogICAgICB9LAogICAgICB7CiAgICAgICAgImlkIjogInN1 + Yl84RTFhZmtUQm4yZGMxRCIsCiAgICAgICAgIm9iamVjdCI6ICJzdWJzY3Jp + cHRpb24iLAogICAgICAgICJhcHBsaWNhdGlvbl9mZWVfcGVyY2VudCI6IG51 + bGwsCiAgICAgICAgImNhbmNlbF9hdF9wZXJpb2RfZW5kIjogdHJ1ZSwKICAg + ICAgICAiY2FuY2VsZWRfYXQiOiAxNDYwMDIxNjcwLAogICAgICAgICJjdXJy + ZW50X3BlcmlvZF9lbmQiOiAxNDYyNjEzNjY1LAogICAgICAgICJjdXJyZW50 + X3BlcmlvZF9zdGFydCI6IDE0NjAwMjE2NjUsCiAgICAgICAgImN1c3RvbWVy + IjogImN1c184RGkxd2pkVmt0djVrdCIsCiAgICAgICAgImRpc2NvdW50Ijog + bnVsbCwKICAgICAgICAiZW5kZWRfYXQiOiBudWxsLAogICAgICAgICJtZXRh + ZGF0YSI6IHt9LAogICAgICAgICJwbGFuIjogewogICAgICAgICAgImlkIjog + Im1lbnN1ZWwtdGFyaWYtcmVkdWl0LXN0dWRlbnQtbW9udGgtMjAxNjA0MDQx + NzE4MjciLAogICAgICAgICAgIm9iamVjdCI6ICJwbGFuIiwKICAgICAgICAg + ICJhbW91bnQiOiAyMDAwLAogICAgICAgICAgImNyZWF0ZWQiOiAxNDU5Nzgz + MTA4LAogICAgICAgICAgImN1cnJlbmN5IjogInVzZCIsCiAgICAgICAgICAi + aW50ZXJ2YWwiOiAibW9udGgiLAogICAgICAgICAgImludGVydmFsX2NvdW50 + IjogMSwKICAgICAgICAgICJsaXZlbW9kZSI6IGZhbHNlLAogICAgICAgICAg + Im1ldGFkYXRhIjoge30sCiAgICAgICAgICAibmFtZSI6ICJNZW5zdWVsIHRh + cmlmIHLDqWR1aXQgLSDDqXR1ZGlhbnQsIC0gZGUgMjUgYW5zLCBlbnNlaWdu + YW50LCBkZW1hbmRldXIgZCdlbXBsb2kgLSBtb250aCIsCiAgICAgICAgICAi + c3RhdGVtZW50X2Rlc2NyaXB0b3IiOiBudWxsLAogICAgICAgICAgInRyaWFs + X3BlcmlvZF9kYXlzIjogbnVsbAogICAgICAgIH0sCiAgICAgICAgInF1YW50 + aXR5IjogMSwKICAgICAgICAic3RhcnQiOiAxNDYwMDIxNjY1LAogICAgICAg + ICJzdGF0dXMiOiAiYWN0aXZlIiwKICAgICAgICAidGF4X3BlcmNlbnQiOiBu + dWxsLAogICAgICAgICJ0cmlhbF9lbmQiOiBudWxsLAogICAgICAgICJ0cmlh + bF9zdGFydCI6IG51bGwKICAgICAgfSwKICAgICAgewogICAgICAgICJpZCI6 + ICJzdWJfOERrcUJjUjFiUXZyNUciLAogICAgICAgICJvYmplY3QiOiAic3Vi + c2NyaXB0aW9uIiwKICAgICAgICAiYXBwbGljYXRpb25fZmVlX3BlcmNlbnQi + OiBudWxsLAogICAgICAgICJjYW5jZWxfYXRfcGVyaW9kX2VuZCI6IHRydWUs + CiAgICAgICAgImNhbmNlbGVkX2F0IjogMTQ1OTk1OTM4NiwKICAgICAgICAi + Y3VycmVudF9wZXJpb2RfZW5kIjogMTQ2MjU1MTM4MiwKICAgICAgICAiY3Vy + cmVudF9wZXJpb2Rfc3RhcnQiOiAxNDU5OTU5MzgyLAogICAgICAgICJjdXN0 + b21lciI6ICJjdXNfOERpMXdqZFZrdHY1a3QiLAogICAgICAgICJkaXNjb3Vu + dCI6IG51bGwsCiAgICAgICAgImVuZGVkX2F0IjogbnVsbCwKICAgICAgICAi + bWV0YWRhdGEiOiB7fSwKICAgICAgICAicGxhbiI6IHsKICAgICAgICAgICJp + ZCI6ICJtZW5zdWVsLXN0YW5kYXJkLW1vbnRoLTIwMTYwNDA0MTcxNTE5IiwK + ICAgICAgICAgICJvYmplY3QiOiAicGxhbiIsCiAgICAgICAgICAiYW1vdW50 + IjogMzAwMCwKICAgICAgICAgICJjcmVhdGVkIjogMTQ1OTc4MjkyMSwKICAg + ICAgICAgICJjdXJyZW5jeSI6ICJ1c2QiLAogICAgICAgICAgImludGVydmFs + IjogIm1vbnRoIiwKICAgICAgICAgICJpbnRlcnZhbF9jb3VudCI6IDEsCiAg + ICAgICAgICAibGl2ZW1vZGUiOiBmYWxzZSwKICAgICAgICAgICJtZXRhZGF0 + YSI6IHt9LAogICAgICAgICAgIm5hbWUiOiAiTWVuc3VlbCAtIHN0YW5kYXJk + LCBhc3NvY2lhdGlvbiAtIG1vbnRoIiwKICAgICAgICAgICJzdGF0ZW1lbnRf + ZGVzY3JpcHRvciI6IG51bGwsCiAgICAgICAgICAidHJpYWxfcGVyaW9kX2Rh + eXMiOiBudWxsCiAgICAgICAgfSwKICAgICAgICAicXVhbnRpdHkiOiAxLAog + ICAgICAgICJzdGFydCI6IDE0NTk5NTkzODIsCiAgICAgICAgInN0YXR1cyI6 + ICJhY3RpdmUiLAogICAgICAgICJ0YXhfcGVyY2VudCI6IG51bGwsCiAgICAg + ICAgInRyaWFsX2VuZCI6IG51bGwsCiAgICAgICAgInRyaWFsX3N0YXJ0Ijog + bnVsbAogICAgICB9LAogICAgICB7CiAgICAgICAgImlkIjogInN1Yl84RGk5 + Z3FQTHd0NUlJQyIsCiAgICAgICAgIm9iamVjdCI6ICJzdWJzY3JpcHRpb24i + LAogICAgICAgICJhcHBsaWNhdGlvbl9mZWVfcGVyY2VudCI6IG51bGwsCiAg + ICAgICAgImNhbmNlbF9hdF9wZXJpb2RfZW5kIjogdHJ1ZSwKICAgICAgICAi + Y2FuY2VsZWRfYXQiOiAxNDU5OTQ5NDA0LAogICAgICAgICJjdXJyZW50X3Bl + cmlvZF9lbmQiOiAxNDYyNTQxMzk5LAogICAgICAgICJjdXJyZW50X3Blcmlv + ZF9zdGFydCI6IDE0NTk5NDkzOTksCiAgICAgICAgImN1c3RvbWVyIjogImN1 + c184RGkxd2pkVmt0djVrdCIsCiAgICAgICAgImRpc2NvdW50IjogbnVsbCwK + ICAgICAgICAiZW5kZWRfYXQiOiBudWxsLAogICAgICAgICJtZXRhZGF0YSI6 + IHt9LAogICAgICAgICJwbGFuIjogewogICAgICAgICAgImlkIjogIm1lbnN1 + ZWwtc3RhbmRhcmQtbW9udGgtMjAxNjA0MDQxNzE1MTkiLAogICAgICAgICAg + Im9iamVjdCI6ICJwbGFuIiwKICAgICAgICAgICJhbW91bnQiOiAzMDAwLAog + ICAgICAgICAgImNyZWF0ZWQiOiAxNDU5NzgyOTIxLAogICAgICAgICAgImN1 + cnJlbmN5IjogInVzZCIsCiAgICAgICAgICAiaW50ZXJ2YWwiOiAibW9udGgi + LAogICAgICAgICAgImludGVydmFsX2NvdW50IjogMSwKICAgICAgICAgICJs + aXZlbW9kZSI6IGZhbHNlLAogICAgICAgICAgIm1ldGFkYXRhIjoge30sCiAg + ICAgICAgICAibmFtZSI6ICJNZW5zdWVsIC0gc3RhbmRhcmQsIGFzc29jaWF0 + aW9uIC0gbW9udGgiLAogICAgICAgICAgInN0YXRlbWVudF9kZXNjcmlwdG9y + IjogbnVsbCwKICAgICAgICAgICJ0cmlhbF9wZXJpb2RfZGF5cyI6IG51bGwK + ICAgICAgICB9LAogICAgICAgICJxdWFudGl0eSI6IDEsCiAgICAgICAgInN0 + YXJ0IjogMTQ1OTk0OTM5OSwKICAgICAgICAic3RhdHVzIjogImFjdGl2ZSIs + CiAgICAgICAgInRheF9wZXJjZW50IjogbnVsbCwKICAgICAgICAidHJpYWxf + ZW5kIjogbnVsbCwKICAgICAgICAidHJpYWxfc3RhcnQiOiBudWxsCiAgICAg + IH0sCiAgICAgIHsKICAgICAgICAiaWQiOiAic3ViXzhEaTJWYWRSdnI3QTk5 + IiwKICAgICAgICAib2JqZWN0IjogInN1YnNjcmlwdGlvbiIsCiAgICAgICAg + ImFwcGxpY2F0aW9uX2ZlZV9wZXJjZW50IjogbnVsbCwKICAgICAgICAiY2Fu + Y2VsX2F0X3BlcmlvZF9lbmQiOiB0cnVlLAogICAgICAgICJjYW5jZWxlZF9h + dCI6IDE0NTk5NDg5NzIsCiAgICAgICAgImN1cnJlbnRfcGVyaW9kX2VuZCI6 + IDE0NjI1NDA5NjgsCiAgICAgICAgImN1cnJlbnRfcGVyaW9kX3N0YXJ0Ijog + MTQ1OTk0ODk2OCwKICAgICAgICAiY3VzdG9tZXIiOiAiY3VzXzhEaTF3amRW + a3R2NWt0IiwKICAgICAgICAiZGlzY291bnQiOiBudWxsLAogICAgICAgICJl + bmRlZF9hdCI6IG51bGwsCiAgICAgICAgIm1ldGFkYXRhIjoge30sCiAgICAg + ICAgInBsYW4iOiB7CiAgICAgICAgICAiaWQiOiAibWVuc3VlbC1zdGFuZGFy + ZC1tb250aC0yMDE2MDQwNDE3MTUxOSIsCiAgICAgICAgICAib2JqZWN0Ijog + InBsYW4iLAogICAgICAgICAgImFtb3VudCI6IDMwMDAsCiAgICAgICAgICAi + Y3JlYXRlZCI6IDE0NTk3ODI5MjEsCiAgICAgICAgICAiY3VycmVuY3kiOiAi + dXNkIiwKICAgICAgICAgICJpbnRlcnZhbCI6ICJtb250aCIsCiAgICAgICAg + ICAiaW50ZXJ2YWxfY291bnQiOiAxLAogICAgICAgICAgImxpdmVtb2RlIjog + ZmFsc2UsCiAgICAgICAgICAibWV0YWRhdGEiOiB7fSwKICAgICAgICAgICJu + YW1lIjogIk1lbnN1ZWwgLSBzdGFuZGFyZCwgYXNzb2NpYXRpb24gLSBtb250 + aCIsCiAgICAgICAgICAic3RhdGVtZW50X2Rlc2NyaXB0b3IiOiBudWxsLAog + ICAgICAgICAgInRyaWFsX3BlcmlvZF9kYXlzIjogbnVsbAogICAgICAgIH0s + CiAgICAgICAgInF1YW50aXR5IjogMSwKICAgICAgICAic3RhcnQiOiAxNDU5 + OTQ4OTY4LAogICAgICAgICJzdGF0dXMiOiAiYWN0aXZlIiwKICAgICAgICAi + dGF4X3BlcmNlbnQiOiBudWxsLAogICAgICAgICJ0cmlhbF9lbmQiOiBudWxs + LAogICAgICAgICJ0cmlhbF9zdGFydCI6IG51bGwKICAgICAgfQogICAgXSwK + ICAgICJoYXNfbW9yZSI6IGZhbHNlLAogICAgInRvdGFsX2NvdW50IjogNSwK + ICAgICJ1cmwiOiAiL3YxL2N1c3RvbWVycy9jdXNfOERpMXdqZFZrdHY1a3Qv + c3Vic2NyaXB0aW9ucyIKICB9Cn0K http_version: - recorded_at: Wed, 06 Apr 2016 13:30:02 GMT + recorded_at: Mon, 11 Apr 2016 15:43:48 GMT - request: method: get - uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions/sub_8Di9gqPLwt5IIC + uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions/sub_8FcRar5XrAGnL0 body: encoding: US-ASCII string: '' @@ -664,8 +814,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-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"}' + 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"}' response: status: code: 200 @@ -674,7 +824,7 @@ http_interactions: Server: - nginx Date: - - Wed, 06 Apr 2016 13:30:03 GMT + - Mon, 11 Apr 2016 15:43:48 GMT Content-Type: - application/json Content-Length: @@ -692,7 +842,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8Di9AyPG0FJYAw + - req_8FcRg1EQDVfpku Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -701,13 +851,13 @@ http_interactions: encoding: UTF-8 string: | { - "id": "sub_8Di9gqPLwt5IIC", + "id": "sub_8FcRar5XrAGnL0", "object": "subscription", "application_fee_percent": null, "cancel_at_period_end": false, "canceled_at": null, - "current_period_end": 1462541399, - "current_period_start": 1459949399, + "current_period_end": 1462981423, + "current_period_start": 1460389423, "customer": "cus_8Di1wjdVktv5kt", "discount": null, "ended_at": null, @@ -727,17 +877,17 @@ http_interactions: "trial_period_days": null }, "quantity": 1, - "start": 1459949399, + "start": 1460389423, "status": "active", "tax_percent": null, "trial_end": null, "trial_start": null } http_version: - recorded_at: Wed, 06 Apr 2016 13:30:03 GMT + recorded_at: Mon, 11 Apr 2016 15:43:49 GMT - request: method: delete - uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions/sub_8Di9gqPLwt5IIC?at_period_end=true + uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions/sub_8FcRar5XrAGnL0?at_period_end=true body: encoding: US-ASCII string: '' @@ -754,8 +904,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-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"}' + 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"}' response: status: code: 200 @@ -764,7 +914,7 @@ http_interactions: Server: - nginx Date: - - Wed, 06 Apr 2016 13:30:04 GMT + - Mon, 11 Apr 2016 15:43:49 GMT Content-Type: - application/json Content-Length: @@ -782,7 +932,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8Di9ujL9MyuuZS + - req_8FcRvdzGhluZiD Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -791,13 +941,13 @@ http_interactions: encoding: UTF-8 string: | { - "id": "sub_8Di9gqPLwt5IIC", + "id": "sub_8FcRar5XrAGnL0", "object": "subscription", "application_fee_percent": null, "cancel_at_period_end": true, - "canceled_at": 1459949404, - "current_period_end": 1462541399, - "current_period_start": 1459949399, + "canceled_at": 1460389429, + "current_period_end": 1462981423, + "current_period_start": 1460389423, "customer": "cus_8Di1wjdVktv5kt", "discount": null, "ended_at": null, @@ -817,12 +967,12 @@ http_interactions: "trial_period_days": null }, "quantity": 1, - "start": 1459949399, + "start": 1460389423, "status": "active", "tax_percent": null, "trial_end": null, "trial_start": null } http_version: - recorded_at: Wed, 06 Apr 2016 13:30:04 GMT + 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 5fb22c749..4597cfc7b 100644 --- a/test/vcr_cassettes/subscriptions_user_renew_failed.yml +++ b/test/vcr_cassettes/subscriptions_user_renew_failed.yml @@ -1,5 +1,67 @@ --- http_interactions: +- request: + method: get + uri: https://api.stripe.com/v1/tokens/invalid_card_token + 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_mGokO9TGtrVxMOyK4yZiktBE + 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.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"}' + response: + status: + code: 400 + message: Bad Request + headers: + Server: + - nginx + Date: + - Mon, 11 Apr 2016 15:47:34 GMT + Content-Type: + - application/json + Content-Length: + - '131' + 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_8FcVweUogPiUZf + Stripe-Version: + - '2015-10-16' + body: + encoding: UTF-8 + string: | + { + "error": { + "type": "invalid_request_error", + "message": "No such token: invalid_card_token", + "param": "token" + } + } + http_version: + recorded_at: Mon, 11 Apr 2016 15:47:34 GMT - request: method: get uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX @@ -19,8 +81,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-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"}' + 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"}' response: status: code: 200 @@ -29,11 +91,11 @@ http_interactions: Server: - nginx Date: - - Thu, 07 Apr 2016 14:18:06 GMT + - Mon, 11 Apr 2016 15:47:35 GMT Content-Type: - application/json Content-Length: - - '3454' + - '5504' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -47,7 +109,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8E69echXR3qGGa + - req_8FcV6gxRsSzUbZ Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -61,7 +123,7 @@ http_interactions: "account_balance": 0, "created": 1460026822, "currency": "usd", - "default_source": "card_17xdxN2sOmf47Nz9eyRuY12a", + "default_source": "card_17z7Ce2sOmf47Nz91IP2CV16", "delinquent": false, "description": "Lucile Seguin", "discount": null, @@ -73,7 +135,7 @@ http_interactions: "object": "list", "data": [ { - "id": "card_17xdxN2sOmf47Nz9eyRuY12a", + "id": "card_17z7Ce2sOmf47Nz91IP2CV16", "object": "card", "address_city": null, "address_country": null, @@ -105,6 +167,72 @@ http_interactions: "subscriptions": { "object": "list", "data": [ + { + "id": "sub_8FcRgFLyTO4ZeY", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": true, + "canceled_at": 1460389442, + "current_period_end": 1462981435, + "current_period_start": 1460389435, + "customer": "cus_8E2ys9zDZgetWX", + "discount": null, + "ended_at": null, + "metadata": {}, + "plan": { + "id": "mensuel-standard-month-20160404171519", + "object": "plan", + "amount": 3000, + "created": 1459782921, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "Mensuel - standard, association - month", + "statement_descriptor": null, + "trial_period_days": null + }, + "quantity": 1, + "start": 1460389435, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_8E6nlabIu0FNDK", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": true, + "canceled_at": 1460041071, + "current_period_end": 1462633067, + "current_period_start": 1460041067, + "customer": "cus_8E2ys9zDZgetWX", + "discount": null, + "ended_at": null, + "metadata": {}, + "plan": { + "id": "mensuel-standard-month-20160404171519", + "object": "plan", + "amount": 3000, + "created": 1459782921, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "Mensuel - standard, association - month", + "statement_descriptor": null, + "trial_period_days": null + }, + "quantity": 1, + "start": 1460041067, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + }, { "id": "sub_8E694MZ1FBtXBg", "object": "subscription", @@ -173,12 +301,12 @@ http_interactions: } ], "has_more": false, - "total_count": 2, + "total_count": 4, "url": "/v1/customers/cus_8E2ys9zDZgetWX/subscriptions" } } http_version: - recorded_at: Thu, 07 Apr 2016 14:18:06 GMT + recorded_at: Mon, 11 Apr 2016 15:47:35 GMT - request: method: post uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX/subscriptions @@ -198,8 +326,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-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"}' + 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"}' Content-Length: - '66' response: @@ -210,7 +338,7 @@ http_interactions: Server: - nginx Date: - - Thu, 07 Apr 2016 14:18:07 GMT + - Mon, 11 Apr 2016 15:47:36 GMT Content-Type: - application/json Content-Length: @@ -228,7 +356,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8E69jMRCeshYc1 + - req_8FcVzLJ4tiRJHF Stripe-Version: - '2015-10-16' body: @@ -242,5 +370,5 @@ http_interactions: } } http_version: - recorded_at: Thu, 07 Apr 2016 14:18:07 GMT + recorded_at: Mon, 11 Apr 2016 15:47:36 GMT recorded_with: VCR 3.0.1 diff --git a/test/vcr_cassettes/subscriptions_user_renew_success.yml b/test/vcr_cassettes/subscriptions_user_renew_success.yml index eb3cdfa25..f406f04f1 100644 --- a/test/vcr_cassettes/subscriptions_user_renew_success.yml +++ b/test/vcr_cassettes/subscriptions_user_renew_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-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"}' + 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"}' Content-Length: - '81' response: @@ -31,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Thu, 07 Apr 2016 14:57:45 GMT + - Mon, 11 Apr 2016 15:43:52 GMT Content-Type: - application/json Content-Length: - - '780' + - '779' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -49,7 +49,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8E6ntokZYBap5o + - req_8FcRua6xeSWJgP Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -58,10 +58,10 @@ http_interactions: encoding: UTF-8 string: | { - "id": "tok_17xeZp2sOmf47Nz9U7isup9R", + "id": "tok_17z7Ce2sOmf47Nz9tArxQ9hI", "object": "token", "card": { - "id": "card_17xeZp2sOmf47Nz9Nw38pLma", + "id": "card_17z7Ce2sOmf47Nz91IP2CV16", "object": "card", "address_city": null, "address_country": null, @@ -84,17 +84,17 @@ http_interactions: "name": null, "tokenization_method": null }, - "client_ip": "90.52.157.226", - "created": 1460041065, + "client_ip": "90.42.87.235", + "created": 1460389432, "livemode": false, "type": "card", "used": false } http_version: - recorded_at: Thu, 07 Apr 2016 14:57:45 GMT + recorded_at: Mon, 11 Apr 2016 15:43:52 GMT - request: method: get - uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX + uri: https://api.stripe.com/v1/tokens/tok_17z7Ce2sOmf47Nz9tArxQ9hI body: encoding: US-ASCII string: '' @@ -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-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"}' + 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"}' response: status: code: 200 @@ -121,11 +121,11 @@ http_interactions: Server: - nginx Date: - - Thu, 07 Apr 2016 14:57:46 GMT + - Mon, 11 Apr 2016 15:43:53 GMT Content-Type: - application/json Content-Length: - - '3454' + - '779' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -139,7 +139,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8E6nN7HdnY2Zr2 + - req_8FcRynHazNvAUI Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -148,357 +148,40 @@ http_interactions: encoding: UTF-8 string: | { - "id": "cus_8E2ys9zDZgetWX", - "object": "customer", - "account_balance": 0, - "created": 1460026822, - "currency": "usd", - "default_source": "card_17xdxN2sOmf47Nz9eyRuY12a", - "delinquent": false, - "description": "Lucile Seguin", - "discount": null, - "email": "lucile.seguin@live.fr", - "livemode": false, - "metadata": {}, - "shipping": null, - "sources": { - "object": "list", - "data": [ - { - "id": "card_17xdxN2sOmf47Nz9eyRuY12a", - "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_8E2ys9zDZgetWX", - "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_8E2ys9zDZgetWX/sources" - }, - "subscriptions": { - "object": "list", - "data": [ - { - "id": "sub_8E694MZ1FBtXBg", - "object": "subscription", - "application_fee_percent": null, - "cancel_at_period_end": false, - "canceled_at": null, - "current_period_end": 1462630683, - "current_period_start": 1460038683, - "customer": "cus_8E2ys9zDZgetWX", - "discount": null, - "ended_at": null, - "metadata": {}, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "name": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null - }, - "quantity": 1, - "start": 1460038683, - "status": "active", - "tax_percent": null, - "trial_end": null, - "trial_start": null - }, - { - "id": "sub_8E67Z0lSjjVxBn", - "object": "subscription", - "application_fee_percent": null, - "cancel_at_period_end": false, - "canceled_at": null, - "current_period_end": 1462630527, - "current_period_start": 1460038527, - "customer": "cus_8E2ys9zDZgetWX", - "discount": null, - "ended_at": null, - "metadata": {}, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "name": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null - }, - "quantity": 1, - "start": 1460038527, - "status": "active", - "tax_percent": null, - "trial_end": null, - "trial_start": null - } - ], - "has_more": false, - "total_count": 2, - "url": "/v1/customers/cus_8E2ys9zDZgetWX/subscriptions" - } - } - http_version: - recorded_at: Thu, 07 Apr 2016 14:57:46 GMT -- request: - method: post - uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX/subscriptions - body: - encoding: UTF-8 - string: plan=mensuel-standard-month-20160404171519&card=tok_17xeZp2sOmf47Nz9U7isup9R - headers: - Accept: - - "*/*; q=0.5, application/xml" - Accept-Encoding: - - gzip, deflate - User-Agent: - - Stripe/v1 RubyBindings/1.30.2 - Authorization: - - Bearer sk_test_mGokO9TGtrVxMOyK4yZiktBE - 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 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"}' - Content-Length: - - '76' - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Thu, 07 Apr 2016 14:57:47 GMT - Content-Type: - - application/json - Content-Length: - - '821' - 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_8E6nkvdYjkxZ3A - Stripe-Version: - - '2015-10-16' - Strict-Transport-Security: - - max-age=31556926; includeSubDomains - body: - encoding: UTF-8 - string: | - { - "id": "sub_8E6nlabIu0FNDK", - "object": "subscription", - "application_fee_percent": null, - "cancel_at_period_end": false, - "canceled_at": null, - "current_period_end": 1462633067, - "current_period_start": 1460041067, - "customer": "cus_8E2ys9zDZgetWX", - "discount": null, - "ended_at": null, - "metadata": {}, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, + "id": "tok_17z7Ce2sOmf47Nz9tArxQ9hI", + "object": "token", + "card": { + "id": "card_17z7Ce2sOmf47Nz91IP2CV16", + "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": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null + "name": null, + "tokenization_method": null }, - "quantity": 1, - "start": 1460041067, - "status": "active", - "tax_percent": null, - "trial_end": null, - "trial_start": null + "client_ip": "90.42.87.235", + "created": 1460389432, + "livemode": false, + "type": "card", + "used": false } http_version: - recorded_at: Thu, 07 Apr 2016 14:57:47 GMT -- request: - method: get - uri: https://api.stripe.com/v1/invoices?customer=cus_8E2ys9zDZgetWX&limit=1 - 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_mGokO9TGtrVxMOyK4yZiktBE - 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 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"}' - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Thu, 07 Apr 2016 14:57:48 GMT - Content-Type: - - application/json - Content-Length: - - '2207' - 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_8E6nsHStsgJ8uR - Stripe-Version: - - '2015-10-16' - Strict-Transport-Security: - - max-age=31556926; includeSubDomains - body: - encoding: UTF-8 - string: | - { - "object": "list", - "data": [ - { - "id": "in_17xeZr2sOmf47Nz9JTOtgIXv", - "object": "invoice", - "amount_due": 3000, - "application_fee": null, - "attempt_count": 1, - "attempted": true, - "charge": "ch_17xeZr2sOmf47Nz9KgHCuwK0", - "closed": true, - "currency": "usd", - "customer": "cus_8E2ys9zDZgetWX", - "date": 1460041067, - "description": null, - "discount": null, - "ending_balance": 0, - "forgiven": false, - "lines": { - "object": "list", - "data": [ - { - "id": "sub_8E6nlabIu0FNDK", - "object": "line_item", - "amount": 3000, - "currency": "usd", - "description": null, - "discountable": true, - "livemode": false, - "metadata": {}, - "period": { - "start": 1460041067, - "end": 1462633067 - }, - "plan": { - "id": "mensuel-standard-month-20160404171519", - "object": "plan", - "amount": 3000, - "created": 1459782921, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "name": "Mensuel - standard, association - month", - "statement_descriptor": null, - "trial_period_days": null - }, - "proration": false, - "quantity": 1, - "subscription": null, - "type": "subscription" - } - ], - "has_more": false, - "total_count": 1, - "url": "/v1/invoices/in_17xeZr2sOmf47Nz9JTOtgIXv/lines" - }, - "livemode": false, - "metadata": {}, - "next_payment_attempt": null, - "paid": true, - "period_end": 1460041067, - "period_start": 1460038527, - "receipt_number": null, - "starting_balance": 0, - "statement_descriptor": null, - "subscription": "sub_8E6nlabIu0FNDK", - "subtotal": 3000, - "tax": null, - "tax_percent": null, - "total": 3000, - "webhooks_delivered_at": 1460041067 - } - ], - "has_more": true, - "url": "/v1/invoices" - } - http_version: - recorded_at: Thu, 07 Apr 2016 14:57:48 GMT + recorded_at: Mon, 11 Apr 2016 15:43:53 GMT - request: method: get uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX @@ -518,8 +201,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-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"}' + 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"}' response: status: code: 200 @@ -528,11 +211,11 @@ http_interactions: Server: - nginx Date: - - Thu, 07 Apr 2016 14:57:49 GMT + - Mon, 11 Apr 2016 15:43:54 GMT Content-Type: - application/json Content-Length: - - '4474' + - '4479' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -546,7 +229,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8E6nTDGRZ4k0vh + - req_8FcRHlSiyZJDhh Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -608,8 +291,8 @@ http_interactions: "id": "sub_8E6nlabIu0FNDK", "object": "subscription", "application_fee_percent": null, - "cancel_at_period_end": false, - "canceled_at": null, + "cancel_at_period_end": true, + "canceled_at": 1460041071, "current_period_end": 1462633067, "current_period_start": 1460041067, "customer": "cus_8E2ys9zDZgetWX", @@ -710,13 +393,13 @@ http_interactions: } } http_version: - recorded_at: Thu, 07 Apr 2016 14:57:49 GMT + recorded_at: Mon, 11 Apr 2016 15:43:54 GMT - request: - method: get - uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX/subscriptions/sub_8E6nlabIu0FNDK + method: post + uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX/subscriptions body: - encoding: US-ASCII - string: '' + encoding: UTF-8 + string: plan=mensuel-standard-month-20160404171519&card=tok_17z7Ce2sOmf47Nz9tArxQ9hI headers: Accept: - "*/*; q=0.5, application/xml" @@ -730,8 +413,10 @@ 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-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"}' + 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"}' + Content-Length: + - '76' response: status: code: 200 @@ -740,7 +425,7 @@ http_interactions: Server: - nginx Date: - - Thu, 07 Apr 2016 14:57:50 GMT + - Mon, 11 Apr 2016 15:43:55 GMT Content-Type: - application/json Content-Length: @@ -758,7 +443,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8E6nOZSSSXyv3E + - req_8FcR3oaI9ppgXN Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -767,13 +452,13 @@ http_interactions: encoding: UTF-8 string: | { - "id": "sub_8E6nlabIu0FNDK", + "id": "sub_8FcRgFLyTO4ZeY", "object": "subscription", "application_fee_percent": null, "cancel_at_period_end": false, "canceled_at": null, - "current_period_end": 1462633067, - "current_period_start": 1460041067, + "current_period_end": 1462981435, + "current_period_start": 1460389435, "customer": "cus_8E2ys9zDZgetWX", "discount": null, "ended_at": null, @@ -793,17 +478,17 @@ http_interactions: "trial_period_days": null }, "quantity": 1, - "start": 1460041067, + "start": 1460389435, "status": "active", "tax_percent": null, "trial_end": null, "trial_start": null } http_version: - recorded_at: Thu, 07 Apr 2016 14:57:50 GMT + recorded_at: Mon, 11 Apr 2016 15:43:55 GMT - request: - method: delete - uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX/subscriptions/sub_8E6nlabIu0FNDK?at_period_end=true + method: get + uri: https://api.stripe.com/v1/invoices?customer=cus_8E2ys9zDZgetWX&limit=1 body: encoding: US-ASCII string: '' @@ -820,8 +505,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-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"}' + 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"}' response: status: code: 200 @@ -830,7 +515,478 @@ http_interactions: Server: - nginx Date: - - Thu, 07 Apr 2016 14:57:51 GMT + - Mon, 11 Apr 2016 15:44:00 GMT + Content-Type: + - application/json + Content-Length: + - '2207' + 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_8FcRYAHuZb5cyO + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "object": "list", + "data": [ + { + "id": "in_17z7Ch2sOmf47Nz9q4hc7msO", + "object": "invoice", + "amount_due": 3000, + "application_fee": null, + "attempt_count": 1, + "attempted": true, + "charge": "ch_17z7Ch2sOmf47Nz9HcBWY6sb", + "closed": true, + "currency": "usd", + "customer": "cus_8E2ys9zDZgetWX", + "date": 1460389435, + "description": null, + "discount": null, + "ending_balance": 0, + "forgiven": false, + "lines": { + "object": "list", + "data": [ + { + "id": "sub_8FcRgFLyTO4ZeY", + "object": "line_item", + "amount": 3000, + "currency": "usd", + "description": null, + "discountable": true, + "livemode": false, + "metadata": {}, + "period": { + "start": 1460389435, + "end": 1462981435 + }, + "plan": { + "id": "mensuel-standard-month-20160404171519", + "object": "plan", + "amount": 3000, + "created": 1459782921, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "Mensuel - standard, association - month", + "statement_descriptor": null, + "trial_period_days": null + }, + "proration": false, + "quantity": 1, + "subscription": null, + "type": "subscription" + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/invoices/in_17z7Ch2sOmf47Nz9q4hc7msO/lines" + }, + "livemode": false, + "metadata": {}, + "next_payment_attempt": null, + "paid": true, + "period_end": 1460389435, + "period_start": 1460038527, + "receipt_number": null, + "starting_balance": 0, + "statement_descriptor": null, + "subscription": "sub_8FcRgFLyTO4ZeY", + "subtotal": 3000, + "tax": null, + "tax_percent": null, + "total": 3000, + "webhooks_delivered_at": 1460389435 + } + ], + "has_more": true, + "url": "/v1/invoices" + } + http_version: + recorded_at: Mon, 11 Apr 2016 15:44:00 GMT +- request: + method: get + uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX + 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_mGokO9TGtrVxMOyK4yZiktBE + 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.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"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 11 Apr 2016 15:44:00 GMT + Content-Type: + - application/json + Content-Length: + - '5499' + 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_8FcRYEKmK6OB6n + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "cus_8E2ys9zDZgetWX", + "object": "customer", + "account_balance": 0, + "created": 1460026822, + "currency": "usd", + "default_source": "card_17z7Ce2sOmf47Nz91IP2CV16", + "delinquent": false, + "description": "Lucile Seguin", + "discount": null, + "email": "lucile.seguin@live.fr", + "livemode": false, + "metadata": {}, + "shipping": null, + "sources": { + "object": "list", + "data": [ + { + "id": "card_17z7Ce2sOmf47Nz91IP2CV16", + "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_8E2ys9zDZgetWX", + "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_8E2ys9zDZgetWX/sources" + }, + "subscriptions": { + "object": "list", + "data": [ + { + "id": "sub_8FcRgFLyTO4ZeY", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": false, + "canceled_at": null, + "current_period_end": 1462981435, + "current_period_start": 1460389435, + "customer": "cus_8E2ys9zDZgetWX", + "discount": null, + "ended_at": null, + "metadata": {}, + "plan": { + "id": "mensuel-standard-month-20160404171519", + "object": "plan", + "amount": 3000, + "created": 1459782921, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "Mensuel - standard, association - month", + "statement_descriptor": null, + "trial_period_days": null + }, + "quantity": 1, + "start": 1460389435, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_8E6nlabIu0FNDK", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": true, + "canceled_at": 1460041071, + "current_period_end": 1462633067, + "current_period_start": 1460041067, + "customer": "cus_8E2ys9zDZgetWX", + "discount": null, + "ended_at": null, + "metadata": {}, + "plan": { + "id": "mensuel-standard-month-20160404171519", + "object": "plan", + "amount": 3000, + "created": 1459782921, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "Mensuel - standard, association - month", + "statement_descriptor": null, + "trial_period_days": null + }, + "quantity": 1, + "start": 1460041067, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_8E694MZ1FBtXBg", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": false, + "canceled_at": null, + "current_period_end": 1462630683, + "current_period_start": 1460038683, + "customer": "cus_8E2ys9zDZgetWX", + "discount": null, + "ended_at": null, + "metadata": {}, + "plan": { + "id": "mensuel-standard-month-20160404171519", + "object": "plan", + "amount": 3000, + "created": 1459782921, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "Mensuel - standard, association - month", + "statement_descriptor": null, + "trial_period_days": null + }, + "quantity": 1, + "start": 1460038683, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_8E67Z0lSjjVxBn", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": false, + "canceled_at": null, + "current_period_end": 1462630527, + "current_period_start": 1460038527, + "customer": "cus_8E2ys9zDZgetWX", + "discount": null, + "ended_at": null, + "metadata": {}, + "plan": { + "id": "mensuel-standard-month-20160404171519", + "object": "plan", + "amount": 3000, + "created": 1459782921, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "Mensuel - standard, association - month", + "statement_descriptor": null, + "trial_period_days": null + }, + "quantity": 1, + "start": 1460038527, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + } + ], + "has_more": false, + "total_count": 4, + "url": "/v1/customers/cus_8E2ys9zDZgetWX/subscriptions" + } + } + http_version: + recorded_at: Mon, 11 Apr 2016 15:44:01 GMT +- request: + method: get + uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX/subscriptions/sub_8FcRgFLyTO4ZeY + 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_mGokO9TGtrVxMOyK4yZiktBE + 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.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"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 11 Apr 2016 15:44:01 GMT + Content-Type: + - application/json + Content-Length: + - '821' + 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_8FcRuKDuUfa7Gd + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "sub_8FcRgFLyTO4ZeY", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": false, + "canceled_at": null, + "current_period_end": 1462981435, + "current_period_start": 1460389435, + "customer": "cus_8E2ys9zDZgetWX", + "discount": null, + "ended_at": null, + "metadata": {}, + "plan": { + "id": "mensuel-standard-month-20160404171519", + "object": "plan", + "amount": 3000, + "created": 1459782921, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "Mensuel - standard, association - month", + "statement_descriptor": null, + "trial_period_days": null + }, + "quantity": 1, + "start": 1460389435, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + } + http_version: + recorded_at: Mon, 11 Apr 2016 15:44:01 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX/subscriptions/sub_8FcRgFLyTO4ZeY?at_period_end=true + 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_mGokO9TGtrVxMOyK4yZiktBE + 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.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"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 11 Apr 2016 15:44:02 GMT Content-Type: - application/json Content-Length: @@ -848,7 +1004,7 @@ http_interactions: Cache-Control: - no-cache, no-store Request-Id: - - req_8E6nip0fkOtET5 + - req_8FcRLf7OAD4RGL Stripe-Version: - '2015-10-16' Strict-Transport-Security: @@ -857,13 +1013,13 @@ http_interactions: encoding: UTF-8 string: | { - "id": "sub_8E6nlabIu0FNDK", + "id": "sub_8FcRgFLyTO4ZeY", "object": "subscription", "application_fee_percent": null, "cancel_at_period_end": true, - "canceled_at": 1460041071, - "current_period_end": 1462633067, - "current_period_start": 1460041067, + "canceled_at": 1460389442, + "current_period_end": 1462981435, + "current_period_start": 1460389435, "customer": "cus_8E2ys9zDZgetWX", "discount": null, "ended_at": null, @@ -883,12 +1039,12 @@ http_interactions: "trial_period_days": null }, "quantity": 1, - "start": 1460041067, + "start": 1460389435, "status": "active", "tax_percent": null, "trial_end": null, "trial_start": null } http_version: - recorded_at: Thu, 07 Apr 2016 14:57:51 GMT + recorded_at: Mon, 11 Apr 2016 15:44:02 GMT recorded_with: VCR 3.0.1