#rangermillze_api

1 messages ยท Page 1 of 1 (latest)

upper terraceBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1293224405325058170

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

solar kelp
#

Hello

#

Yes this should work fine

#

What issue are you seeing?

upper mirage
#

=hi bismarck

#

im having a nightmere,

#

ok to send screenshot?

solar kelp
#

Sure

upper mirage
#

I currently use paymenet elements which works perfectly fine for card payments

#

I use stripe.confirmPayment and stripe.confirmSetup response codes to create a user environment once payment has been made using the same script.

#

i.e if payload.setupIntent.status == "succeeded" then run setup code.

#

I use webhooks to manage the licenses

#

the card payments work great and i get a response fine, however the paypal button send me to another page away form my script. So looking at the docs I can use paypal express checkout element however I dont want to have to duplicate code so Im wondering if I can remove the current paypal button from the payment element and use or add a paypal express checkout button?

solar kelp
#

Yes you can do that

#

Paypal will still result in a redirect from the page after confirmPayment or confirmSetup promise fulfillment.

#

Is that the part you are worried about?

#

Or you don't like the redirect to the Paypal authorization?

upper mirage
#

Paypal as it is atm redirects to a page for me to enter my paymenet details and then returns to another page away from the script.

solar kelp
#

Correct

#

With Express Checkout Element it will perform that authorization within a modal

upper mirage
#

This is what I dont want as the script is waiting for a response to finish my client setups

#

yes, this is what I need )authorization in a modal)

solar kelp
#

To be clear though you will still get a redirect upon successful confirmPayment() or confirmSetup()

#

Hmm actually I haven't tested that ... that might not happen if you set redirect: if_required here

upper mirage
#

stripe.confirmPayment({
elements,
confirmParams: {
// Return URL where the customer should be redirected after the PaymentIntent is confirmed.
return_url: 'https://kwiktactix.com/gateway/err.php',
},
redirect: 'if_required'
})
.then(function(payload) {

#

this is what i use ( redirect: 'if_required' )

#

so i keep the redirect under control

solar kelp
#

Yeah I know

#

With Payment Element the redirect is required for Paypal

upper mirage
#

this works great

solar kelp
#

Which is why you are seeing that

#

But yeah for ECE it should not be

#

Since it uses a modal

upper mirage
#

This is the issue, I am trying to use both on the same page.

solar kelp
#

I understand. I think it should work fine with Paypal where it doesn't redirect with Express Checkout Element. But you'll need to test that

upper mirage
#

I can get this to work with express checkout but I am trying to utilize my code to use both options. The payment elements and the paypal button.

solar kelp
#

Yes that's fine

upper mirage
#

I am wondering if I can show the payment element as well as the expresscheckout button. So the user can press the yellow express checkout button if they want to use paypal

solar kelp
#

Yes that works just fine

#

It is designed for that

upper mirage
#

And remove the paypalk button from the payment element.

solar kelp
#

You use the expressCheckoutElement.on('confirm', handler for your code for ECE

#

And you would use your own button handler for Payment Element

#

When you create your ECE you specify that you want to show Paypal

upper mirage
#

would i mount EXE as const ppelements = stripe.elements(options); and mount paymenet elements as const elements = stripe.elements(options); on the same page?

#

sry ECE

solar kelp
#

No you would need to initialize multiple elements instances here.

#

Since you are going to have different options for each

upper mirage
#

hmm, ok this is where I think i am falling over.

#

I want the user experience to be simple, either click pay with card or click use EXE

#

ECE

#

i'll have a play and see if I can get both working together

#

but thanks for confirming I can use both (or should be fine).

solar kelp
#

๐Ÿ‘

#

Let us know if we can help further

upper mirage
#

thanks m8! appreciate it