Standard Integration
2. Standard Integration
Form Data Configuration
When integrating for staging/test environments please use the url specified for staging and use the live URL when integrating for production/live. The URL should be specified as the form action attribute.
- Staging URL: http://pay.staging.atarapay.com
- Live URL: https://pay.atarapay.com
Making a request call
A request can be made directly from a web form or mobile application using a webview to initialize a payment for an order, for testing you can make a request using the CURL script below:
- The authorization type is Bearer and
my_public_key
should be replaced with the Public Key found in your seller dashboard at API > API Keys > Public Key - The order details are to be specified in your form specified as the name of each value or sent as
www-form-encoded
- The currency value should either be NGN for Nigerian Naira or USD for United State Dollars
Mobile App Integration
Webview is required for mobile app implementations, this can be obtained by using Webview
plugin or package from package managers or importing it directly from the mobile SDK library depending on the framework or language.
CURL Request for testing
curl -X POST
-F "token=my-public-key"
-F "email=customer_email"
-F "phone_number=customer_phone"
-F "amount=amount"
-F "http://pay.staging.atarapay.com"
Form names and expected values
'token' => 'required',
'email' => 'required|email',
'phone_number' => 'required|numeric',
'currency' => 'required|max:3|in:NGN,USD',
'amount' => 'required', _amount in kobo_
'amount_fx' => 'required_if_currency=USD',
'customer_firstname' => 'required',
'customer_lastname' => 'required',
'order_product_id' => 'required|numeric',
'order_product_name' => 'required',
'order_product_desc' => 'optional',
'delivery_date' => 'required',
'delivery_location' => 'required',
'recipient' => 'required|phone_number',
'alt_recipient' => 'required|phone_number,
'type' => 'required', _set as 1_,
'is_marketplace' => 'optional|numeric|default:0',
'seller_phone' => 'required_if:is_marketplace=1|phone',
'sp_id' => 'optional|numeric',
'sp_commission' => 'optional|numeric',
'callback_url' => 'required|url'
Field name | Required | Description |
---|---|---|
token | Yes | Your public key obtain from your Atarapay dashboard |
Yes | Email Address of the customer | |
phone_number | Yes | Phone Number of the customer |
currency | Yes | Transaction Currency (NGN or USD) |
amount | Yes | Amount in kobo |
amount_fx | Yes | Amount converted to USD (required if currency is USD) |
customer_firstname | Yes | Customer's First name |
customer_lastname | Yes | Customer's Last name |
order_product_id | Yes | The seller's product ID |
order_product_name | Yes | The seller's product name |
order_product_desc | Optional | The seller's product Description |
delivery_date | Yes | The seller's delivery date |
delivery_location | Yes | The customer's delivery location |
recipient | Yes | The phone number of the customer |
alt_recipient | Optional | Phone number of someone else to receive the order that is not the customer |
type | Yes | Transaction type (Always set to 1) |
is_marketplace | Optional | set to 1 if the merchant is registered as a Marketplace Operator on Atarapay's platform |
seller_phone | Yes | The AtaraPay phone number of the merchant's service provider that is registered with AtaraPay (if is_marketplace = 1) |
sp_id | Optional | Service Provider ID associated to a seller |
sp_commission | Optional | Service Provider Commission for a transaction |
callback_url | Yes | Callback link to receive response and status from AtaraPay |
Request Payload Example
{
"token":"your-public-key",
"amount": 110075,
"amount_fx": "1100.75",
"callback_url": "http://woocommerce.atarapay.com/wc-api/at_wc_atara_gateway",
"currency": "NGN",
"customer_firstname": "Ogundele",
"customer_lastname": "John",
"delivery_date": "2022-09-23 12:21:54",
"delivery_location": "Bosso Ile-eja Akoko North East Akoko North East NG ",
"email": "john@atarapay.com",
"order_product_desc": "Samsung Galaxy Tab",
"order_product_id": "7441",
"order_product_name": "Samsung Galaxy Tab S3 SM-T825 - 9.7 Inch, 32GB, 4GB, 4G LTE, Silver With S Pen",
"phone_number": "+2348111904455",
"platform": "Woocommerce",
"recipient": "+2348111904455",
"sp_commission": "null",
"sp_id": "null"
"type": 1
}
Marketplace Seller Option
If you are registered as a Marketplace Operator, please set the is_marketplace
parameter to 1
and seller_phone
parameter to thephone number
of a valid atarapay seller account on your store, but if you are registered as a Business Seller, you can leave the is_marketplace
parameter as 0
and set seller_phone
to null
.
Your marketplace app can be integrated to AtaraPay by registering with either the Marketplace Operator or Business Seller role. For details on the differences they offer, click here.
Expected Response
The response is an html template that is to be consumed in a webview and we would take it up from there.
๐๐
Click click here to view simulation of the buyer journey.
Error Response Format
If API request fails you should get an error response in the format below.
Error Response:
{
"currency is required",
"amount is required",
"amount_fx is required",
"customer_firstname is required",
"customer_lastname is required",
"customer_email is required",
"customer_phone is required",
"order_product_id is required",
"order_product_name is required",
"order_product_desc is required",
"recipient is required",
"delivery_date is required",
"delivery_location is required",
"is_marketplace is required",
"seller_phone is required",
"callback_url is required"
}
Contact Us
For further details or bug report please contact our support team at support@atarapay.com or you can visit our website at www.atarapay.com and start a LIVE CHAT.