#Sarvesh

1 messages ยท Page 1 of 1 (latest)

tidal ospreyBOT
autumn cypress
#

Hello ๐Ÿ‘‹
How can I help?

dark sorrel
#

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],

autumn cypress
nocturne holly
#

pi_3MHSjbPQyrH7XtiR1Ro8Yhx3

autumn cypress
#

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?

dark sorrel
#

$paymentIntent = PaymentIntent::create([
//'payment_method_types' => ['card'],
////'payment_method' => 'pm_card_bypassPending',
'amount' => $eventRegData->total_amount100,
'currency' => 'usd',
'application_fee_amount' => $eventRegData->platform_fee
100,
'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

autumn cypress
#

Where exactly are you seeing this error? On your payment page while confirming client-side? or somewhere else?

dark sorrel
#

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

autumn cypress
#

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

dark sorrel
#

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

autumn cypress
#

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

dark sorrel
#

what is destination charges and how much it is?

autumn cypress
#

Would recommend going through the guide above

dark sorrel
#

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}}',
],
]);

autumn cypress
#

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)

dark sorrel
#

Yes, let me tell you the workflow

  1. we have stripe account for our application (event mgm website)
#
  1. Event orgniser will connect using Stipe Account connect and use Express method to connect them under our main stripe account
  2. Event participants will join event by purchasing tickets from the website
  3. 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

autumn cypress
#

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.

dark sorrel
#

ok, so if I switch from direct charges to destination charges and then everything works fine with Express account?

autumn cypress
#

It should, yes.

dark sorrel
#

and what I need to set in PaymetIntent object

'payment_method_types' => ['card'],
OR
'automatic_payment_methods' => ['enabled' => true],

autumn cypress
#

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'],

dark sorrel
#

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

autumn cypress
#

how exactly are you initializing Stripe.js?

dark sorrel
autumn cypress
#

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?

dark sorrel
#

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',
},
};

autumn cypress
#

you should take out

stripeAccount: '{{$connectedAccountId}}'

#

change following to

const stripe = Stripe('pk_live_51LcWQoALTlZ8nxc3ghlARucjacfliEaIgDSKdXbTeUk0yI6ygAkMFEZQ5Z4EjR00SKDrKoAA')

dark sorrel
#

Yes, now payment form is visible

#

will test 1 transactions with real card

dark sorrel
#

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?

waxen ingot
#

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

dark sorrel
#

no it is the application fee of our website platform

#

Event fee $10
application fee $1.30
Total: $11.30

waxen ingot
#

Can you send me the ID of that payment?

dark sorrel
#

pi_3MH2zwPSfceocWER0kDnUNUL

#

sorry, it was wrong id

waxen ingot
#

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

nocturne holly
#

pi_3MHUQrALTlZ8nxc30tPAiM9I

dark sorrel
#

yes, this is correct payment Intent id

#

pi_3MHUQrALTlZ8nxc30tPAiM9I

#

Please check this

waxen ingot
#

Gotcha, and are you just looking for the stripe fees on these payments?

dark sorrel
#

yes, other things looks fine but do not see stripe charges deducted in that transaction

waxen ingot
#

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

dark sorrel
#

ok got it, will check it

#

but for above successful transactions, did not receive the webhook

#

can you resend?

waxen ingot
#

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

dark sorrel
#

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

ocean oak
#

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?

dark sorrel
#

yes

#

in test mode all webhooks were working and same copied to live mode

ocean oak
#

Can you copy/paste the Webhook ID you're working on?