#asim_1
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- jim-connect-setup-pm, 4 days ago, 27 messages
๐ happy to help
would you mind sharing more details? what's the request ID that failed? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site 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.
How do I get the request ID?
you can check the link I just sent you
Its not showing them.
I mean its showing other events, but not the one I'm having trouble with.
resubmit the same request and in the headers of the response you should be able to get a new request ID
Will the service response if there's an error in my code? Current getting a 403
The provided key 'sk_test*' does not have access to account '*' (or that account does not exist)
Ohh got it now. Had to apply the GET filter
yes that's right, since this is a GET request and by default it shows POST on the dashboard
req_laLOMkXdk6QfHK
I should add that its not showing the latest request failures.
Latest ones have status 403. This is 404 but is related to the error I'm currently getting.
the customer you're trying to retrieve was created by your platform on a connected account
if you want to retrieve it you need to add the Stripe-Account header
same way you did when you created that resource
$connected_customer_account = $stripe->accounts->retrieve(
'cus_PHsEyRY5fFbqQS',
["connected_account" => "acct_1OSa5uC0wiqTfzk5"]
);
Isn't this correct?
accounts != customers
customers are the buyers and accounts are the Connected Accounts (the merchants)
$connected_customer_account = $stripe->customers->retrieve(
'cus_PHsEyRY5fFbqQS',
["connected_account" => "acct_1OSa5uC0wiqTfzk5"]
);
this is good?
should be yes if you're using the platform secret key you should be fine
(Request req_rrir1tM7hPUpvt) Received unknown parameter: connected_account
Still getting an error
req_bEmQZ4NIBUIfvm
$stripe->customers->retrieve(
'cus_PHsEyRY5fFbqQS',
[],
["stripe_account" => "acct_1OSa5uC0wiqTfzk5"]
);
I think.
ah right, it's this stupid edge case with the PHP library
$stripe->customers->retrieve(['id'=> "cus_xxx"], ['stripe_account'=> "acct_xxx"]); will work
the shortcut of passing the ID as the first param doesn't work when also using stripe_account and you have to explicitly pass id
I think I tried that too. I'll try it again.
Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, array given
Not accepting it.
Even if I cast it to string, I get an API error.
hmm well what I shared earlier works perfectly for me
maybe make sure you're using the current version of stripe-php.
13.7.0 - 2023-12-22
This is my version. I'm taking a look at your code now.
Ok I've managed to get past getting the customer and creating the ephemeral key.
$setupIntent = $stripe->setupIntents->create([
'customer' => $connected_customer_account->id,
'automatic_payment_methods' => [
'enabled' => true,
],
['stripe_account' => "acct_1OSa5uC0wiqTfzk5"]
]);
Do I need to pass the connected account here? (stripe_account)?
req_hxIZS6T18vvDVa
yes, if you're using Connect like this, all the objects will need to be created on the connected account, using that approach
your syntax is off
$setupIntent = $stripe->setupIntents->create(
[
'customer' => $connected_customer_account->id,
'automatic_payment_methods' => [
'enabled' => true,
],
], // end the first parameter array
[ // open the second parameter array
'stripe_account' => "acct_1OSa5uC0wiqTfzk5"
]
);
Thanks! Sorry you had to teach me a little php syntax towards the end ๐
stripe_account goes into a separate argument separate from the API params
Ok now about the Android side of things. req_nCYWvMVJ67WyPt
No such setupintent: 'seti_1OWfM6C0wiqTfzk5p2rKeiOn'
https://stripe.com/docs/connect/authentication , the Android sections
see also https://stripe.com/docs/connect/creating-a-payments-page?platform=android&destination-or-direct=direct-charges#android-create-client-side which while is for payments not setups, is generally the same thing
Yes I read that earlier. It mentions a Stripe stripe object. But in the other guys no such object is utilized anywhere.
hmm well what does your existing Android code look like?
ah right. Well it's in PaymentConfiguration instead when using PaymentSheet
(I'm using Kotlin but same idea, you'll find the parameter in the Javadoc for the PaymentConfiguration init method)
Got it.
Still getting the 'no such setup intent' though
req_xRPj1kBoVO1EUG
what exact line of code in the Android app is leading to that happening?
for example maybe you have a call to retrieveSetupIntent explictly somewhere
When the sheet pops up (the one with the payment methods and card input stuff), it instantly goes back down
The server is logging a request. And the error. I shared the ID above.
My bad. Got it to work.
So when my server wants to charge this user (from the connected account), they will do this?
https://stripe.com/docs/payments/save-and-reuse?platform=android&ui=payment-sheet#charge-saved-payment-method
yes
but remember you need to use stripe_account in all of those API calls too, since your Customer and PaymentMethod all exist on the connected account, otherwise you'll get more "no such xxxxx" errors
Understood. One little issue with the android library:
its not showing proper function names in Java. I'm guessing this is written in Kotlin.
it is, not sure about that specific issue sorry, I don't do much Android dev myself and when I do I'm always using Kotlin
I'm just trying to enable Google Pay.
Can't find this function
configuration.setGooglePay(googlePayConfiguration);
);
because the library isn't showing function names in Java.
why not pass it in the Builder?
if you type . after "allowsDelayedPaymentMethods(false)" you'll probably find a setGooglePay function in the Builder.
the SDK uses the Builder pattern, you don't set the fields on the config directly, you create the config via the Builder class
Done, thanks.
This should be it. Thanks a ton for your help and patience.
Have a good day.
you too!
Google Pay button should show up on the payment sheet after this configuration right?
Or is it not enabled for save and re-use purpose?
๐
Taking over and catching up