#jwerre
1 messages · Page 1 of 1 (latest)
What do you mean by simulate, here?
Do the ~same thing without a client involved?
That call uses the payment intent client secret to /confirm the payment intent:
https://stripe.com/docs/api/payment_intents/confirm
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ya... I just working on the server so
so you could use that endpoint with one of our test PMs to confirm on the server, eg provide payment_method=pm_card_visa
Right, so I could just create a Payment intent Method after I create the subscription with the Payment Intent secret returned from the subscription and a test payment method. Is that correct?
sorry... Payment method
The subscriptions first invoice already has a payment intent with a client secret, yes, so you don't need to create another
you can call /confirm for that payment intent yes
For a subscription though the PM must be attached to the subscription customer first
(because the sub > invoice > PI are all associated with a customer)
No that's only meant to be used via Stripe.js in a browser context
What are you trying to do that makes the server confirm call not a good fit?
I'm writing tests on the server and haven't started on the client side yet. My tests do the following:
- create customer
- create subscription w/ payment intent
At this point there is no card attached to the customer. So I can't really do anything else, updates etc. It's my understanding that a card is attached to the subscription with stripe.confirmCardPayment. I'm trying to simulate this on the server so I can flush out the rest of my tests. I thought I would just create a Payment Method and attach it and that would automatically pay the invoice. Then I could update the subscription's default_payment_method from the Payment Intent's payment_method. Once that's done I could flush out the rest of my test: upgrade subscription, cancel, etc..
Ah, just tested, you can do the confirm with pm_card_visa and it'll end up attaching a new card PM to the customer
What do you mean by "do the confirm"?
Something like this: curl https://api.stripe.com/v1/payment_intents/pi_.../confirm \ -u sk_test_...: \ -d payment_method=pm_card_visa
Yes, the /confirm call for the PI
gotcha... thank you!
NP!