#DrySs
1 messages ยท Page 1 of 1 (latest)
Indeed, Bancontact PMs are single use. What we do is facilitate creation of a reusable SEPA PM during the Setup Intent creation: https://stripe.com/docs/payments/bancontact/set-up-payment?platform=web#charge-sepa-pm
this what I've done to generate my SetupIntent, but the PM linked to this SetupIntent is not usable
Yes, because the payment_method field is Bancontact PM. Instead you need to look for the generated_sepa_debit field:
When you need to charge your customer again, create a new PaymentIntent. Find the ID of the SEPA Direct Debit payment method by retrieving the SetupIntent and expanding the latest_attempt field where you will find the generated_sepa_debit ID inside of payment_method_details.
While giving the field **generated_sepa_debit ** (which contains a SetupAttempt), then my **Subscription **has "Billing method: Charge default payment method", instead of "Billing method: Charge specific payment method"
"Payment method: โขโขโขโข 7061" - so the **Subscription **will not use the **SetupIntent **generated
Sounds like an issue with how you're creating the Subscription. Can you share a req_xxx ID?
Array
(
[customer] => 'cus_NjdJIjWOmCybTh'
[items] => [['plan => 'plan_Nk74jNnMk1XGJW']]
[expand] => ['latest_invoice']
[trial_period_days] => 1
)
this is a Subscription with free trial
I cannot tell him to use my SetupIntent
I have:
- Created a SetupIntent with bancontact
- Created a Subscription with free trial, but I cannot link it to the SetupIntent
- Once Subscription is created, SetupIntent is not used as a default payment method
Created a Subscription with free trial, but I cannot link it to the SetupIntent
You need to use thepm_xxxfrom thegenerated_sepa_debitfield when you create the Subscription. Pass it to thedefault_payment_methodfield
there is no generated_sepa_debit field in my SetupIntent
Did you read the link I sent? That field is on the Setup Attempt object, via the latest_attempt field which you need to expand:
When you need to charge your customer again, create a new PaymentIntent. Find the ID of the SEPA Direct Debit payment method by retrieving the SetupIntent and expanding the latest_attempt field where you will find the generated_sepa_debit ID inside of payment_method_details.
Ignore the Payment Intent part, the same applies for a Subscription
How to retrieve the **SetupAttempt **object from a **SetupIntent **? There is no method "retrieve": https://stripe.com/docs/api/setup_attempts
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 field **latest_attempt **in my **SetupIntent **contains a string: "setatt_1MyCQdCtmjWrPPfO6cOC4QGL" I cannot use as the default payment method in my Subscription, as this is not a payment method. And I cannot retrieve the **SetupAttempt **object as there is no retrieve method in API. So, I'm stuck...
It explains it on the doc I shared. You need to expand the latest_attempt field when you retrieve the Setup Intent. More on expanding objects here: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thanks, I'm trying, brb
it seem's that expand field is not working with my PHP SDK ๐
Can you share your code?
\Stripe\SetupIntent::retrieve('seti_1MysHgCtmjWrPPfOYWkjruzq', ['expand' => ['latest_attempt']]);
there is no expand field in query params
FYI I'm using "stripe/stripe-php": "^6.41",
Try:
\Stripe\SetupIntent::retrieve([
'id' => 'seti_1MysHgCtmjWrPPfOYWkjruzq',
'expand' => ['latest_attempt']
]);
it's working ๐ thanks!
np! Different syntax depending on which style of PHP you're writing
now I have my SetupAttempt, I can retrieve the payment_method and assign it as the default payment method while creating my Subscription, right?
so, with $setupIntent->latest_attempt->payment_method
it results with this error: "The customer does not have a payment method with the ID pm_1MysHxCtmjWrPPfO6Ie5PJ1b. The payment method must be attached to the customer."
No, you want this field: https://stripe.com/docs/api/setup_attempts/object#setup_attempt_object-payment_method_details-bancontact-generated_sepa_debit
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.