You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Fundraising/Data and flow/PSP integrations/Form Chooser: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Wfan
imported>Ejegg
(Ejegg moved page Fundraising/Data and flow/PSP integrations/Form Chooser to Fundraising/Data and flow/PSP integrations/Gateway Chooser: Change doc page to match changed class and Special Page)
 
Line 1: Line 1:
== Overview ==
#REDIRECT [[Fundraising/Data and flow/PSP integrations/Gateway Chooser]]
We use form chooser as a middleware to select payment gateway for donor based on their country, and selected payment method, then prioritize the final gateway base on certain rule.
 
This is been used from our https://donate.wikimedia.org/ we choose the corespondent currency for country and gateway based on both country and payment method like cc or apple, stands for credit card and apple pay, and other params like payment submethod as visa amex and so on.
 
Then after select the target gateway like ingenico or adyen, return payment form and update the url to the target gateway.
 
For each payment gateway we have countries.yaml file that contains all the supported countries, this would be the first thing to check for supported gateway
 
Then check if support recurring, or sub-method supported ...
 
Then finally use rule (extension.json as DonationInterfaceGatewayPriorityRules) to select the target gateway
 
== Testing ==
We can go to DI box
 
docker-compose exec -w "/var/www/html/" payments /bin/bash
 
then test testAssertExpectedGateway to test all the target gateway
 
php tests/phpunit/phpunit.php --filter testAssertExpectedGateway
 
locally we can test as below
 
https://localhost:9001/index.php?title=Special:GatewayFormChooser&currency=USD&country=US&payment_method=cc

Latest revision as of 00:48, 14 September 2022