#Sarvesh
1 messages ยท Page 1 of 1 (latest)
Hello ๐
How can I help?
Hi
We have activated test mode to live mode and imported the test webhooks to live
while accepting payment from PaymentIntent we are getting below error
card payment methods are already enabled in our account
what needs to do to fix this error?
'automatic_payment_methods' => ['enabled' => true],
Can you share the PaymentIntent ID or the request ID where you're seeing this error?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
pi_3MHSjbPQyrH7XtiR1Ro8Yhx3
I'm not seeing an error here on this PaymentIntent specifically
And it seems like you're passing following while creating the PaymentIntent
0: "card",
},```
Can you clarify what exactly are you blocked on?
Are you seeing errors when confirming a PaymentIntent?
$paymentIntent = PaymentIntent::create([
//'payment_method_types' => ['card'],
////'payment_method' => 'pm_card_bypassPending',
'amount' => $eventRegData->total_amount100,
'currency' => 'usd',
'application_fee_amount' => $eventRegData->platform_fee100,
'transfer_group' => 'directCharges_'.$eventRegData->id,
////'confirm' => true,
'automatic_payment_methods' => ['enabled' => true],
//'payment_method_types' => ['bancontact', 'card', 'eps', 'giropay', 'ideal', 'p24', 'sepa_debit', 'sofort'],
'metadata' => [
'event_id' => $eventId,
'division_id' => $eventRegData->division_id,
'athlete_id' => $athleteId,
'event_reg_id' => $eventRegData->id,
],
////'return_url' => $baseUrl.'/intentdata',
], ['stripe_account' => $connectedAccountId]);
it gives us error
No valid payment method types for this Payment Intent. Please ensure that you have activated payment methods compatible with your chosen currency in your dashboard (https://dashboard.stripe.com/settings/payment_methods) or specify payment_method_types
Where exactly are you seeing this error? On your payment page while confirming client-side? or somewhere else?
yes, while doing the payment from the client side
as an user
now I removed the 'automatic_payment_methods' => ['enabled' => true], and only kept
'payment_method_types' => ['card'],
it shows Pay Now button but the form to accept the payment card data is not showing
Taking pictures from your phone are not helpful ๐
Can you take screenshots from your computer and share those? even with zooming in I can't see what's going on
Also the example you've shared is for a direct charge but the connected account is express type.
We highly recommend against performing direct charges with any other account types than Standard accounts.
You should really be using destination charges here
yes, we connected account as Express account as per your support persona advice and doing direct charges.
not getting your last point "We highly recommend against performing direct charges with any other account types than Standard accounts. "
I doubt our support would recommend using Direct charges with Express accounts. We strongly recommend against it.
If you want to use direct charges, you should create Standard connected accounts
If you want to use express/custom accounts, you should be using destination charges
what is destination charges and how much it is?
ok, so I need to pass this additional to my object?
'transfer_data' => [
'destination' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
],
$payment_intent = \Stripe\PaymentIntent::create([
'amount' => 1000,
'currency' => 'usd',
'application_fee_amount' => 123,
'transfer_data' => [
'destination' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
],
]);
No, did you read the whole document? ๐
The charge itself takes place on the platform account
currently your code creates a charge on the connected account (your code must be passing in stripe_account => connected account ID)
Yes, let me tell you the workflow
- we have stripe account for our application (event mgm website)
- Event orgniser will connect using Stipe Account connect and use Express method to connect them under our main stripe account
- Event participants will join event by purchasing tickets from the website
- So we created direct charge paymentIntent object with event fee (which goes to event orginser) and application fee will go to website stripe account.
everything is working correctly in the Test mode and after switched to Live mode it gives an error
Right, the issue here might be with the connected account not having the right payment methods enabled.
Again, if you choose to perform direct charges with express then addressing disputes would be increasingly difficult, platform would need to cover negative balance for express connected accounts, these charges won't be compatible with radar, platform won't easily get any metrics such as conversion rate, fees would become difficult to predict etc...
A lot of things will get difficult as you scale. I'd recommend re-structuring your app to perform destination charges (if you need to use express accounts) OR create standard accounts to perform direct charges.
ok, so if I switch from direct charges to destination charges and then everything works fine with Express account?
It should, yes.
and what I need to set in PaymetIntent object
'payment_method_types' => ['card'],
OR
'automatic_payment_methods' => ['enabled' => true],
If you want to control the Payment Method Options using the dashboard then you should use
'automatic_payment_methods' => ['enabled' => true]
If you want to control the Payment Method Options on your own (without the dashboard involved) then you should use
'payment_method_types' => ['card'],
ok, now done change with destination charges and kept payment method type as Card only
still getting error in console while showing the payment form
how exactly are you initializing Stripe.js?
<script src="https://js.stripe.com/v3/"></script>
the error is that Stripe.js isn't able to find the PaymentIntent on the account whose Public keys are being used here
No that's just you including the script
there must be some code that passes in your public API key by
Stripe(pk_live_xxx,...)
is there a stripe-account parameter there?
var stripeSecret = '{{ $stripeSecret }}';
const stripe = Stripe('pk_live_51LcWQoALTlZ8nxc3ghlARucjacfliEaIgDSKdXbTeUk0yI6ygAkMFEZQ5Z4EjR00SKDrKoAA', {
stripeAccount: '{{$connectedAccountId}}'
});
const options = {
clientSecret: '{{ $paymentIntent->client_secret }}',
// Fully customizable with the Appearance API
appearance: {
/.../
theme: 'stripe',
},
};
still gives an error in console
shared-369d01c0443af0992881b897ee26ef92.js:1 GET https://api.stripe.com/v1/elements/sessions?key=pk_live_51LcWQoALTlZ8nxc3ghlARucjacfliEaIgDSKdXbTeUk0yI6ygAkIXR8f5zCiuP4EOJMbtHr1fDl1HMFEZQ5Z4EjR00SKDrKoAA&_stripe_account=acct_1MHSUCPQyrH7XtiR&type=payment_intent&locale=en-US&client_secret=pi_3MHTzAALTlZ8nxc33zEuWGYc_secret_a9R9YLGJXtmy3ar9dxNfh4Dxy&expand[0]=payment_method_preference.payment_intent.payment_method 400
you should take out
stripeAccount: '{{$connectedAccountId}}'
change following to
const stripe = Stripe('pk_live_51LcWQoALTlZ8nxc3ghlARucjacfliEaIgDSKdXbTeUk0yI6ygAkMFEZQ5Z4EjR00SKDrKoAA')
Payment is successful and here is the screenshot of it
We can not see here stripe charges deducted
Is this correct or from which account it should be deducted ? platform or connected account?
The $1.30 is the stripe fee right? Checking in to where the fee is coming from here. I think it depends on how you set these charges up
no it is the application fee of our website platform
Event fee $10
application fee $1.30
Total: $11.30
Can you send me the ID of that payment?
It actually looks like that fee includes both your application fee and the stripe fee
If you want the fee programmatically, you can check the latest_charge on your payment intent, that charge will have a balance_transaction property and that balance transaction will have a fee property that has the stripe fee
pi_3MHUQrALTlZ8nxc30tPAiM9I
yes, this is correct payment Intent id
pi_3MHUQrALTlZ8nxc30tPAiM9I
Please check this
Gotcha, and are you just looking for the stripe fees on these payments?
yes, other things looks fine but do not see stripe charges deducted in that transaction
If you want to see that programmatically, that is what I was talking about in this message
If you want the fee programmatically, you can check the latest_charge on your payment intent, that charge will have a balance_transaction property and that balance transaction will have a fee property that has the stripe fee
And in the dashboard, I think you just have to hover over the i icon next to the "Fee:" line
ok got it, will check it
but for above successful transactions, did not receive the webhook
can you resend?
It looks like those payments exist directly on the platform account, and the platform account's webhook endpoint is only listening for account.updated events. You will need to enable it to listen for payment intent events as well to see them here
I can't resend these events for you but you should be able to via the dashboard or the CLI https://stripe.com/docs/cli/events/resend
hover over the i icon next to the "Fee:" it shows our application fee only and not the stripe charges
also we updated account.updated webhook and added more events in it with paymentIntend.succeeded / failed but still do not received the webhook event
Hi there ๐ taking over for @waxen ingot
Are you saying you just now updated the webhook endpoint to listen for Payment Intent events and it's currently not getting them?
Can you copy/paste the Webhook ID you're working on?