#Bruno777

1 messages · Page 1 of 1 (latest)

violet dustBOT
brazen nest
#

Hi there!

#

How did you accept the first payment? Checkout Session, PaymentIntent, something else?

worldly heart
#

PaymentIntent

#

and just before \Stripe\Customer::create

brazen nest
worldly heart
#

Ok thanks

brazen nest
#
const paymentIntent = await stripe.paymentIntents.create({
    amount: 1099,
    currency: 'eur',
    customer: '{{CUSTOMER_ID}}',
    payment_method: '{{PAYMENT_METHOD_ID}}',
    off_session: true,
    confirm: true,
});
worldly heart
#

And for subscriptions in PaymentIntent you advise me to indicate which method ?

brazen nest
#

What do you mean? If you are creating subscriptions, then the next payments will be managed by Stripe automatically

worldly heart
#

I don't want to manage payments with webhooks... I prefer to do it how I want on my end.

trim nest
#

For that first payment, are you confirming the payment intent client side or server side? Webhooks are highly recommended if you are confirming payment intents client side, otherwise it is possible to charge a user but not get the message that their payment succeeded

worldly heart
#

In your example to indicate that you have to specify {{PAYMENT_METHOD_ID}}
How do I retrieve this {{PAYMENT_METHOD_ID}}?

trim nest
#

That is the ID of the payment method from steps 1-6 in that guide. You can save and retrieve it however you would like. One thing you can do is save the payment method's ID in your customer's invoice_settings.default_payment_method field which is the field Stripe uses to charge for subscriptions https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method

worldly heart
trim nest