STC Pay
Moyasar API provides the required facilities for adding STC pay payment methods to your website or system. STC pay is a digital wallet service that will allow users to utilize wallets to pay for Merchants.
This guide ensures an easy process for how to integrate STC pay into your system.
The process of making an STC pay payment is composed of the following steps:
- The user clicks on the
- OTP form is presented to the user.
- The user enters the OTP they receive from STC pay and verifies it.
- Payment details are sent securely to Moyasar servers and then processed.
- The user is redirected back to the URL specified in callback_url when the payment
Before you start integrating with Moyasar API, make sure you complete these steps:
Set up the payment form with an input for mobile number in your website checkout page and send a POST request to Moyasar API to initiate the payment
Include the endpoint required attributes from your side as a merchant:
Parameter | Description |
---|---|
amount | Should be in the smallest currency unit. eg: 100 Halals to charges 1 Riyal. |
currency optional | 3-letter ISO code for currency. (default: SAR) |
publishable_api_key | To authenticate the payment. |
description optional | This may include a description of the merchandise or the service that your customer is billed for. |
source[type] | The value should be stcpay. |
source[cashier] optional | The cashier ID. |
source[branch] optional | The branch ID. |
The user will provide the mobile number for proceeding to charge:
Parameter | Description |
---|---|
source[mobile] | Provided by the customer starting with 05 |
POST Request JSON
Once the payment is initiated successfully, handle the JSON response and then use transaction_url to pass the OTP value entered by the user to proceed with the payment by sending a GET/POST request.
Parameter | Description |
---|---|
otp_value | Sent to the customer by SMS. |
- GET Request JSON
On success, it returns the paid status payment object. If none of the requirements is met, the status will be failed.