#sandhya_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/1289101053039607880
đ 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.
- sandhya_api, 17 hours ago, 6 messages
- sandhya_docs, 19 hours ago, 17 messages
- sandhya_docs, 22 hours ago, 3 messages
Hi there, so can you tell me what problem that you are trying to solve?
hi
I am trying to using lozalized payment methods but its take parameter as currency and amount . Based on currency localized payment methods are getting listed.
I want these methods to be listed as per customer country selection
and payment should happen only in one currency which we have setup while creating payment intent.
https://docs.stripe.com/payments/payment-methods/dynamic-payment-methods you can use dynamic payment methods and let Stripe to help you determine the available local payment methods
what are the exact changes that I needs to do in code
while creating a payment intent
If your integration uses an API version prior to 2023-08-16, you must replace payment_method_types with automatic_payment_methods.
$checkout_session = \Stripe\Checkout\Session::create([
'line_items' =>
[[
'price_data' => [
'currency' => 'USD',
'product_data' => ['name' => 'T-shirt'],
'unit_amount' => 2000,
],
'quantity' => 1,
]],
'mode' => 'payment',
'success_url' => 'http://localhost:4242/success',
'cancel_url' => 'http://localhost:4242/cancel',
'payment_method_types' => [
'bancontact',
'card',
'eps',
'giropay',
'ideal',
'p24',
'sepa_debit',
]
]);
This is how I am passing but its giving error
Invalid currency options usd. The payment method bancontact only supports the following currencies: eur.
Hmm? I thought you said you are creating PaymentIntents?
Anyway if you are using CheckoutSessions API, here's the example code https://docs.stripe.com/payments/payment-methods/dynamic-payment-methods?payment-ui=checkout#migrate-to-dynamic-payment-methods
I am trying it by both way. Either payment intent or stripe checkout
So basically you should remove the payment_method_types
I did passed the say way as given in example but its giving an error
Invalid currency options usd. The payment method bancontact only supports the following currencies: eur.
But you still pass payment_method_types, the example code told you to remove payment_method_types
If you list payment methods manually in an existing integration and want to manage payment methods in your Dashboard, remove payment_method_types from your integration code.```
yeah, if I remove then it willlist payment methods as per set currency
but my usecase is, I want the payment methods should get displayed as per customer country selection and payment should happen in set currency for either session checkout or payment intent.
Preview some of the features available in our prebuilt, hosted payment page.
it should be same as shown in this demo example
when we change country, payment methods for that country gets listed
same things I am trying to achieve
The demo shows how Stripe checkout automatically display a different list of payment methods based on the customer's location.
Either Stripe PaymentElement or Checkout page would automatically determine the customer's location, and there's no API to programmatically set the location.
but how does Stripe PaymentElement or Checkout automatically determine customer location? there is no parameter to set customer location
it just accepts currency and based on currency payment methods gets displayed in Stripe PaymentElement or Checkout
But why do you need to set the location?
as I said my usecase is that, as per custome country selection payment methods should get changed
the way it shown in example
same thing I want to implement
No, there's no API to set a location, and this is not something that you can implement
so does stripe has any API by which I can do currency conversion from USD to EUR or vice versa