AtaraPay Docs

AtaraPay Docs

  • Integration
  • API Reference

›Payment Plugin

Integration Overview

  • Get Started
  • Ground-up Development
  • Framework Development

Authentication

  • Calculation of Auth Token

Payment Plugin

  • Inline Integration
  • Standard Integration
  • Go Live

eCommerce Plugin

  • WooCommerce Payment Plugin
  • Magento Payment Extension
  • Shopify Payment Plugin

Payouts

  • Service Provider API
  • Create Service Provider
  • Get Service Provider
  • Delete Service Provider
  • Update Order Commission (Business Seller)
  • Update Order Commission (Marketplace Operator)

Milestone Payments

  • Overview
  • Create Project
  • Update Project
  • Get Project

Order Status Automation

  • Overview
  • Delivery Completed API.
  • Seller Cancels Order API
  • Buyer Cancels Order API
  • Order Status API

Order Notification

  • Overview
  • Delivery Complete Notification
  • Buyer Accepts Order Notification
  • Buyer Rejects Order Notification
  • Buyer Cancels Order Notification
  • Buyer Cancels Disputed Order Notification
  • Seller Cancels Order Notification
  • Seller Cancels Disputed Order Notification
  • Second Delivery Attempt Notification
  • Generation of Security Token

Resources

  • Status Definition
  • Get Bank Details
  • Marketplace Integration
  • Product Features List

Inline Integration

1. Inline Integration

Add AtaraPay inline javascript and css files to your page

  • <link rel="stylesheet" href="https://plugins.atarapay.com/assets/test/trustpay.inline.min.css">
  • <script src="https://plugins.atarapay.com/assets/test/trustpay.inline.min.js"></script>

Add the following to your html body

<form id="trustpay-form">
    <button id="ataraPayButton" type="button" style="">
</form>

Note: The Button is not styled. Style the Button to fit.

Add Functionality to the Button

var payWithTrustpay = function () {
    my-api-key = 'my-public-key'
    merchant = new Merchant({api_key:my-public-key});
            handler = TrustPay.setup(merchant);
            handler.initialize(customer_email, customer_phone_number, {
                type : 1,
                currency: NGN or USD,
                amount: order_price,
                amount_fx: order_price_in_USD,
                customer_firstname: first_name,
                customer_lastname: last_name,
                order_product_id: product_id, 
                order_product_name: product_name,
                order_product_desc: product_description,
                "order_product_weight": order_product_weight,
                "order_product_quantity": order_product_quantity,
                "order_product_dimension": order_product_dimension,
                "product_type": "product_type",
                recipient: order_recipient,
                delivery_date: order_delivery_date,
                delivery_location: order_delivery_location,
                is_marketplace: 0,
                seller_phone: null,
                sp_id: sp_id,
                sp_commission: sp_commission,
                callback_url: success_redirection_URL
            });
}
Field nameRequiredDescription
tokenYesYour public key obtain from your Atarapay dashboard
emailYesEmail Address of the customer
phone_numberYesPhone Number of the customer
currencyYesTransaction Currency (NGN or USD)
amountYesAmount in kobo
amount_fxYesAmount converted to USD (required if currency is USD)
customer_firstnameYesCustomer's First name
customer_lastnameYesCustomer's Last name
order_product_idYesThe seller's product ID
order_product_nameYesThe seller's product name
order_product_descOptionalThe seller's product Description
delivery_dateYesThe seller's delivery date
delivery_locationYesThe customer's delivery location
recipientYesThe phone number of the customer
alt_recipientOptionalPhone number of someone else to receive the order that is not the customer
typeYesTransaction type (Always set to 1)
is_marketplaceOptionalset to 1 if the merchant is registered as a Marketplace Operator on Atarapay's platform
seller_phoneYesThe AtaraPay phone number of the merchant's service provider that is registered with AtaraPay (if is_marketplace = 1)
sp_idOptionalService Provider ID associated to a seller
sp_commissionOptionalService Provider Commission for a transaction
callback_urlYesThis is the Callback link provided by you to receive response and status from AtaraPay.
order_product_dimensionYesProduct dimension of the item. The format is Lenght x Width x Height in centimeters (cm). Note that AtaraPay only supports one item type in the cart.
product_typeNoProduct type value should be ‘physical’ or ‘virtual’. A physical product is one that is shippable and has weight and dimensions like a pair of shoes. A virtual is one that is not shippable and doesn’t have weight and dimension like website development.
order_product_weightNoProduct weight of the item in kilograms (kg)

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.

Add the function to you the button

<form id="trustpay-form"><button id="trustpayButton" type="button" style="" onclick="payWithTrustpay()"></form>

All the fields are required.

Next Step

You should have a modal/pop-up appear after button is clicked, once you see this you are good to go 😊🚀 Figure 6

Successful Payment Response

After the customer makes a payment, they will automatically be redirected to the callback URL provided by you. In addition to the provided callback URL, you will receive the AtaraPay order ID and Product ID specified in the POST request. You can then get the order details from the the order ID via the API click here.

Contact Us

For Further Details Please Contact TrustPay for Platform API

← Calculation of Auth TokenStandard Integration →
  • 1. Inline Integration
    • Add AtaraPay inline javascript and css files to your page
    • Add the following to your html body
    • Add Functionality to the Button
    • Marketplace Seller Option
    • Next Step
    • Successful Payment Response
  • Contact Us
Docs
IntegrationeCommerce PluginsAPI ReferenceAtaraPay
Other Links
About UsFrequently Asked QuestionsReport a Bug
Merchants
BenefitsOur Merchants
Follow @atarapayonline
AtaraPay
Copyright © 2024 AtaraPay