Merchant Integration Guide

All the tools you need

1. Overview

This document provides Noqoody specification including integration with merchant website, and specification of initializing payment process. This document also provides HTTP API used to get payment token, validating payment request, as well as payment response with HTTP API specification.

2. Authentication and Security

Noqoody payment gateway exchanges data between merchant and gateway in the form of Request and Response. All communications with Noqoody are encrypted with an external layer of encryption “SSL” Once you are enrolled in the Noqoody, you will be provided with a unique UserID for both a sandbox and a production environment. The Noqoody environment UserID will be provided upon successful completion of your sandbox integration. Please note that the UserID is not interchangeable. It is merchant’s responsibility to keep the credentials in a secure and hidden environment.

3. Merchant Authorization

Noqoody requires user identification for each transaction level authentication and authorization.

4. Integration Guide

Please click here to download the postman collection for your production account.

Please click here to download the postman collection for your sandbox account.

4.1 Token

To start using Noqoody Payment Services, first call the following API to receive the bearer token

API

https://noqoodypay.com/sdk/token
                                            
Request
                                            
POST /sdk/token HTTP/1.1
Host: noqoodypay.com
Content-Length: 72
grant_type=password&username=noqoody_user_name&password=noqoody_password
                                            
                                            
Response
                                                
{
    "access_token": "access_token",
    "token_type": "bearer",
    "expires_in": 1209599,
    "userName": "user_name",
    "Name": "name_on_noqoody_account",
    "Role": "user_role",
    "ImageLocation": "logo_on_noqoody_account",
    "Email": "name_on_noqoody_account",
    ".issued": "Sun, 07 Aug 2022 07:38:57 GMT",
    ".expires": "Sun, 21 Aug 2022 07:38:57 GMT"
}
                                                
                                            

4.2 Generate Link & Session

This API will generate the payment URL which will redirect the user to Noqoody where the payment will be handled automatically by the Noqoody Payment System or the SessionID and UUID can be used in section 4.3 API for generating the links separately if you are looking for a custom solution. The SessionID and UUID in this API will be used for the API stated in section 4.3 in which all the payment options will be displayed in the form of an array with their respective links

4.2.1 Generate Secure Hash (SHA256)

Please use the following link as reference on how to generate secure hash: LINK

Format: {CustomerEmail}{CustomerName}{CustomerMobile}{Description}{ProjectCode}{Reference}

You will need the Client Secret Key as the key value to generate the secure hash

Secret Key: The client secret will be sent via email to the registered account. For the sandbox environment, you can find the secret key in the portal provided by the Technical Support Team

4.2.2 Generate Payment Link & Session

                                            
API
https://noqoodypay.com/sdk/api/PaymentLink/GenerateLinks
Request
POST /sdk/api/PaymentLink/GenerateLinks HTTP/1.1
Host: noqoodypay.com
Content-Length: 358

{
    "ProjectCode": "your_project_code",
    "Description": "order_description_less_than_40_characters_with_no_special_characters",
    "Amount": "45.00",
    "CustomerEmail": "customers_email",
    "CustomerMobile": "customers_mobile_number",
    "CustomerName": "customers_name",
    "SecureHash": "secure_hash",
    "Reference": "reference_id"
}
                                            
                                            
            
Response
{
    "PaymentUrl": "https://sandbox.noqoodypay.com/test/payment.html?SessionID=8116ba10-1a25-457e-a818-vcaa323kjdfs&uuid=136852454",
    "ProjectCode": "project_code",
    "Reference": "your_custom_unique_reference",
    "Description": "Order_Description",
    "Amount": 36,
    "CustomerEmail": "example@gmail.com",
    "CustomerName": "Customer",
    "CustomerMobile": "12345678",
    "SessionId": "8116ba10-1a25-457e-a818-vcaa323kjdfs",
    "Uuid": "136852454",
    "success": true,
    "code": "OK",
    "message": "Payment Link Generated",
    "errors": []
}
            
        

4.3 Generate Payment Options

            
API
https://noqoodypay.com/sdk/api/PaymentLink/PaymentChannels?SessionID=sessionid_here&uuid=uuid_here
Request
GET /sdk/api/PaymentLink/PaymentChannels?SessionID=sessionid_here&uuid=uuid_here HTTP/1.1
Host: noqoodypay.com
            
        
            
Response
The following response will have payment links to Credit Card, Debit Card, PayPal, Google Pay™, Ooredoo & Vodafone

{
    "PaymentChannels": [
        {
            "ID": 0,
            "ChannelName": "Payment_Channel_Name",
            "ImageLocation": "Payment_Channel_Image",
            "PaymentURL": "Payment_URL_Used_for_redirecting_customer"
        }
    ],
    "TransactionDetail": {
        "MerchantName": "Company_name_on_noqoody_account",
        "TransactionDescription": "Transaction_Description",
        "Amount": 36,
        "Reference": "your_custom_unique_reference",
        "MobileNumber": "your_company_mobile_number_on_noqoody_account",
        "Email": "your_email_on_noqoody_account",
        "CustomerEmail": "example@gmail.com",
        "CustomerMobile": "12345678",
        "CustomerName": "Customer_Name",
        "MerchantLogo": "your_company_logo_url"
    },
    "success": true,
    "code": "200",
    "message": "",
    "errors": []
}
            
        

