#DrySs

1 messages ยท Page 1 of 1 (latest)

thick dawnBOT
quick geode
fringe gorge
#

this what I've done to generate my SetupIntent, but the PM linked to this SetupIntent is not usable

quick geode
#

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.

fringe gorge
#

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

quick geode
#

Sounds like an issue with how you're creating the Subscription. Can you share a req_xxx ID?

fringe gorge
#

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:

  1. Created a SetupIntent with bancontact
  2. Created a Subscription with free trial, but I cannot link it to the SetupIntent
  3. Once Subscription is created, SetupIntent is not used as a default payment method
quick geode
#

Created a Subscription with free trial, but I cannot link it to the SetupIntent
You need to use the pm_xxx from the generated_sepa_debit field when you create the Subscription. Pass it to the default_payment_method field

fringe gorge
#

there is no generated_sepa_debit field in my SetupIntent

quick geode
#

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

fringe gorge
#

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...

quick geode
fringe gorge
#

thanks, I'm trying, brb

#

it seem's that expand field is not working with my PHP SDK ๐Ÿ˜•

quick geode
#

Can you share your code?

fringe gorge
#

\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",

quick geode
#

Try:

\Stripe\SetupIntent::retrieve([
  'id' => 'seti_1MysHgCtmjWrPPfOYWkjruzq',
  'expand' => ['latest_attempt']
]);
fringe gorge
#

it's working ๐Ÿ™‚ thanks!

quick geode
#

np! Different syntax depending on which style of PHP you're writing

fringe gorge
#

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."

quick geode
fringe gorge
#

it's working!

#

thanks so much for your help and sorry for my misunderstood