diff --git a/test/integration/reservations/create_test.rb b/test/integration/reservations/create_test.rb index 29818a688..f8d28f466 100644 --- a/test/integration/reservations/create_test.rb +++ b/test/integration/reservations/create_test.rb @@ -5,7 +5,7 @@ module Reservations @user_with_subscription = User.with_role(:member).with_subscription.second end - test "user without subscription reserves a machine with success" do + test 'user without subscription reserves a machine with success' do login_as(@user_without_subscription, scope: :user) machine = Machine.find(6) @@ -15,8 +15,9 @@ module Reservations invoice_count = Invoice.count invoice_items_count = InvoiceItem.count users_credit_count = UsersCredit.count + subscriptions_count = Subscription.count - VCR.use_cassette("reservations_create_for_machine_without_subscription_success") do + VCR.use_cassette('reservations_create_for_machine_without_subscription_success') do post reservations_path, { reservation: { user_id: @user_without_subscription.id, reservable_id: machine.id, @@ -37,6 +38,7 @@ module Reservations assert_equal invoice_count + 1, Invoice.count assert_equal invoice_items_count + 1, InvoiceItem.count assert_equal users_credit_count, UsersCredit.count + assert_equal subscriptions_count, Subscription.count # reservation assertions reservation = Reservation.last @@ -65,7 +67,7 @@ module Reservations assert_not_empty Notification.where(attached_object: reservation) end - test "user without subscription reserves a machine with error" do + test 'user without subscription reserves a machine with error' do login_as(@user_without_subscription, scope: :user) machine = Machine.find(6) @@ -76,7 +78,7 @@ module Reservations invoice_items_count = InvoiceItem.count notifications_count = Notification.count - VCR.use_cassette("reservations_create_for_machine_without_subscription_error") do + VCR.use_cassette('reservations_create_for_machine_without_subscription_error') do post reservations_path, { reservation: { user_id: @user_without_subscription.id, reservable_id: machine.id, @@ -99,7 +101,7 @@ module Reservations assert_equal notifications_count, Notification.count end - test "user without subscription reserves a training with success" do + test 'user without subscription reserves a training with success' do login_as(@user_without_subscription, scope: :user) training = Training.first @@ -109,7 +111,7 @@ module Reservations invoice_count = Invoice.count invoice_items_count = InvoiceItem.count - VCR.use_cassette("reservations_create_for_training_without_subscription_success") do + VCR.use_cassette('reservations_create_for_training_without_subscription_success') do post reservations_path, { reservation: { user_id: @user_without_subscription.id, reservable_id: training.id, @@ -157,7 +159,7 @@ module Reservations assert_not_empty Notification.where(attached_object: reservation) end - test "user with subscription reserves a machine with success" do + test 'user with subscription reserves a machine with success' do login_as(@user_with_subscription, scope: :user) plan = @user_with_subscription.subscribed_plan @@ -169,7 +171,7 @@ module Reservations invoice_items_count = InvoiceItem.count users_credit_count = UsersCredit.count - VCR.use_cassette("reservations_create_for_machine_with_subscription_success") do + VCR.use_cassette('reservations_create_for_machine_with_subscription_success') do post reservations_path, { reservation: { user_id: @user_with_subscription.id, reservable_id: machine.id, @@ -230,7 +232,7 @@ module Reservations assert_not_empty Notification.where(attached_object: reservation) end - test "user with subscription reserves the FIRST training with success" do + test 'user with subscription reserves the FIRST training with success' do login_as(@user_with_subscription, scope: :user) plan = @user_with_subscription.subscribed_plan plan.update!(is_rolling: true) @@ -242,7 +244,7 @@ module Reservations invoice_count = Invoice.count invoice_items_count = InvoiceItem.count - VCR.use_cassette("reservations_create_for_training_with_subscription_success") do + VCR.use_cassette('reservations_create_for_training_with_subscription_success') do post reservations_path, { reservation: { user_id: @user_with_subscription.id, reservable_id: training.id, @@ -293,7 +295,7 @@ module Reservations assert_equal reservation.slots.first.start_at + plan.duration, @user_with_subscription.subscription.expired_at end - test "user reserves a machine and pay by wallet with success" do + test 'user reserves a machine and pay by wallet with success' do @vlonchamp = User.find_by(username: 'vlonchamp') login_as(@vlonchamp, scope: :user) @@ -306,7 +308,7 @@ module Reservations users_credit_count = UsersCredit.count wallet_transactions_count = WalletTransaction.count - VCR.use_cassette("reservations_create_for_machine_and_pay_wallet_success") do + VCR.use_cassette('reservations_create_for_machine_and_pay_wallet_success') do post reservations_path, { reservation: { user_id: @vlonchamp.id, reservable_id: machine.id, @@ -364,7 +366,7 @@ module Reservations assert_equal transaction.amount, invoice.wallet_amount / 100.0 end - test "user reserves a training and plan by wallet with success" do + test 'user reserves a training and plan by wallet with success' do @vlonchamp = User.find_by(username: 'vlonchamp') login_as(@vlonchamp, scope: :user) @@ -377,7 +379,7 @@ module Reservations invoice_items_count = InvoiceItem.count wallet_transactions_count = WalletTransaction.count - VCR.use_cassette("reservations_create_for_training_and_plan_by_pay_wallet_success") do + VCR.use_cassette('reservations_create_for_training_and_plan_by_pay_wallet_success') do post reservations_path, { reservation: { user_id: @user_without_subscription.id, reservable_id: training.id, @@ -430,5 +432,90 @@ module Reservations assert_equal transaction.amount, 10 assert_equal transaction.amount, invoice.wallet_amount / 100.0 end + + test 'user reserves a machine and a subscription using a coupon with success' do + login_as(@user_without_subscription, scope: :user) + + machine = Machine.find(6) + plan = Plan.where(group_id: @user_without_subscription.group_id).first + availability = machine.availabilities.first + + reservations_count = Reservation.count + invoice_count = Invoice.count + invoice_items_count = InvoiceItem.count + subscriptions_count = Subscription.count + users_credit_count = UsersCredit.count + + VCR.use_cassette('reservations_machine_and_plan_using_coupon_success') do + post reservations_path, { + reservation: { + user_id: @user_without_subscription.id, + reservable_id: machine.id, + reservable_type: machine.class.name, + card_token: stripe_card_token, + slots_attributes: [ + { start_at: availability.start_at.to_s(:iso8601), + end_at: (availability.start_at + 1.hour).to_s(:iso8601), + availability_id: availability.id + } + ], + plan_id: plan.id + }, + coupon_code: 'SUNNYFABLAB' + }.to_json, default_headers + end + + # general assertions + assert_equal 201, response.status + assert_equal reservations_count + 1, Reservation.count + assert_equal invoice_count + 1, Invoice.count + assert_equal invoice_items_count + 2, InvoiceItem.count + assert_equal users_credit_count, UsersCredit.count + assert_equal subscriptions_count + 1, Subscription.count + + # reservation assertions + reservation = Reservation.last + + assert reservation.invoice + refute reservation.stp_invoice_id.blank? + assert_equal 2, reservation.invoice.invoice_items.count + + # invoice assertions + invoice = reservation.invoice + + refute invoice.stp_invoice_id.blank? + refute invoice.total.blank? + + # invoice_items assertions + ## reservation + reservation_item = invoice.invoice_items.where(subscription_id: nil).first + + assert_not_nil reservation_item + assert reservation_item.stp_invoice_item_id + assert_equal reservation_item.amount, machine.prices.find_by(group_id: @user_without_subscription.group_id, plan_id: plan.id).amount + ## subscription + subscription_item = invoice.invoice_items.where.not(subscription_id: nil).first + + assert_not_nil subscription_item + + subscription = Subscription.find(subscription_item.subscription_id) + + assert subscription_item.stp_invoice_item_id + assert_equal subscription_item.amount, plan.amount + assert_equal subscription.plan_id, plan.id + + # invoice assertions + invoice = Invoice.find_by(invoiced: reservation) + assert_invoice_pdf invoice + + VCR.use_cassette('reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe') do + stp_invoice = Stripe::Invoice.retrieve(invoice.stp_invoice_id) + assert_equal stp_invoice.total, invoice.total + end + + # notifications + assert_not_empty Notification.where(attached_object: reservation) + assert_not_empty Notification.where(attached_object: subscription) + end end end diff --git a/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml new file mode 100644 index 000000000..561b23ffc --- /dev/null +++ b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml @@ -0,0 +1,189 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.stripe.com/v1/invoices/in_18rNSq2sOmf47Nz91hxlGSa7 + 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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 12:25:04 GMT + Content-Type: + - application/json + Content-Length: + - '3362' + 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_99l6aCLd0IC3Qn + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "in_18rNSq2sOmf47Nz91hxlGSa7", + "object": "invoice", + "amount_due": 3825, + "application_fee": null, + "attempt_count": 1, + "attempted": true, + "charge": "ch_18rNSq2sOmf47Nz9Z8EuuyI8", + "closed": true, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "date": 1473321652, + "description": null, + "discount": null, + "ending_balance": 0, + "forgiven": false, + "lines": { + "object": "list", + "data": [ + { + "id": "ii_18rNSp2sOmf47Nz9S0rJVP2a", + "object": "line_item", + "amount": -450, + "currency": "usd", + "description": "coupon SUNNYFABLAB", + "discountable": false, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321651, + "end": 1473321651 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null, + "type": "invoiceitem" + }, + { + "id": "ii_18rNSm2sOmf47Nz9R11Svoer", + "object": "line_item", + "amount": -225, + "currency": "usd", + "description": "coupon SUNNYFABLAB", + "discountable": false, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321648, + "end": 1473321648 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null, + "type": "invoiceitem" + }, + { + "id": "ii_18rNSm2sOmf47Nz9avgL9KyW", + "object": "line_item", + "amount": 1500, + "currency": "usd", + "description": "FORM1+ imprimante 3D September 04, 2016 14:00 - 03:00 PM", + "discountable": true, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321648, + "end": 1473321648 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null, + "type": "invoiceitem" + }, + { + "id": "sub_99gqb47NmX9r79", + "object": "line_item", + "amount": 3000, + "currency": "usd", + "description": null, + "discountable": true, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321652, + "end": 1475913652 + }, + "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": 4, + "url": "/v1/invoices/in_18rNSq2sOmf47Nz91hxlGSa7/lines" + }, + "livemode": false, + "metadata": {}, + "next_payment_attempt": null, + "paid": true, + "period_end": 1473321652, + "period_start": 1473321652, + "receipt_number": null, + "starting_balance": 0, + "statement_descriptor": null, + "subscription": "sub_99gqb47NmX9r79", + "subtotal": 3825, + "tax": null, + "tax_percent": null, + "total": 3825, + "webhooks_delivered_at": 1473321652 + } + http_version: + recorded_at: Thu, 08 Sep 2016 12:25:04 GMT +recorded_with: VCR 3.0.1 diff --git a/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml new file mode 100644 index 000000000..6cce6aa21 --- /dev/null +++ b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml @@ -0,0 +1,1334 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/tokens + body: + encoding: UTF-8 + string: card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2017&card[cvc]=314 + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '81' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:47 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_99gqPbGrfRTnyZ + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "tok_18rNSl2sOmf47Nz9cTGhyMRc", + "object": "token", + "card": { + "id": "card_18rNSk2sOmf47Nz9h1cf7obf", + "object": "card", + "address_city": null, + "address_country": null, + "address_line1": null, + "address_line1_check": null, + "address_line2": null, + "address_state": null, + "address_zip": null, + "address_zip_check": null, + "brand": "Visa", + "country": "US", + "cvc_check": "unchecked", + "dynamic_last4": null, + "exp_month": 4, + "exp_year": 2017, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "last4": "4242", + "metadata": {}, + "name": null, + "tokenization_method": null + }, + "client_ip": "90.52.44.103", + "created": 1473321647, + "livemode": false, + "type": "card", + "used": false + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:47 GMT +- request: + method: post + uri: https://api.stripe.com/v1/invoiceitems + body: + encoding: UTF-8 + string: customer=cus_8Di1wjdVktv5kt&amount=1500¤cy=usd&description=FORM1%2B+imprimante+3D+September+04%2C+2016+14%3A00+-+03%3A00+PM + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Stripe/v1 RubyBindings/1.30.2 + Authorization: + - Bearer sk_test_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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '129' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:48 GMT + Content-Type: + - application/json + Content-Length: + - '473' + 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_99gqddasRVKxn2 + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "ii_18rNSm2sOmf47Nz9avgL9KyW", + "object": "invoiceitem", + "amount": 1500, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "date": 1473321648, + "description": "FORM1+ imprimante 3D September 04, 2016 14:00 - 03:00 PM", + "discountable": true, + "invoice": null, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321648, + "end": 1473321648 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:48 GMT +- request: + method: post + uri: https://api.stripe.com/v1/invoiceitems + body: + encoding: UTF-8 + string: customer=cus_8Di1wjdVktv5kt&amount=-225¤cy=usd&description=coupon+SUNNYFABLAB + 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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '83' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:48 GMT + Content-Type: + - application/json + Content-Length: + - '436' + 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_99gq27qOy8Dn3R + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "ii_18rNSm2sOmf47Nz9R11Svoer", + "object": "invoiceitem", + "amount": -225, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "date": 1473321648, + "description": "coupon SUNNYFABLAB", + "discountable": false, + "invoice": null, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321648, + "end": 1473321648 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:49 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 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:49 GMT + Content-Type: + - application/json + Content-Length: + - '1408' + 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_99gqbfntlVYpyJ + 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_17z7CT2sOmf47Nz9wtWkhGor", + "delinquent": false, + "description": "Jean Dupond", + "discount": null, + "email": "jean.dupond@gmail.com", + "livemode": false, + "metadata": {}, + "shipping": null, + "sources": { + "object": "list", + "data": [ + { + "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", + "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": [], + "has_more": false, + "total_count": 0, + "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" + } + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:49 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 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:50 GMT + Content-Type: + - application/json + Content-Length: + - '1408' + 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_99gqvJz00HL9sk + 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_17z7CT2sOmf47Nz9wtWkhGor", + "delinquent": false, + "description": "Jean Dupond", + "discount": null, + "email": "jean.dupond@gmail.com", + "livemode": false, + "metadata": {}, + "shipping": null, + "sources": { + "object": "list", + "data": [ + { + "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", + "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": [], + "has_more": false, + "total_count": 0, + "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" + } + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:50 GMT +- request: + method: post + uri: https://api.stripe.com/v1/invoiceitems + body: + encoding: UTF-8 + string: customer=cus_8Di1wjdVktv5kt&amount=-450¤cy=usd&description=coupon+SUNNYFABLAB + 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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '83' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:51 GMT + Content-Type: + - application/json + Content-Length: + - '436' + 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_99gq9UCtuA1CdL + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "ii_18rNSp2sOmf47Nz9S0rJVP2a", + "object": "invoiceitem", + "amount": -450, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "date": 1473321651, + "description": "coupon SUNNYFABLAB", + "discountable": false, + "invoice": null, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321651, + "end": 1473321651 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:51 GMT +- request: + method: post + uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions + body: + encoding: UTF-8 + string: plan=mensuel-standard-month-20160404171519&source=tok_18rNSl2sOmf47Nz9cTGhyMRc + 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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + Content-Length: + - '78' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:52 GMT + Content-Type: + - application/json + Content-Length: + - '867' + 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_99gq6A5SZpD1qQ + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "sub_99gqb47NmX9r79", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": false, + "canceled_at": null, + "created": 1473321652, + "current_period_end": 1475913652, + "current_period_start": 1473321652, + "customer": "cus_8Di1wjdVktv5kt", + "discount": null, + "ended_at": null, + "livemode": false, + "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": 1473321652, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:53 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 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:53 GMT + Content-Type: + - application/json + Content-Length: + - '3963' + 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_99gqm0fOzzj3EP + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "object": "list", + "data": [ + { + "id": "in_18rNSq2sOmf47Nz91hxlGSa7", + "object": "invoice", + "amount_due": 3825, + "application_fee": null, + "attempt_count": 1, + "attempted": true, + "charge": "ch_18rNSq2sOmf47Nz9Z8EuuyI8", + "closed": true, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "date": 1473321652, + "description": null, + "discount": null, + "ending_balance": 0, + "forgiven": false, + "lines": { + "object": "list", + "data": [ + { + "id": "ii_18rNSp2sOmf47Nz9S0rJVP2a", + "object": "line_item", + "amount": -450, + "currency": "usd", + "description": "coupon SUNNYFABLAB", + "discountable": false, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321651, + "end": 1473321651 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null, + "type": "invoiceitem" + }, + { + "id": "ii_18rNSm2sOmf47Nz9R11Svoer", + "object": "line_item", + "amount": -225, + "currency": "usd", + "description": "coupon SUNNYFABLAB", + "discountable": false, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321648, + "end": 1473321648 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null, + "type": "invoiceitem" + }, + { + "id": "ii_18rNSm2sOmf47Nz9avgL9KyW", + "object": "line_item", + "amount": 1500, + "currency": "usd", + "description": "FORM1+ imprimante 3D September 04, 2016 14:00 - 03:00 PM", + "discountable": true, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321648, + "end": 1473321648 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null, + "type": "invoiceitem" + }, + { + "id": "sub_99gqb47NmX9r79", + "object": "line_item", + "amount": 3000, + "currency": "usd", + "description": null, + "discountable": true, + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321652, + "end": 1475913652 + }, + "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": 4, + "url": "/v1/invoices/in_18rNSq2sOmf47Nz91hxlGSa7/lines" + }, + "livemode": false, + "metadata": {}, + "next_payment_attempt": null, + "paid": true, + "period_end": 1473321652, + "period_start": 1473321652, + "receipt_number": null, + "starting_balance": 0, + "statement_descriptor": null, + "subscription": "sub_99gqb47NmX9r79", + "subtotal": 3825, + "tax": null, + "tax_percent": null, + "total": 3825, + "webhooks_delivered_at": 1473321652 + } + ], + "has_more": true, + "url": "/v1/invoices" + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:53 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 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:54 GMT + Content-Type: + - application/json + Content-Length: + - '2490' + 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_99gqRCzmQJIDBa + 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_18rNSk2sOmf47Nz9h1cf7obf", + "delinquent": false, + "description": "Jean Dupond", + "discount": null, + "email": "jean.dupond@gmail.com", + "livemode": false, + "metadata": {}, + "shipping": null, + "sources": { + "object": "list", + "data": [ + { + "id": "card_18rNSk2sOmf47Nz9h1cf7obf", + "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_99gqb47NmX9r79", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": false, + "canceled_at": null, + "created": 1473321652, + "current_period_end": 1475913652, + "current_period_start": 1473321652, + "customer": "cus_8Di1wjdVktv5kt", + "discount": null, + "ended_at": null, + "livemode": false, + "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": 1473321652, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/customers/cus_8Di1wjdVktv5kt/subscriptions" + } + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:54 GMT +- request: + method: get + uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions/sub_99gqb47NmX9r79 + 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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:55 GMT + Content-Type: + - application/json + Content-Length: + - '867' + 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_99gqhmTVKcwbNF + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "sub_99gqb47NmX9r79", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": false, + "canceled_at": null, + "created": 1473321652, + "current_period_end": 1475913652, + "current_period_start": 1473321652, + "customer": "cus_8Di1wjdVktv5kt", + "discount": null, + "ended_at": null, + "livemode": false, + "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": 1473321652, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:55 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/customers/cus_8Di1wjdVktv5kt/subscriptions/sub_99gqb47NmX9r79?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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:56 GMT + Content-Type: + - application/json + Content-Length: + - '872' + 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_99gqPGBMCEM6Ec + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "sub_99gqb47NmX9r79", + "object": "subscription", + "application_fee_percent": null, + "cancel_at_period_end": true, + "canceled_at": 1473321656, + "created": 1473321652, + "current_period_end": 1475913652, + "current_period_start": 1473321652, + "customer": "cus_8Di1wjdVktv5kt", + "discount": null, + "ended_at": null, + "livemode": false, + "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": 1473321652, + "status": "active", + "tax_percent": null, + "trial_end": null, + "trial_start": null + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:57 GMT +- request: + method: get + uri: https://api.stripe.com/v1/invoiceitems/ii_18rNSm2sOmf47Nz9avgL9KyW + 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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:58 GMT + Content-Type: + - application/json + Content-Length: + - '498' + 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_99gqJIQqEHVCZ0 + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "ii_18rNSm2sOmf47Nz9avgL9KyW", + "object": "invoiceitem", + "amount": 1500, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "date": 1473321648, + "description": "FORM1+ imprimante 3D September 04, 2016 14:00 - 03:00 PM", + "discountable": true, + "invoice": "in_18rNSq2sOmf47Nz91hxlGSa7", + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321648, + "end": 1473321648 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:58 GMT +- request: + method: get + uri: https://api.stripe.com/v1/invoiceitems/ii_18rNSm2sOmf47Nz9avgL9KyW + 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.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu + 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016","hostname":"sylvain-sleede-pc"}' + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Thu, 08 Sep 2016 08:00:58 GMT + Content-Type: + - application/json + Content-Length: + - '498' + 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_99gqJk9T35fI7H + Stripe-Version: + - '2015-10-16' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains + body: + encoding: UTF-8 + string: | + { + "id": "ii_18rNSm2sOmf47Nz9avgL9KyW", + "object": "invoiceitem", + "amount": 1500, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "date": 1473321648, + "description": "FORM1+ imprimante 3D September 04, 2016 14:00 - 03:00 PM", + "discountable": true, + "invoice": "in_18rNSq2sOmf47Nz91hxlGSa7", + "livemode": false, + "metadata": {}, + "period": { + "start": 1473321648, + "end": 1473321648 + }, + "plan": null, + "proration": false, + "quantity": null, + "subscription": null + } + http_version: + recorded_at: Thu, 08 Sep 2016 08:00:58 GMT +recorded_with: VCR 3.0.1