#gasper_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/1286217689206882378
๐ 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.
- gasper_best-practices, 5 days ago, 121 messages
- gasper_api, 6 days ago, 39 messages
Hi, I already got documentation how to test paypal as a payment method. Here: https://docs.stripe.com/payments/paypal/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api
curl https://api.stripe.com/v1/payment_intents \ -u "key" \ -d amount=1099 \ -d currency=eur \ -d "payment_method_types[]"=paypal \ -d "payment_method_data[type]"=paypal \ --data-urlencode "payment_method_data[billing_details][email]"="transaction_refused@example.com"
Our flow differs slightly. According to your documentation, we should pass one of the test emails in payment_method_data[billing_details][email] when creating a payment intent to test various scenarios
We already have a payment method created through the setup intent flow, which we then use when creating a payment intent. Should we populate payment_method_data[billing_details][email] with a test email during the setup intent to test different PayPal flows?
You should never share your secret API keys in public channel, regardless of whether it's a test or live mode key. I strongly suggest you roll your live mode key immediately as the one you sent is now considered compromised: https://dashboard.stripe.com/account/apikeys
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Could you share what you would like to achieve exactly?
it is our test mode key, I will update it
we would like to test paypal payment method locally before going live
to simulate the most common integration and failure scenarios for PayPal payments, pass email values that match the patterns described in Test Scenarios when you create the PaymentIntent as part of the billing details. For example, when confirming the PaymentIntent server-side, a request simulating a transaction refused by PayPal would look like:
as I said we already pass payment method when creating payment intent
We already have a payment method created through the setup intent flow, which we then use when creating a payment intent. Should we populate payment_method_data[billing_details][email] with a test email during the setup intent to test different PayPal flows?
I don't know off the top of my head. I assume that it should work by setting the email for different scenarios and process the payment later. I'd recommend giving a try in test mode. If it doesn't work, I'd suggest writing to Support https://support.stripe.com/contact for the feedback on having the test email to support this flow
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Additionally, could you review our current code below for creating a payment intent to identify any issues? When a user selects PayPal as their payment method, we want to avoid redirecting them to the PayPal page. We've noticed that this can be achieved if the PayPal payment method is added via the setup intent, and during the checkout process, we create the payment intent with the PayPal payment method while setting off_session: true. In our tests, the intent status was always returned as succeeded.
Customer will still be redirected to PayPal page at Setup Intent phase to collect the payment method details.
But yes - if the payment intent is set to off_session to true, the payment will be considered that the customer is not in the session and customer won't be redirected.
Yes on setup intent it is fine if user is redirected to paypal to collect the payment method details. But in checkout process where we create payment intent (and basically user is online) we would like to avoid this extra step. We were able to achive this to set off_session: true when creating payment intent
Is this the right approach?
off_session to true is only recommended to set if the customer isn't in session. In general, off_session to true will prevent additional action to be performed
I know, but this was the only way to avoid customer to be redirected to paypal page in our checkout process
why is that a problem?
either way I can't stop you writing the code this way, but we don't recommend it and it might lead to issues later
it is not a problem, but if we can avoid this extra step for customer in checkout (because payment method was already created using stripe intent setup) then this would be great