#Shivam Kumar
1 messages · Page 1 of 1 (latest)
👋 happy to help
but this docs for platform customer not for connect customer account.
I am taking about this docs but this is not working for me.
https://stripe.com/docs/payments/payment-methods/connect
the part of the doc I sent you concerns connect
You can collect customer bank accounts on the platform account and clone ACH Direct debit payment methods. Cloning these methods allows you to save customer bank accounts for later use on connected accounts. When you clone ACH Direct Debit payment methods, Stripe duplicates the mandate authorization to the connected account, but we don’t send any new mandate confirmation emails.
I read docs propely and i implement this code but i got error
if(auth()->user()->stripe_customer_id){
This code for getting client secret from serve side
if(!auth()->user()->stripe_customer_id){
$customer = $stripe->customers->create([
'name' => auth()->user()->full_name,
'email' => auth()->user()->email
],
['stripe_account' => auth()->user()->stripe_connect_account_id]
);
$user->stripe_customer_id = $customer->id;
$user->save();
}
$setup_intent = $stripe->setupIntents->create(
[
'customer' => auth()->user()->stripe_customer_id,
'payment_method_types' => ['us_bank_account'],
'payment_method_options' => [
'us_bank_account' => [
'verification_method' => 'microdeposits',
],
],
],
['stripe_account' => auth()->user()->stripe_connect_account_id]
);
$clientSecret = $setup_intent->client_secret;
return view('account.renter.bank.modals.add_bank', compact('request','stripe_publish_key','clientSecret'));
and this is my fronend code
var stripe = Stripe('{{ $stripe_publish_key }}', {
stripeAccount: '{{ auth()->user()->stripe_connect_account_id }}',
});
$(document).ready(function(){
$("#add-bank").click(function(){
$('#empty_modal').modal('hide');
var clientSecret = '';
var setupIntent = {};
$.ajax({
url: '{{url('account/renter/bank/add_stripe_bank')}}',
type: 'post',
headers: {
'X-CSRF-TOKEN': csrf_token,
},
dataType: 'json',
success: function(response){
var setupIntent = response.setupIntent;
var bankSetup = stripe.collectBankAccountForSetup({
clientSecret : setupIntent.client_secret,
params: {
payment_method_type: 'us_bank_account',
payment_method_data: {
billing_details: {name: '{{ auth()->user()->first_name.' '.auth()->user()->last_name }}', email: '{{ auth()->user()->email }}'},
},
},
expand: ['payment_method'],
this is my server site code generating setup intent
if(auth()->user()->stripe_customer_id){
$setupIntent = $stripe->setupIntents->create(
[
'customer' => auth()->user()->stripe_customer_id,
'payment_method_types' => ['us_bank_account'],
'payment_method_options' => [
'us_bank_account' => [
'financial_connections' => ['permissions' => ['payment_method', 'balances']],
],
],
],
['stripe_account' => auth()->user()->stripe_connect_account_id]
);
}
return response()->json(['setupIntent' => $setupIntent]);
what is the error?
what is the request ID of the error? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
and I am getting error in console
T https://api.stripe.com/v1/setup_intents/seti_1NJEijR8W55xfLiRxeWGU1sb/link_account_sessions
VM3055:35 No such setupintent: 'seti_1NJEijR8W55xfLiRxeWGU1sb'
PaymentMethod collection failed for some reason.
ok so the problem is in the frontend code
where?
just a sec, I'm double checking something
are you using the correct keys here?
stripeAccount: '{{ auth()->user()->stripe_connect_account_id }}',
});```
the $stripe_publish_key should be your platform's publishable key
auth()->user()->stripe_connect_account_id should be in this particular case acct_1MKE7zR8W55xfLiR
could you please double check?
could you share the request ID?
yes I am using right key , stripe_publish_key is my plateform key and stripe_connect_account_id this is connected accout id.
that's not the one I'm looking for
T https://api.stripe.com/v1/setup_intents/seti_1NJEijR8W55xfLiRxeWGU1sb/link_account_sessions
VM3055:35 No such setupintent: 'seti_1NJEijR8W55xfLiRxeWGU1sb'
PaymentMethod collection failed for some reason.
when you look in the console's Network, you should be able to find the request and look at the response header and see the Request-ID
ok i check
{
"error": {
"message": "Unrecognized request URL (GET: /v1/setup_intents/seti_1NJF2IR8W55xfLiRRsk6OzQ0/link_account_sessions). Please see https://stripe.com/docs or we can help at https://support.stripe.com/.",
"type": "invalid_request_error"
}
}
i am getting only this, not getting any request id.
if(auth()->user()->stripe_customer_id){
$setupIntent = $stripe->setupIntents->create(
[
'customer' => 'cus_O5PTHVVb0uiUIr',
'payment_method_types' => ['us_bank_account'],
'payment_method_options' => [
'us_bank_account' => [
'financial_connections' => ['permissions' => ['payment_method', 'balances']],
],
],
],
['stripe_account' => auth()->user()->stripe_connect_account_id]
);
}
I think problem in setupIntent ?
Hello Please help me , I am totally frustrated because of this error I am not getting any solution.
Hi! I'm taking over this thread.
That's the first time I see that error, give me a few minutes to investigate.
Ok
Can you clarify when exactly in your flow you see that error message?
Hii soma, miraculously problem is solved.
Did you change anything on your end?
yes I recheck my code I am declaring two times stripe variable.
give me one answer please what i pass for fetch connect customer bank
$banks = $stripe->customers->allSources(
auth()->user()->stripe_customer_id,
['object' => 'bank_account']
);
I'm not sure I understand your question. Can you clarify what exactly you are trying to do?
I want get all customer payment method who exists in connected account.
To make request on a connected account, you need to use the Stripe-Account header: https://stripe.com/docs/connect/authentication#stripe-account-header
Ok got it, and my second answer is
$stripe->paymentIntents->create(
[
'amount' => 1000,
'currency' => 'usd',
'automatic_payment_methods' => ['enabled' => true],
],
['stripe_account' => '{{CONNECTED_ACCOUNT_ID}}']
);
if customer already have payment method then how i pass payment method and customer in my provided code.
👋 stepping in
https://stripe.com/docs/payments/save-during-payment?platform=web#charge-saved-payment-method has an example of how to charge a saved PaymentMethod
You want to pass the PM ID to payment_method and pass confirm => true