Adyen / adyen-flutter

MIT License
23 stars 7 forks source link

Could not filter the payment method object in drop in bottom sheet #307

Open mumenahmedbright opened 2 days ago

mumenahmedbright commented 2 days ago

While trying to start a session, if I send paypal for example for the list of the supported card types it does nothing. So, my question is, is that a bug? or is it not meant to happen that way and if not, how to filter the shown filter methods based on business

cardConfiguration: const CardConfiguration( supportedCardTypes: ["paypal"], ),

Robert-SD commented 2 days ago

Hello @mumenahmedbright, Thanks for reaching out. I would like to help out in setting up the card configuration.

Unfortunately "paypal" is not a supported card type. You can find a list of all supported card types here.

When you specify a supported card type, your customers can only use cards from that particularly brand. PayPal is not a card brand and therefore not applicable to the card configuration. It is an own payment method and is displayed like cards or other payment methods in the payment method list.

If you have any additional questions, please feel free to reach out.

mumenahmedbright commented 2 days ago

Okay sorry for the misleading. I didn't mean "paypal" specifically. Let's modify the question. How to filter the payment methods based on specific business. Let's say for example I want to start a session with only Sepa and Paypal. Then later I will start with Paypal and Cards or whatever payments methods. For more clarification, we have a business when at some cases only few payment methods are allowed to be used so we need a way to not show the others.

Robert-SD commented 1 day ago

Thanks for rephrasing the question. Filtering the payment method list is also possible. Because you mentioned session in your initial post, I assume you use a sessions flow. In that case you can use the allowedPaymentMethods parameter in your /sessions request to filter payment methods. With this parameter you can control the allowed payment methods.

mumenahmedbright commented 1 day ago

Yes I was trying to start a session in flutter/dart code. Is that also possible in flutter? final SessionCheckout sessionCheckout = await AdyenCheckout.session.create( sessionId: sessionId, sessionData: sessionData, configuration: dropInConfiguration, );

Robert-SD commented 1 day ago

Just to clarify, would it be possible to adjust the API request calling /sessions? Because the payment methods are embedded into sessionData, this is the recommended approach. Before finding a workaround only on flutter/dart code, I would like to validate the intended setup.