#.fallenblade
1 messages · Page 1 of 1 (latest)
hello! did you create and attach a card to the customer?
How do you attach a card to the customer? I thought it will be automatically attached once the payment succeeded?
then can you share the PaymentIntent id where you collected payment? I'll be able to take a closer look at what you're doing from that
Okay, here:
{
"id": "pi_3O60dgDbxJ8mKm370G0qa6Jr",
"object": "payment_intent",
"amount": 100,
"amount_details": {
"tip": {
}
},
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3O**********************_******_*********************CxvN",
"confirmation_method": "automatic",
"created": 1698453872,
"currency": "usd",
"description": "Subscription creation",
"last_payment_error": null,
"livemode": false,
"next_action": null,
"payment_method": "pm_1O60diDbxJ8mKm37X7rR7HFr",
"payment_method_configuration_details": null,
"payment_method_options": {
"us_bank_account": {
"verification_method": "automatic"
}
},
"payment_method_types": [
"card",
"cashapp",
"link",
"us_bank_account"
],
"processing": null,
"receipt_email": "******@gmail.com",
"setup_future_usage": "off_session",
"shipping": null,
"source": null,
"status": "succeeded"
}
The PaymentMethod is already attached to the customer. It's saved as the default_payment_method on the Subscription because you set payment_settings.save_default_payment_method = on_subscription [0]
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The PaymentMethod will only show under invoice_settings.default_payment_method if you explicitly set it [1]
[1] https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.