Mock Forgery Provider
A mock forgery PSP (Payment Service Provider) that allow the payment request bypass the original PSP request.
Minimal explanation: The payment gateway will act as a PSP to simulate the payment request.
Request
To use the mock forgery provider send in the payment request body payload the metadata "useMock":true
OBS: The payment body is the same of the normal Payment Request explained here for the Checkout or here for the API.
Ex.:
{
...
"metadata": {
...
"useMock": true
}
}
Checkout page
It wont disable the scope PSP existing configuration, so the checkout page will be displayed as expected:
After select the payment method and fill the form the used will submit the payment so far as expected by the real PSP.
At the request process the Payment Gateway will identify the metadata and will redirect to be fake processed by the Mock Forgery Provider, bypassing this way the real PSP.
Mock Process
In the mock process the payment will be treated as a credit card 3DS payment. Redirecting to a page that the user will select the status of the payment (mocking it).
Response
After select the status to be used in the mock process. The Mock Forgery Provider will redirect to the payment, like the real PSP processing a credit card 3DS request, and will continue the payment flow.
Using the checkout page, will be redirect to the status page and later to the client page. And using the API the payment gateway will redirect to the client URL directly without passing by the PGW checkout status page.
TODO
- Mock payment request
- Mock the recurring payments request
- Mock the refund requests
- Intercept any real PSP connection error and internally redirect to use the Mock Forgery Provider to avoid fail tests
- Show in the Mock Status Select Page the reason that the payment was redirected
- Get the real PSP connection fail message or show a generic message informing that the real PSP is DOWN or can’t to the server handshake
- Show in the Mock Status Select Page the reason that the payment was redirected
- Add more status to be selected
- PRE_AUTHORIZED
- CANCELED
- REFUNDED
- PARTIAL_REFUND