#ErinaceusEAM-api-libraries

1 messages · Page 1 of 1 (latest)

modest summit
#

Hey! Which specific library are you looking to remove from your integration?

faint light
#

This one - stripe.handleCardAction
We want to redirect client from our side, without your JS library.

modest summit
#

Hmm, that's not really possible without Stripe.js

#

Your entire flow seems a bit confused too. You shouldn't really confirm sever-side, or create a Payment Method directly on the API like you are

faint light
#

We want to do everything on the server side.
What would you suggest?

modest summit
#

We want to do everything on the server side.
Well, you can't really. Our server-side APIs/tooling can't handle 3DS challenge flows, which is why Stripe.js is required

faint light
#

We want to collect card data on our side.

modest summit
#

Do you have the necessary PCI compliance to handle card data?

#

This is not recommend for the majority of Stripe merchants

faint light
#

Yes, we are integrated to a PCI DSS certified Level 1 certified payment gateway

#

so it is going to be the gateway that is collecting the data on their side and passing it on to Stripe

modest summit
#

If you are PCI compliant for handling PAN data, you will still need to utilise Stripe.js for the 3DS challenge flow (as part of SCA regulations)

#

There's no way to facilitate that entirely server-side (as it requires customer interaction via a UI)

faint light
modest summit
#

That example URL you've shared is our test 3DS UI. In production, your customers will be redirected to bank/issuer pages to auth and confirm their payments

#

Stripe.js has the implementation to tell those banks where to return the customers to after they auth their payment. There's no way for you to build that logic yourself

faint light
#

Please advise Where can we specify the redirect url?

function handleServerResponse(response) {
if (response.error) {
// Show error from server on payment form
} else if (response.requires_action) {
// Use Stripe.js to handle required card action
stripe.handleCardAction(
response.payment_intent_client_secret
).then(handleStripeJsResult);
} else {
// Show success message
}
}

function handleStripeJsResult(result) {
if (result.error) {
// Show error in payment form
} else {
// The card action has been handled
// The PaymentIntent can be confirmed again on the server
fetch('/pay', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ payment_intent_id: result.paymentIntent.id })
}).then(function(confirmResult) {
return confirmResult.json();
}).then(handleServerResponse);
}
}

modest summit
#

Well, you can't with handleCardAction. Why are you using that function? Why not confirmCardPayment instead? Then that eliminates the server-side call to confirm too

faint light
modest summit
#

Is there a particular reason why you need to do synchronous confirmation? Again, not recommended for most integrations

#

As you're using Stripe.js, you can handle confirmation client-side when you do the challenge flow

faint light
#

As I've said above, we are running through a gateway and need the card data to be collected on our side& Please advise as to how we can best integrate

modest summit
#

This will handle 3DS/auth flows, and client-side confirmation

faint light
#

confirmCardPayment doesn't redirect the client to our side?

modest summit
#

I'm not sure I understand the question

faint light
#

This flow is ok?
1)Created POST payment method https://api.stripe.com/v1/payment_methods
2)Created payment method https://api.stripe.com/v1/payment_intents
2.)We added return_url to created payment method and client return to us
3)Sent the client to stripe_js - https://hooks.stripe.com/redirect/authenticate/src_1KtEx9GtmuM2mSqPNxSR56BS?client_se[...]U3FQLF9MYVYVBtak5nYXg0VEJyT0ZKbHlGcW9HME5VdGtadk9s0100kYgPNUaN
{ "next_action": {
"type": "use_stripe_sdk",
{ "use_stripe_sdk": {
{ "type": "three_d_secure_redirect",
{ "stripe_js": "https://hooks.stripe.com/redirect/authenticate/src_1KtEx9GtmuM2mSqPNxSR56BS?client_secret=src_client_secret_yuu3HPPHr171rWuX4hEfvWbV&source_redirect_slug=test_YWNjdF8xS2Vjc1VHdG11TTJtU3FQLF9MYVBtak5nYXg0VEJyT0ZKbHlGcW9HME5VdGtadk9s0100kYgPNUaN",
"source": "src_1KtEx9GtmuM2mSqPNxSR56BS"
}
},
4)Confirmed payment POST https://api.stripe.com/v1/payment_intents/{{PAYMENT_INTENT_ID}}/confirm

modest summit
#

We added return_url to created payment method and client return to us
Not sure that this means

#

Have you tested it out? Do you have a Payment Intent ID I can check?

faint light
#

payment_method - pm_1KtUqZGtmuM2mSqP8Fuw5K45
Payment Intent ID - pi_3KtUqfGtmuM2mSqP0B8i9bUy

modest summit
#

Looks good to me!

faint light
#

Fantastic

#

thank you so much for all your help

modest summit
#

Np!