4.4 Validate Payment

            
API
https://noqoodypay.com/sdk/api/PaymentLink/PaymentChannels?SessionID=sessionid_here&uuid=uuid_here
Request
GET /sdk/api/Members/GetTransactionDetailStatusByClientReference/?ReferenceNo={your_unique_reference} HTTP/1.1
Host: www.noqoodypay.com
            
        
            
Response (Successful)
{
    "TransactionID": "00000",
    "ResponseCode": "NA",
    "Amount": 1.0000,
    "TransactionDate": "2022-05-17T09:02:30.097",
    "TransactionStatus": "0000",
    "Reference": "your_custom_unique_reference",
    "ServiceName": "Payment_Channel_Name",
    "Mobile": "customer_mobile",
    "TransactionMessage": "Payment processed successfully.",
    "PUN": "noqoody_bank_reference",
    "description": "Order_Description",
    "InvoiceNo": "invoice_number",
    "DollarAmount": 0.0,
    "Email": null,
    "PayeeName": null,
    "success": true,
    "code": "OK",
    "message": "Transaction Found",
    "errors": []
}
Response (Failure)
{
    "TransactionID": "00000",
    "ResponseCode": "NA",
    "Amount": 36.0000,
    "TransactionDate": "2022-07-25T11:30:01.213",
    "TransactionStatus": "2996",
    "Reference": "your_custom_unique_reference",
    "ServiceName": "Payment_Channel_Name",
    "Mobile": "customer_mobile",
    "TransactionMessage": "Canceled before payment method selection.",
    "PUN": "noqoody_bank_reference",
    "description": "Order_Description",
    "InvoiceNo": "invoice_number",
    "DollarAmount": 0.0,
    "Email": null,
    "PayeeName": null,
    "success": false,
    "code": "OK",
    "message": "Transaction Found",
    "errors": []
}
            
        

Before we can start using mobile payments, please follow the steps in the Web until section 4.2.2 to generate the SessionID and UUID.

Please follow the steps below after the SessionID and UUID have been generated:

1. Sending OTP to mobile number

The following API will consume the SessionID, UUID & another extra field ChannelID. The ChannelID property will represent the type of mobile payment

Ooredoo = 1

Vodafone = 2

                                            
API
https://noqoodypay.com/sdk/api/PaymentLink/RequestDCBPayment
Request
{
    "SessionID": "sample string 1",
    "UUID": "sample string 2",
    "ChannelID": 3
}
Response
{
    "SessionID": "sample string 1",
    "UUID": "sample string 2",
    "ChannelID": 2,
    "RequestNumber": "sample string 4",
    "success": true,
    "code": "sample string 6",
    "message": "sample string 7",
    "errors": [
        "sample string 1",
        "sample string 2"
    ]
}
                                            
                                        

2. Validating OTP

The following API will consume the SessionID, UUID, RequestNumber (In response of previous API) & OTP

                                            
API
https://noqoodypay.com/sdk/api/PaymentLink/ProcessDCBPayment
Request
{
    "SessionID": "sample string 1",
    "UUID": "sample string 2",
    "RequestNumber": "sample string 3",
    "OTP": "sample string 4"
}
Response
Use the RedirectURL in this response to redirect the user back to the callback URL that is set in your noqoody account.

{
    "RedirectURL": "sample string 1",
    "PUN": "sample string 2",
    "TransactionID": "sample string 3",
    "ResponseCode": "sample string 4",
    "MobileNumber": "sample string 5",
    "Amount": 6.0,
    "TransactionDate": "2022-08-09T14:22:32.2273996+03:00",
    "TransactionStatus": "sample string 8",
    "Reference": "sample string 9",
    "Provider": "sample string 10",
    "success": true,
    "code": "sample string 12",
    "message": "sample string 13",
    "errors": [
        "sample string 1",
        "sample string 2"
    ]
}
                                            
                                        

Please click here to download the APK

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

                                            
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
                                            
                                        

Step 2. Add the dependency

Add the following dependency in your app-level build.gradle:

                                            
dependencies {
implementation 'com.github.Qmobile-IT:NoqoodyPaySDK:1.0.13'
}
                                            
                                        

Step 3: To Call Payment

Use the following method to initiate a payment:

                                            
NoqoodyPay.Pay(Activity activity, String baseURL, String UserName, String Password, Double Amount, String CustomerEmail,
String CustomerMobile, String ProjectCode, String Description, String RedirectURL, String Reference, String ClientSecret)
                                            
                                        

Note: base URL should end with “ / ”

Step 4. To receive Payment status

Override the `onActivityResult` method in your activity to handle payment status:

                                            
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == NoqoodyPay_Keys.Activity_RequestCode) {
        if (resultCode == Activity.RESULT_OK) {
            
            //For Payment Status
            data.getStringExtra(NoqoodyPay_Keys.paymentresult_status)

            //For Payment Result Message
            data.getStringExtra(NoqoodyPay_Keys.paymentresult)

            //For Payment Result Data
            data.getStringExtra(NoqoodyPay_Keys.paymentresultData)

        }
    }
}
                                            
                                        

Please click Here to download the necessary files for integration with iOS