Create Wallet Payment Method (Zain Cash)

Hello,

I want to add new payment method to my website, I contact the company and they do not have an add-on for cs-cart , they send me php files ,I want some one guide me how to create or add this wallet system or create this payment method,

https://zaincash.iq/en/integration/integration-with-php/

The php files they send to me:

request.php

redirect.php

credentials.php

and the email me with these instructions:

Thank you for your interest in ZainCash, please find the integration files in the attachments
You can use the test mode at the beginning, to make sure of the process if it passes we will share your live credentials with you.
Please make sure that you work on the test server.
Here is the test credentials that will work on the test server https://test.zaincash.iq:
Msisdn: ********
Merchant Id: *********************
Secret: *************************************
You can use this test wallet to pay from it
Wallet number: *************
PIN: **********
OTP: ****************
the request.php and redirect.php both are in your server, so the redirection URL will be created upon your server/ domain and according to where you will put your file/ code that will get the token from our end to check the status of the payment and complete any other process you need.
To make it clearer here is the payment steps:
you will create a token according to your merchant and secret (it's a JWT token you can find the way in the files attached).
you will set the token data for every payment which:
The amount of money (a number in IQD and it should be more than 250).
The service Type (a string, any string from your side prefers to be your website name).
The MSISDN (a string has your wallet number).
The orderId (string or number, it refers to an id in your system, you will get this id in the redirecting so you can check the status of the operation).
The redirectUrl (a string of a URL in your system/ server that has the redirect.php file so ZainCash redirects to it after finishing from his side).
The iat & exp are the expiry time for the token, please leave it as it is.
you will set your redirect RUL ie: example.com/somthing/redirect.php.
you will get the status of the operation by checking the redirected token.
you can find in that token:
The status (’success’ or ‘fail’) to inform you that the payment completed or not.
The orderId (the same orderId you’ve sent, this can help you track your payments and closing your orders)
The id is the transaction id from ZainCash side, it’s recommended to save this one inside your system/ DB you can know which payment is for whom).
The iat & exp you can ignore this two if you like,
In the attachments are the integration files you can choose whichever package that suits your requirements.
Regards

flow.png

You can find some information here

https://docs.cs-cart.com/latest/developer_guide/addons/tutorials/payment_processor_addon.html

Thanks alot