#rangermillze_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1293143979944185919
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'm not sure I understand the redirection back issue, let's narrow this step by step
Are you following this guide ?
https://docs.stripe.com/billing/subscriptions/paypal
hi
with stripe.confirmPayment and stripe.confirmSetup the response returns to the call so I can carry out specific tasks based on the response. With the stripe.confirmPayPalPayment a sepertae page laods up entirely and then says I have to use webhooks to compelte the process.
sorry, i got itchy fingers ๐
I basically dont want the customer to be directed off site to a payment page
i have a return url but this is mainly for erros. am I missing:
mandate_data: {
customer_acceptance: {
type: 'online',
online: {
infer_from_client: true
}
}
},
what is infer_from_client? i've never seen this before
this is my call atm:
stripe.confirmPayPalPayment({
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'
})
i copied it form previous code I use that works perfectly with card payments
Is there a particular reason for using. stripe.confirmPayPalPayment and not using confirmPayment then ?
You mean here the redirection isn't working ?
the issue i have is when paypal is selected and the form is submitted the user it taken off site to another page to pay via paypal
With our braintree integration, a papyal popup appears and then returns the user back to the shop page. With stripe, this doesnt seem to be the case at the moment.
what is the difference between stripe.confirmPayPalSetup and stripe.confirmPayPalPayment?
im confused how I can make stripe work like braintree.
Yes that's the expected behavriour, and that's why you need to set the redirect_url
I don't know braintree honestly well.
hmm, so I cannot get a pypal popup? and the user is forced to a paypal page completely off site?
But Stripe supports redirection flow, there is no option to make it via popup
thats not good for me
this means i cannot use paypal with stripe integration
I need a workaround because this is topping me migrating from braintree to stripe.
this "offsite" redirection doesnt look good. How is this the only way to do it?
Sorry, but what is not good exactly?
You need to handle the redirection as follow:
https://docs.stripe.com/payments/paypal/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api#handling-the-redirect
being redirected offsite
That's the expected flow yes.
I think you can implement a workaround by implementing the redirection manually
Try to display the redirection url next_action.redirect_to_url.url into a popup in the same page and see what it gives
This changes everything now, the issue is when the payment is made the client/user is returned back to the script and we create a whole bunch of environments for the user "automatically" based on the data they entered. This paypal intgration breaks the process
We dont and cannot use webhooks for creating our client cloud environment.
Have you checked my last message ?
we use webhooks to cancel subscriptions etc but not to create environments
just looking
This forced redirect "process" breaks our process. I will have to force users to use debit card only as this is how it works correctly at the moment.
with braintree is so much clearer and easier. user slected paypal and a paypal popup displays where they login and do their stuff then the popup closes and comes back to the script
this isnt how stripe works so i need to rething if I can use stripe
I understand that, but I think you can still implement the same flow using Stripe by following the workaround I shared with you (manual redirection and display the url in a popup by your integration)
Will the manual redirect send the client back to the original script that posed the form? we use jquery to post the form and wait for the response.
i'll have a play and try and see if I can get it working without forcing the user offsite entirely
hi, we use $result = $stripe->customers->create([
'email' => $_POST['em'],
'name' => $_POST['fn'] . ' ' . $_POST['sn']
]); to create the customer and get the customer id on php. At this point the user doesnt even see the stripe payment element.
then we display the stripe payment element on our page
at this point the user can choose to pay paypal
however the documentations ays I need to use: 'payment_method_types
' => ['paypal'], when creating the client id
this isnt possible because we dont know at this point if the customer wants to use paypal?
can i add multiple payment types?
Where do you see this exactly?
under create a payment intent
it doesnt make sense when at this point we have no clue the user is going to use paypal
i just need the user to return to the script that made the call in the first place.
seems very complex for what it is.
this is what i see with braintree (our shop page is in the background)
when the user finishes payment or cancels then they come back to my main shop page
with stripe the user is sent to a completely different page "away from our shop page" so they will never be able to return where they left off.
yet with stripe card payment I get a popup with the 3dsecure auth and that does return back.
just not with paypal
This is a request to create a PaymentIntent, not a Customer.
Generally, we don't recommend you to set the payment_method_types explicitly and allow customers to choose the type they prefer from all that Stripe offers.
cool, i understand this. Our current process works perfect. Paypal is breaking the process we currently have.
the payment itself isnt at fault, its the process that takes the customer away form our shop page when they submit a form after selecting paypal
Also, generally you shouldn't rely on customer landing on the success page to execute your business logic, since it's very unreliable. Is this your flow?
Our process has worked perfectly for more than 5 years. A client comes to our site, subscribes to a plan and enters registration details. We then create a client record on stripe if they dont have one and use that id to get the payment using:
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) {
if the payload.setupIntent.status == "succeeded" or payload.paymentIntent.status == "succeeded" then we create the environment.
the webhook then just updates the license
are you saying payload.paymentIntent.status and payload.setupIntent.status is unreliable?
If you're using webhooks for your business logic then it's fine.
What information are you missing on the redirect_url page?
yes we use webhooks for the licensing etc.
The redirect_url isnt used as the user is redirected back tot he original script that posted the form.
I was told by a dev at stripe to just add the return_url as its a requirement but not used.
this "if_required" is what your guys told me to use
The redirect_url is in fact used if the customer is redirected elsewhere for PayPal.
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
hi, sure. I am just testing now and trying to get paypal payments flow to work like our credit/debit cards
@random bramble thanks for your help!
Generally, only cards with 3DS show up in a dialog. All other payment_method_types will redirect the customer elsewhere.
i understand, its just with braintreepayments (our current live platform) the paypal integration does exactly the same as the cards and returns the customer back to the script where the post was called.