mollie / mollie-api-node

Official Mollie API client for Node
http://www.mollie.com
BSD 3-Clause "New" or "Revised" License
231 stars 63 forks source link

get Methods based on country not working?[BUG] #274

Closed DennisSpek closed 2 years ago

DennisSpek commented 2 years ago

I tried filtering out payment methods based on the billingCountry parameter but this does not work. Not sure if this is working as intended or an actual bug.

mollieClient.methods.all({ includeWallets: 'applepay', billingCountry: 'US', locale: 'en_US', amount: { value: '100.00', currency: 'EUR', }, })

Will still show iDeal as an valid payment method. This same issue arises when using the actual API Endpoint.

Pimm commented 2 years ago

This is the intended behaviour. According to the documentation, billingCountry "can be used to check whether your customer is eligible for certain payment methods". I checked with a Mollian more knowledgeable on this topic, who confirmed that "[w]e use this parameter to exclude payment methods that are not allowed in a billing country." Keyword: allowed.

iDEAL is "less appropriate" for the US, but this parameter was not designed to filter by whether a method is appropriate or not. If your customer has a billing address in the US (and speaks American English), Mollie correctly lists iDEAL: iDEAL imposes no restrictions on the billing address (nor on the locale). Filtering payment methods by whether they are appropriate in a given location is something you will have to do on your end if desired.

(P.S. Please start using list instead of all, to make sure your code doesn't break when you upgrade to version 4.×.× of this client.)