#Franck-sepa

1 messages · Page 1 of 1 (latest)

quick beacon
#

Hi! Can you share the SetupIntent ID (seti_xxx)?

molten rampart
#

Hello seti_1KRvlmKoWdWpF648XnZpf3Px

#

and here is the post on the customer that failed req_RdPNq1BsBaZvwT

#

the usage of the setupintent is off_session I thought this would fallback to a reusable payment_method

quick beacon
#

Thanks! Give me a few minutes to look into this.

frosty kraken
#

you can't attach iDEAL PaymentMethods to customers so that error is expected

#

also you never call that API when you're using a SetupIntent, since the SetupIntent attaches the method for you(you pass it a Customer ID when creating it, usually), you don't need that call at all

#

other than that I'm a bit lost, maybe you could share the exact part of the docs you're reading that talks about 'fallbacks'?

molten rampart
#

I'm talking about this part of the documentation

#

In our current flow we attach the payment_method after it's being created because we do it in backend side 😅

#

There is no way with the setup intent to get a payment_method that is reusable with the customer sepa ?

frosty kraken
#

there is!

#

it's the generated_sepa_debit field from the SetupAttempt

molten rampart
#

Okay I see ! But I still don't find the generated_sepa_debit field

#

with this code

#
Stripe::setApiKey('{{sk_key}}');
$setupIntent = SetupIntent::retrieve("seti_1KRvlmKoWdWpF648XnZpf3Px", ['expand' => ['latest_attempt']]);
var_dump($setupIntent);
#

I get this

#

object(Stripe\SetupIntent)#291 (21) {
["id"]=>
string(29) "seti_1KRvlmKoWdWpF648XnZpf3Px"
["object"]=>
string(12) "setup_intent"
["application"]=>
NULL
["cancellation_reason"]=>
NULL
["client_secret"]=>
string(68) "seti_1KRvlmKoWdWpF648XnZpf3Px_secret_L8CAqAl8XzqL9cfqbvxTPVqLSeZZKKo"
["created"]=>
int(1644573026)
["customer"]=>
NULL
["description"]=>
NULL
["last_setup_error"]=>
NULL
["latest_attempt"]=>
string(31) "setatt_1KRvlxKoWdWpF648zr4rUmV4"
["livemode"]=>
bool(false)
["mandate"]=>
NULL
["metadata"]=>
object(Stripe\StripeObject)#23 (0) {
}
["next_action"]=>
NULL
["on_behalf_of"]=>
NULL
["payment_method"]=>
string(27) "pm_1KRvlxKoWdWpF648qmC8ASGP"
["payment_method_options"]=>
object(Stripe\StripeObject)#24 (1) {
["card"]=>
object(Stripe\StripeObject)#32 (1) {
["request_three_d_secure"]=>
string(9) "automatic"
}
}
["payment_method_types"]=>
array(4) {
[0]=>
string(4) "card"
[1]=>
string(5) "ideal"
[2]=>
string(10) "bancontact"
[3]=>
string(6) "sofort"
}
["single_use_mandate"]=>
NULL
["status"]=>
string(9) "succeeded"
["usage"]=>
string(11) "off_session"
}

#

In the latest_attempt I get "setatt_1KRvlxKoWdWpF648zr4rUmV4"

frosty kraken
#

try logging $setup_intent->latest_attempt->payment_method_details;

molten rampart
#

I get NULL in this case

#

maybe because we did not perform any payment with it at the moment ?

frosty kraken
#

probably!

#

that SetpIntent is completed now at least

#

so everything I see indicates you should be able to get the generated_sepa_debit_id

molten rampart
#

Yes that's what I need ^^

frosty kraken
#

there's no reason for $setup_intent->latest_attempt->payment_method_details; to be null

#

so it should just work really. Try running the code again

#

oh I know

#

$setupIntent = SetupIntent::retrieve(['id' => "seti_1KRvlmKoWdWpF648XnZpf3Px", 'expand' => ['latest_attempt']]);

#

do that instead, the expand doesn't work properly when passing the ID the other way I think

molten rampart
#

Perfect !

  ["ideal"]=>
  object(Stripe\StripeObject)#33 (6) {
    ["bank"]=>
    string(8) "rabobank"
    ["bic"]=>
    string(8) "RABONL2U"
    ["generated_sepa_debit"]=>
    string(27) "pm_1KRvm3KoWdWpF648cDchcdPW"
    ["generated_sepa_debit_mandate"]=>
    string(32) "mandate_1KRvm3KoWdWpF648lYfdwET9"
    ["iban_last4"]=>
    string(4) "5264"
    ["verified_name"]=>
    string(11) "Jenny Rosen"
  }
  ["type"]=>
  string(5) "ideal"
}```
frosty kraken
#

great!