I would highly appreciate if someone could help me to say which extension I should use to start modifying!
Here's a documentation: https://payunity.docs.oppwa.com/tutoria ... tion-guide
1. Prepare the checkout
First, perform a server-to-server POST request to prepare the checkout with the required data, including the order type, amount and currency. The response to a successful request is a JSON string with an id, which is required in the second step to create the payment form.
2. Create the payment formCode: Select all
function request() { $url = "https://test.oppwa.com/v1/checkouts"; $data = "authentication.userId=8a8294174e0078ad014e1a2781e035ab" . "&authentication.password=8Dy7awrPX3" . "&authentication.entityId=8a8294174e0078ad014e1a2781d035a7" . "&amount=92.00" . "¤cy=EUR" . "&paymentType=DB"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);// this should be set to true in production curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $responseData = curl_exec($ch); if(curl_errno($ch)) { return curl_error($ch); } curl_close($ch); return $responseData; } $responseData = request();
To create the payment form you just need to add the following lines of HTML/Javascript to your page and populating the following variables
The checkout's id that you got in the response from step 1The shopperResultUrl, which is the page on your site where the customer should be redirected to after the payment is processed and the brands that will be available.Code: Select all
<script src="https://test.oppwa.com/v1/paymentWidgets.js?checkoutId={checkoutId}"></script>
3. Get the payment statusCode: Select all
<form action="{shopperResultUrl}" class="paymentWidgets">VISA MASTER AMEX</form>
Once the payment has been processed, the customer is redirected to your shopperResultUrl along with a GET parameter resourcePath.
Important: The baseUrl must end in a "/", e.g. "https://test.oppwa.com/".
Then, to get the status of the payment, you should make a GET request to the baseUrl + resourcePath, including your authentication parameters.
Example of a resourcePath: resourcePath=/v1/checkouts/{checkoutId}/payment
Code: Select all
function request() { $url = "https://test.oppwa.com/v1/checkouts/{id}/payment"; $url .= "?authentication.userId=8a8294174e0078ad014e1a2781e035ab"; $url .= "&authentication.password=8Dy7awrPX3"; $url .= "&authentication.entityId=8a8294174e0078ad014e1a2781d035a7"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);// this should be set to true in production curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $responseData = curl_exec($ch); if(curl_errno($ch)) { return curl_error($ch); } curl_close($ch); return $responseData; } $responseData = request();