انتقل إلى المحتوى الرئيسي

Zaincash Payment

we use the only way available in zaincash, see.

1- Prepare Payment

first the client needs to make a request to StartZainCashPaymentAsync.

the endpoint will do few validations, then it will create new internal transaction, then it will call the function ZainCashService.PrepareCheckoutAsync. the method will call /transaction/init of zaincash api.

then few validations and the transaction will be saved, and a response of the payment url will be sent back to the client. see for more details about the endpoint

2- payment

the user should be redirected to the payment form and after the payment is complete, the user should be redirected to the {e-cube-api}/e-payment/zaincash/result.

3- confirm payment

the endpoint {e-cube-api}/e-payment/zaincash/result will sent a token GET parameter by zaincash api, it will decode it after few validations, and save the transaction status, and if the status is success then it will change the order status to New using OrderService.CheckoutForOnlinePaymentAsync.

and then the user will be redirected to the frontendRedirectUrl sent in the start endpoint, that has been saved in the internal transaction object, if it was not sent the endpoint will return a response of the internal transaction details.

for more details about result endpoint see

ZainCashPaymentProcess