Open alexsegura opened 2 years ago
I think a good example can be found in this piece of code in PayGreen/sylius-paygreen-plugin
.
It creates a payment using paygreen/paygreen-php
and redirects the user to a payment page. Should be quite the same when using an iframe.
// Redirect the customer to the PayGreen payment page
throw new HttpPostRedirect($url);
Having multiple payment platforms is a giant issue to assess, and has a large number of negative consequences in regards to adding exponential complexity in a number of different ways.
What we want is to be able to use Stripe OR PayGreen. For each restaurant, we need to add a property that allows to choose between Stripe and PayGreen.
GatewayResolver::resolve
to pass the order as parameter, and decide which gateway to use based on the order context (if the restaurant of the order should use PayGreen, use it)See libs
See examples
See docs