Retrieve a list of supported countries from Stripe API? - stripe-payments

I've read over Stripe's API and couldn't find a way to find if a country is supported by Stripe.
e.g: I have an user who is going to receive a payment and he is from a country, I need to check if he can use Stripe to receive this payment based on his country.
Thanks

Stripe's Country Specs API should do what you need:
https://stripe.com/docs/api#list_country_specs
Their documentation includes sample code and sample responses for multiple languages.

No such info as I know in api, but there are not so many countries they support at he moment to accept payments. https://support.stripe.com/questions/what-countries-does-stripe-support
So you can add them into a global variable to your app and update it whenever a new country will be in the list. A settings page in admin panel may be, so you can easily update the list.

Related

Stripe Payment Links with Customer Id

I am currently building an application where we want to user Stripe Payment links rather then building our own version of UI to support the same functionality. However I notice that Stripe Payment Links create a new customer every single time. Is there a way to attach my customer id to the payment link so that a new customer is not created when they attempt to buy more then one product? I would prefer not to have to have a single user have multiple customer ids inside of my database.
Thanks!
Payment Links are not specific to a Customer record. The documentation does include examples of how you might append data to them to aid in reconciling payments to a specific individual.
If you want to make use of the Stripe hosted UI while still assigning specific Customer records then I would recommend making use of Stripe Checkout.

stripe api: is it possible to expand invoice discounts from the events api?

In the stripe API there is no endpoint to load discounts by Id, so typically when querying the invoices api you append ?expand[]=data.discounts to the request and it populates the details of the discounts in the returned objects. This is the only way I know of to get the discounts from the API.
In the events api you get back lots of different kinds of objects, but for the invoices I would like to also expand the discounts because I do not know how to get them otherwise. I have tried appending the following expand paramaters to the events api and always get back an invalid_request_error from their api telling me that the field I request can not be expanded.
?expand[]=discounts
?expand[]=object.discounts
?expand[]=data.discounts
?expand[]=data.object.discounts
?expand[]=data.data.object.discounts
?expand[]=data.data.discounts
Is it possible to expand the discounts on invoices from the stripe events api?
From synthrider on Stripe Developer Community Discord:
hello! No, events can't be expanded , you'd need to request this from the related API directly

With Stripe, how to attach a single payment method created from Setup Intent API for multiple customers

With Stripe, how to use the payment method created from setup intent for multiple customers?
According tp the Create Setup Intent API, it only let us define one customer ID.
param name: customer (optional)
description of this param:
attached to the Customer on successful setup. Payment methods attached
to other Customers cannot be used with this SetupIntent.ID of the Customer this SetupIntent belongs to, ifone exists. If present, the SetupIntent’s payment method will be
TLDR
I want to let the same user to reuse same payment method to subscribe items with different presentment currencies,
I assume I should solve this requirement by directly creating multiple customer objects for a single user, and using create Setup Intent API to attach his/her same payment method for multiple "customer objects".
But, I am not sure if this is possible, therefore I welcome any recommendation for alternative approaches, such as using attach payment method to customers API, or any workarounds.
PS: Detail info (for why I am interested to ask this question)
Business requirement:
My business requirement is that customers have to subscribe to international services that must be presented with different presentment currencies. To makes thing even harder, each customer has to use the same list of saved payment methods to subscribe to services with different presentment currencies in the future. In other words, users should not have to re-enter card info again if they subscribe to items in different presentment currencies.
Limitation of the Stripe API:
Why not just use single customer object for subscribing to services (aka "price" objects) with multiple presentment currency?
I tried and it results in an error. According to this Stripe documentation, it indeed says that each customer can only be used for transactions in single currency.
If the user in my app want to subscribe to another service with another
currency, I need to create new "Customer" object in Stripe.
Why not just use /v1/payment_methods/:pm_id/attach api to attch payment method to multiple customer object?
Because according to this Attact payment method to customer API doc, Stripe does not recommend, yet I do not fully understand the risk of not performing any necessary steps as it warns. Therefore, it is just my risk averse instinct to avoid this.
To attach a new PaymentMethod to a customer for future payments, we
recommend you use a SetupIntent or a PaymentIntent with
setup_future_usage. These approaches will perform any necessary steps
to ensure that the PaymentMethod can be used in a future payment.
This is not supported. A payment method can only be consumed once if not attached, and attaching to a customer counts as a consumption. A PM can only be attached to a single customer, so you'll need to collect the payment details for each.
Stripe recommends using that customer's currency for all presentment to optimize for their experience, though that may not be suitable for all use cases.

Docusign and Stripe integration - Payments are created without a customer

I'm trying to integrate the Docusign eSignature API with Stripe.
I've created a Quickstart application and have successfully run through the process, signing the contract and making a test payment.
However, I noticed that the payment in Stripe does not have a customer object attached to it:
I'd like to know if it's possible to specify a customerId, or create one as part of the process. I did notice that the PaymentDetails constructor accepts a customerId parameter, but I could not see any relevant documentation for this, and specifying it in my request didn't seem to make any difference.
Any advice appreciated.
Thanks
Dan,
For regular payments that are one time and right away - DocuSign will not create a customer record. This is "by design" and is meant to support quick payments without any customer record.
You can set recurring/future payments and then you'll get customer records when you set the gateway. If you want, your recurring payment or future payment can be just one time in the near future and then you can achieve what you want and get a customer record.

List all payment methods from customer

I am using the Java client for Stripe on my backend.
At the moment I'd like to support credit cards and bank accounts (SEPA). A customer is able to add multiple credit cards of bank accounts if he wishes to.
If I got that right, what I want is to use the Sources API, which allows me to add differend types of payment methods.
However, I am not certain how to fetch alle created payment methods (sources) in one call.
Is this possible ?
You can retrieve a list of a specific customer's sources via the GET /v1/customers/{customer_id}/sources endpoint.
https://stripe.com/docs/api/payment_methods/list you can use a customer_id to list all the payment methods saved for a user, assuming you attached a customer_id to the user.

Resources