#bluelucifer32
1 messages · Page 1 of 1 (latest)
You need to attach the new card to your Customer, then call Update Subscription API with default_payment_method to the new card
how can i add that, this is what I not being able to figure out, how could i update the default payment method of existing customer from curl?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
then how can i test subscription cycle?
If it fail on the very first attempt?
i need to test on billing_reason = subscription_cycle not on subscription_created
Advance past the first creation, to like mid of first cycle
then change to this card
then advance again pass a cycle change
👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
could you please elaborate it? I am still confused
Yes @green prairie , I need to test invoice.payment_failed case for billing_reason = subscription_cycle and i am having issue on adding card as default card.
what my colleague was referring to is advancing the test clock
have you ever used test clocks before?
oh yeah sorry, just read through the conversation
so you are
then technically what needs to happen is basically you create a subscription with a valid payment method
after that
yes
you advance the clock
for a week or two
then you attach the other payment method to the customer and update the subscription to use that payment method
okay, let me try that again
and finally you advance the clock once more past the billing cycle
@solemn stratus @green prairie still not working
let me send you screen recording
- created clock
- added customer to clock with default payment menthod
- Created Subscription to product
- advance 2 weeks
- now tried to update card
now, could you please let me know on which step i am doing it wrong?
I think what's easier is to use the https://stripe.com/docs/api/setup_intents/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can't i do it the way i am doing?
I don't think it will work this way
oh wait
I just saw the card type
this will never get attached to the customer
the only that you can attach to a client is the pm_card_chargeCustomerFail
try updating the subscription and using pm_card_visa_chargeDeclinedInsufficientFunds https://stripe.com/docs/api/subscriptions/update#update_subscription-default_payment_method but I think that won't work either
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okay trying with card pm_card_chargeCustomerFail
testing