Created
August 23, 2014 01:21
-
-
Save jimdanz/cbfff1d825f7f2e58296 to your computer and use it in GitHub Desktop.
testing failed subscription payment on trial_end=now
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Jims-MacBook-Pro:~ jim$ curl https://api.stripe.com/v1/customers -d plan=Armada -d trial_end=1408771198 -d card[number]=4000000000000341 -d card[exp_month]=05 -d card[exp_year]=2019 -u sk_test_****: | |
| { | |
| "object": "customer", | |
| "created": 1408756242, | |
| "id": "cus_4dkYctG1ff2ReZ", | |
| "livemode": false, | |
| "description": null, | |
| "email": null, | |
| "delinquent": false, | |
| "metadata": {}, | |
| "subscriptions": { | |
| "object": "list", | |
| "total_count": 1, | |
| "has_more": false, | |
| "url": "/v1/customers/cus_4dkYctG1ff2ReZ/subscriptions", | |
| "data": [ | |
| { | |
| "id": "sub_4dkYIqEE49O3as", | |
| "plan": { | |
| "interval": "month", | |
| "name": "armada", | |
| "created": 1386909046, | |
| "amount": 3450, | |
| "currency": "usd", | |
| "id": "Armada", | |
| "object": "plan", | |
| "livemode": false, | |
| "interval_count": 1, | |
| "trial_period_days": null, | |
| "metadata": {}, | |
| "statement_description": null | |
| }, | |
| "object": "subscription", | |
| "start": 1408756242, | |
| "status": "trialing", | |
| "customer": "cus_4dkYctG1ff2ReZ", | |
| "cancel_at_period_end": false, | |
| "current_period_start": 1408756242, | |
| "current_period_end": 1408771198, | |
| "ended_at": null, | |
| "trial_start": 1408756242, | |
| "trial_end": 1408771198, | |
| "canceled_at": null, | |
| "quantity": 1, | |
| "application_fee_percent": null, | |
| "discount": null, | |
| "metadata": {} | |
| } | |
| ], | |
| "count": 1 | |
| }, | |
| "discount": null, | |
| "account_balance": 0, | |
| "currency": "usd", | |
| "cards": { | |
| "object": "list", | |
| "total_count": 1, | |
| "has_more": false, | |
| "url": "/v1/customers/cus_4dkYctG1ff2ReZ/cards", | |
| "data": [ | |
| { | |
| "id": "card_4dkY4Wbnf5NeRA", | |
| "object": "card", | |
| "last4": "0341", | |
| "brand": "Visa", | |
| "funding": "credit", | |
| "exp_month": 5, | |
| "exp_year": 2019, | |
| "fingerprint": "bYaPDwFdk8JzzIGM", | |
| "country": "US", | |
| "name": null, | |
| "address_line1": null, | |
| "address_line2": null, | |
| "address_city": null, | |
| "address_state": null, | |
| "address_zip": null, | |
| "address_country": null, | |
| "cvc_check": null, | |
| "address_line1_check": null, | |
| "address_zip_check": null, | |
| "customer": "cus_4dkYctG1ff2ReZ", | |
| "type": "Visa" | |
| } | |
| ], | |
| "count": 1 | |
| }, | |
| "default_card": "card_4dkY4Wbnf5NeRA", | |
| "subscription": { | |
| "id": "sub_4dkYIqEE49O3as", | |
| "plan": { | |
| "interval": "month", | |
| "name": "armada", | |
| "created": 1386909046, | |
| "amount": 3450, | |
| "currency": "usd", | |
| "id": "Armada", | |
| "object": "plan", | |
| "livemode": false, | |
| "interval_count": 1, | |
| "trial_period_days": null, | |
| "metadata": {}, | |
| "statement_description": null | |
| }, | |
| "object": "subscription", | |
| "start": 1408756242, | |
| "status": "trialing", | |
| "customer": "cus_4dkYctG1ff2ReZ", | |
| "cancel_at_period_end": false, | |
| "current_period_start": 1408756242, | |
| "current_period_end": 1408771198, | |
| "ended_at": null, | |
| "trial_start": 1408756242, | |
| "trial_end": 1408771198, | |
| "canceled_at": null, | |
| "quantity": 1, | |
| "application_fee_percent": null, | |
| "discount": null, | |
| "metadata": {} | |
| } | |
| } | |
| Jims-MacBook-Pro:~ jim$ curl https://api.stripe.com/v1/customers -d plan=Armada -d trial_end=1408771198 -d card[number]=4000000000000341 -d card[exp_month]=05 -d card[exp_year]=2019 -u sk_test_****: | |
| Jims-MacBook-Pro:~ jim$ curl https://api.stripe.com/v1/invoiceitems -d customer=cus_4dkYctG1ff2ReZ -dsubscription=sub_4dkYIqEE49O3as -d amount=50 -d currency=usd -u sk_test_****: | |
| { | |
| "object": "invoiceitem", | |
| "id": "ii_4dkZdCa8tNmUCf", | |
| "date": 1408756321, | |
| "amount": 50, | |
| "livemode": false, | |
| "proration": false, | |
| "currency": "usd", | |
| "customer": "cus_4dkYctG1ff2ReZ", | |
| "description": null, | |
| "metadata": {}, | |
| "invoice": null, | |
| "subscription": "sub_4dkYIqEE49O3as" | |
| } | |
| Jims-MacBook-Pro:~ jim$ curl https://api.stripe.com/v1/invoiceitems -d customer=cus_4dkYctG1ff2ReZ -dsubscription=sub_4dkYIqEE49O3as -d amount=50 -d currency=usd -u sk_test_****: | |
| { | |
| "object": "invoiceitem", | |
| "id": "ii_4dkZbljU2xjDOy", | |
| "date": 1408756323, | |
| "amount": 50, | |
| "livemode": false, | |
| "proration": false, | |
| "currency": "usd", | |
| "customer": "cus_4dkYctG1ff2ReZ", | |
| "description": null, | |
| "metadata": {}, | |
| "invoice": null, | |
| "subscription": "sub_4dkYIqEE49O3as" | |
| } | |
| Jims-MacBook-Pro:~ jim$ curl https://api.stripe.com/v1/customers/cus_4dkYctG1ff2ReZ/subscriptions/sub_4dkYIqEE49O3as -d trial_end=now -u sk_test_****: | |
| { | |
| "error": { | |
| "message": "Your card was declined.", | |
| "type": "card_error", | |
| "code": "card_declined", | |
| } | |
| } | |
| Jims-MacBook-Pro:~ jim$ curl https://api.stripe.com/v1/customers/cus_4dkYctG1ff2ReZ/subscriptions/sub_4dkYIqEE49O3as -u sk_test_****: | |
| { | |
| "id": "sub_4dkYIqEE49O3as", | |
| "plan": { | |
| "interval": "month", | |
| "name": "armada", | |
| "created": 1386909046, | |
| "amount": 3450, | |
| "currency": "usd", | |
| "id": "Armada", | |
| "object": "plan", | |
| "livemode": false, | |
| "interval_count": 1, | |
| "trial_period_days": null, | |
| "metadata": {}, | |
| "statement_description": null | |
| }, | |
| "object": "subscription", | |
| "start": 1408756242, | |
| "status": "trialing", | |
| "customer": "cus_4dkYctG1ff2ReZ", | |
| "cancel_at_period_end": false, | |
| "current_period_start": 1408756242, | |
| "current_period_end": 1408771198, | |
| "ended_at": null, | |
| "trial_start": 1408756242, | |
| "trial_end": 1408771198, | |
| "canceled_at": null, | |
| "quantity": 1, | |
| "application_fee_percent": null, | |
| "discount": null, | |
| "metadata": {} | |
| } | |
| Jims-MacBook-Pro:~ jim$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment