### Setup Function
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
An alternative way to initialize the SDK using a setup function, which can be useful for avoiding naming conflicts.
```APIDOC
## Initialize with Setup Function
### Description
Initializes the Payaza checkout with a setup function, providing an option to rename it if needed.
### Method Signature
`setup(options)` or `PayazaSetup(options)`
### Parameters
- **options** (object) - Configuration object for the checkout. See `PayazaCheckout` constructor for details.
### Request Example (JavaScript)
```javascript
import {setup} from "payaza-web-sdk";
const payazaCheckout = setup({});
payazaCheckout.showPopup();
```
### Request Example with Renamed Setup Function
```javascript
import {setup as PayazaSetup} from "payaza-web-sdk";
const payazaCheckout = PayazaSetup({});
payazaCheckout.showPopup();
```
```
--------------------------------
### Initialize Payaza Checkout using Setup Function
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Use the `setup` function for a simplified initialization of the Payaza checkout. This is an alternative to direct instantiation.
```javascript
import {setup} from "payaza-web-sdk";
...
const payazaCheckout = setup({});
payazaCheckout.showPopup();
```
--------------------------------
### Install React Native Payaza SDK
Source: https://docs.payaza.africa/developers/apis/sdks/mobile-sdk/react-native
Install the Payaza React Native SDK using npm or yarn.
```bash
npm install react-native-payaza
```
```bash
yarn add react-native-payaza
```
--------------------------------
### Install Payaza Web SDK using npm
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Install the Payaza Web SDK using npm. This is the first step to integrating the checkout functionality into your website.
```bash
npm install payaza-web-sdk
```
--------------------------------
### Install Payaza Web SDK using yarn
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Install the Payaza Web SDK using yarn. This is an alternative to npm for integrating the checkout functionality.
```bash
yarn add payaza-web-sdk
```
--------------------------------
### Install React Native WebView Dependency
Source: https://docs.payaza.africa/developers/apis/sdks/mobile-sdk/react-native
Install the react-native-webview package, which is a required dependency for the Payaza SDK.
```bash
npm install react-native-webview
```
--------------------------------
### Authorization Header Example
Source: https://docs.payaza.africa/developers/apis/make-payments/sub-accounts/create-sub-account
Example of the required Authorization and x-TenantID headers for the sub-account creation endpoint. Replace placeholders with your actual API key and tenant mode.
```json
{
"authorization": "Payaza UFo3OC1QS0xJVkUtRjMwODcwNUMtRkY2NC00MEJCLTg1OUUtM0ZCQUI4MTJBNzdC",
"x-TenantID": "test"
}
```
--------------------------------
### Rename Setup Function in TypeScript
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
If the default `setup` function name conflicts with your existing code, you can import and rename it to avoid issues.
```typescript
import {setup as PayazaSetup} from "payaza-web-sdk";
...
const payazaCheckout = PayazaSetup({});
payazaCheckout.showPopup();
```
--------------------------------
### Install React Native Clipboard Dependency for Bear Flow
Source: https://docs.payaza.africa/developers/apis/sdks/mobile-sdk/react-native
For the Bear React Native flow, install the @react-native-clipboard/clipboard package.
```bash
npm install --save @react-native-clipboard/clipboard
```
--------------------------------
### Initialize and Display Payaza Checkout Popup
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
This example demonstrates how to initialize the Payaza Checkout SDK and display the payment popup. Ensure the script is loaded and the `handleButtonClick` function is called to trigger the checkout process. Configure `merchant_key`, `connection_mode`, `checkout_amount`, `currency_code`, and other customer details as required.
```html
Document
```
--------------------------------
### Authorization Header Example
Source: https://docs.payaza.africa/developers/apis/collections/card-collection/account-transaction-history
This is an example of the required Authorization header format for API requests. Replace the placeholder with your actual Base64 encoded public API key.
```json
{
"authorization": "Payaza UFo3OC1QS0xJVkUtRjMwODcwNUMtRkY2NC00MEJCLTg1OUUtM0ZCQUI4MTJBNzdC"
}
```
--------------------------------
### Sub Account Creation Response
Source: https://docs.payaza.africa/developers/apis/make-payments/sub-accounts/create-sub-account
This is an example of a successful response when creating a sub-account. It includes details such as the account ID, name, status, balance, and virtual account information.
```json
{
"message": "New account created",
"status": true,
"data": [
{
"id": 1110,
"accountName": "Test Sub Account",
"accountStatus": "ACTIVE",
"accountBalance": 0,
"escrowBalance": 0,
"businessFk": 11407,
"currency": "NGN",
"owner": "PAYAZA",
"country": "NGA",
"creationReference": "DC625576B5BF426A94CB6B1D868C0",
"actionStatus": "ACTIVE",
"payazaAccountReference": "2010000120",
"pnc": false,
"pnd": false,
"virtualAccounts": [
{
"accountNumber": "9977719429",
"accountName": "MERCHANT(Test Sub Account)",
"bankCode": "000023"
}
]
}
]
}
```
--------------------------------
### Link React Native WebView
Source: https://docs.payaza.africa/developers/apis/sdks/mobile-sdk/react-native
Manually link the react-native-webview module if autolinking does not occur. Remember to run 'pod install' after linking.
```bash
react-native link react-native-webview
```
--------------------------------
### Payaza Callback Response Object
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
This is an example of the successful response object received from Payaza after a transaction. It contains details about the transaction status, reference, and customer information.
```json
{
"type": "success",
"status": 201,
"data": {
"message": "Transaction Successful",
"payaza_reference": "P-C-20231018-1TLB7K68",
"transaction_reference": "PL296969",
"transaction_fee": 100,
"transaction_total_amount": 105,
"currency": {
"name": "Naira",
"code": "NGN",
"unicode": "₦",
"html_value": "₦"
},
"customer": {
"customer_id": "HCC4ZX96W",
"email_address": "johndoe@gmail.com",
"first_name": "Big",
"last_name": "Maitre",
"mobile_number": "01232425262"
}
}
}
```
--------------------------------
### Get Account Transaction History (Python)
Source: https://docs.payaza.africa/developers/apis/collections/card-collection/account-transaction-history
Use this Python snippet to fetch account transaction history. It demonstrates how to construct the request payload with service details, date ranges, and pagination. Ensure you have the correct authorization header.
```python
import http.client
import json
conn = http.client.HTTPSConnection("router-live.78financials.com")
payload = json.dumps({
"service_type": "Account",
"service_payload": {
"request_application": "Payaza",
"application_module": "USER_MODULE",
"application_version": "1.0.0",
"request_class": "GetTransactionHistoryRequest",
"start_date": "24-02-2023",
"end_date": "17-12-2023",
"order": "desc",
"page": 1
}
})
headers = {
'Authorization': 'Payaza UFo3OC1QS1RFU1QtNjUzMEY2OTYtMzlCOS00QERk',
'Content-Type': 'application/json'
}
conn.request("POST", "/api/request/secure/payloadhandler", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
--------------------------------
### Payaza Error Response: Invalid Merchant Key
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
An example of an error response when an invalid merchant key is provided. This typically results in a 401 status code.
```json
{
"type": "error",
"status": 401,
"data": {
"message": "Sorry merchant key is not valid"
}
}
```
--------------------------------
### Get Account Transaction History
Source: https://docs.payaza.africa/developers/apis/collections/card-collection/account-transaction-history
This endpoint retrieves a list of account transactions. You can filter the results by specifying a date range, the order of transactions, and the desired page number. The request requires a service type and a detailed service payload.
```APIDOC
## POST /api/request/secure/payloadhandler
### Description
Fetches all account transactions. The data output can be filtered using the date range.
### Method
POST
### Endpoint
https://router-live.78financials.com/api/request/secure/payloadhandler
### Parameters
#### Request Body
- **service_type** (string) - Required - The type of service. Must be "Account".
- **service_payload** (object) - Required - It contains the details of the service payload.
- **request_application** (string) - Required - The application being used to request.
- **application_module** (string) - Required - The module of the application.
- **application_version** (string) - Required - The version of the application.
- **request_class** (string) - Required - The class of the request. Must be "GetTransactionHistoryRequest".
- **start_date** (date) - Optional - The start date range to filter data in DD-MM-YYYY format.
- **end_date** (date) - Optional - The end date range to filter data in DD-MM-YYYY format.
- **order** (string) - Optional - The arrangement order is either ascending or descending. Use "asc" for ascending and "desc" for descending. (The default is ascending).
- **page** (integer) - Required - The page number.
### Request Example
```json
{
"service_type": "Account",
"service_payload": {
"request_application": "Payaza",
"application_module": "USER_MODULE",
"application_version": "1.0.0",
"request_class": "GetTransactionHistoryRequest",
"start_date": "24-02-2023",
"end_date": "17-12-2023",
"order": "desc",
"page": 1
}
}
```
### Response
#### Success Response (200)
- **response_code** (integer) - The code indicating the success of the operation.
- **response_message** (string) - A message describing the result of the operation.
- **response_content** (object) - Contains the transaction details.
- **page** (integer) - The current page number.
- **transaction_count** (integer) - The number of transactions on the current page.
- **transactions** (array) - A list of transaction objects.
- **transaction_reference** (string) - The unique reference for the transaction.
- **transaction_status** (string) - The status of the transaction (e.g., "Completed").
- **transaction_amount** (number) - The amount of the transaction.
- **fee_amount** (number) - The fee associated with the transaction.
- **source_account_name** (string) - The name of the source account.
- **source_account_number** (string) - The number of the source account (can be null).
- **source_bank_name** (string) - The name of the source bank.
- **payment_date** (string) - The date and time the payment was made in YYYY-MM-DD HH:MM:SS.sss format.
#### Response Example
```json
{
"response_code": 200,
"response_message": "Account Transactions returned",
"response_content": {
"page": 1,
"transaction_count": 10,
"transactions": [
{
"transaction_reference": "QWE123ASD456L",
"transaction_status": "Completed",
"transaction_amount": 100,
"fee_amount": 0,
"source_account_name": "Mastercard Payment",
"source_account_number": null,
"source_bank_name": "VISA",
"payment_date": "2023-02-24 23:31:42.085"
},
{
"transaction_reference": "PQZVVVzCSXASL",
"transaction_status": "Completed",
"transaction_amount": 1,
"fee_amount": 0,
"source_account_name": "Mastercard Payment",
"source_account_number": null,
"source_bank_name": "VISA",
"payment_date": "2023-02-24 10:08:29.243"
}
]
}
}
```
### Headers
- **Authorization** (string) - Required - Payaza {{Public API Key encoded in base 64}}
```
--------------------------------
### Initialize PayazaCheckout with Options
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Instantiate the PayazaCheckout class with various configuration options for a seamless checkout experience. This includes setting up merchant details, currency, customer information, and event handlers.
```APIDOC
## Initialize PayazaCheckout
### Description
Instantiate the PayazaCheckout class with configuration options.
### Method Signature
`new PayazaCheckout(options)`
### Parameters
#### Options Object
- **merchant_key** (string) - Required - Your unique merchant public key.
- **connection_mode** (string) - Required - Set to 'Live' or 'Test'.
- **checkout_amount** (number) - Required - The amount to be paid.
- **currency_code** (string) - Required - The currency code (e.g., 'NGN').
- **email_address** (string) - Required - Customer's email address.
- **first_name** (string) - Required - Customer's first name.
- **last_name** (string) - Required - Customer's last name.
- **phone_number** (string) - Required - Customer's phone number.
- **transaction_reference** (string) - Required - A unique reference for the transaction.
- **virtual_account_configuration** (object) - Optional - Configuration for virtual account expiry.
- **expires_in_minutes** (number) - Optional - The time in minutes after which the virtual account expires.
- **additional_details** (object) - Optional - Additional metadata to be passed with the transaction.
- **onClose** (function) - Optional - Callback function to be executed when the checkout popup is closed.
- **callback** (function) - Optional - Callback function to handle the response after the transaction.
### Request Example (JavaScript)
```javascript
import PayazaCheckout from "payaza-web-sdk";
const payazaCheckout = new PayazaCheckout({
merchant_key: "",
connection_mode: "Live", // Live || Test
checkout_amount: Number(2000),
currency_code: "NGN",
email_address: "example@email.com",
first_name: '',
last_name: '',
phone_number: "+1200000000",
transaction_reference: 'your_reference',
virtual_account_configuration: {
"expires_in_minutes": 15
},
additional_details: {
user_id: "1273",
ticket: "TEUBD9382892"
},
onClose: function() {
console.log("Closed")
},
callback: function(callbackResponse) {
console.log(callbackResponse)
}
});
// Display popup
payazaCheckout.showPopup();
```
### Request Example (TypeScript)
```typescript
import PayazaCheckout from "payaza-web-sdk";
import { PayazaCheckoutOptionsInterface } from 'payaza-web-sdk/lib/PayazaCheckoutDataInterface'
const data: PayazaCheckoutOptionsInterface = {
merchant_key: "",
connection_mode:"Live", // Live || Test
currency_code: "NGN",
email_address: "example@email.com",
first_name: '',
last_name: '',
phone_number: "+1200000000",
transaction_reference: 'your_reference',
virtual_account_configuration: {
"expires_in_minutes": 15
},
additional_details: {
user_id: "1273",
ticket: "TEUBD9382892"
},
onClose: function() {
console.log("Closed")
},
callback: function(callbackResponse) {
console.log(callbackResponse)
}
}
const checkout = new PayazaCheckout(data)
checkout.showPopup()
```
```
--------------------------------
### Initialize Payaza Checkout with Options
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Instantiate the PayazaCheckout class with comprehensive configuration options for live or test environments. Set up callbacks and event handlers for transaction feedback.
```javascript
import PayazaCheckout from "payaza-web-sdk";
...
const payazaCheckout = new PayazaCheckout({
merchant_key: "",
connection_mode: "Live", // Live || Test
checkout_amount: Number(2000),
currency_code: "NGN",
email_address: "example@email.com",
first_name: '',
last_name: '',
phone_number: "+1200000000",
transaction_reference: 'your_reference',
//Set Virtual account time limit (optional)
virtual_account_configuration: {
"expires_in_minutes": 15
},
//Additional Details (metadata)
additional_details: {
user_id: "1273",
ticket: "TEUBD9382892"
},
onClose: function() {
console.log("Closed")
},
callback: function(callbackResponse) {
console.log(callbackResponse)
}
});
// Alternatively, you can set the onClose and callback function as described below
function callback(callbackResponse){
console.log(callbackResponse)
}
function onClose(){
console.log("closed")
}
payazaCheckout.setCallback(callback)
payazaCheckout.setOnClose(onClose)
// Display popup
payazaCheckout.showPopup();
// Display popup
payazaCheckout.showPopup();
```
--------------------------------
### Create Sub Account - Python
Source: https://docs.payaza.africa/developers/apis/make-payments/sub-accounts/create-sub-account
Use this snippet to create a new sub-account. Ensure you have the correct tenant ID and authorization header. The payload requires the main account reference, sub-account name, currency, and country code.
```python
import http.client
import json
conn = http.client.HTTPSConnection("api.payaza.africa")
payload = json.dumps({
"mainAccountPayazaReference": "100000000",
"name": "Test Sub Account",
"currency": "NGN",
"country": "NGA"
})
headers = {
'X-TenantID': 'test',
'Authorization': 'Payaza UFo3OC1QS0xJVkUtRjMwODcwNUMtRkY2NC00MEJCLTg1OUUtM0ZCQUI4MTBNzdC',
'Content-Type': 'application/json'
}
conn.request("POST", "/live/payaza-account/api/v1/subaccounts/merchant", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```
--------------------------------
### Initialize and Use Payaza in React Native
Source: https://docs.payaza.africa/developers/apis/sdks/mobile-sdk/react-native
Import the Payaza SDK, initialize the transaction, and handle success or error responses. Ensure the Payaza component is rendered with your merchant key and callbacks.
```javascript
import Payaza, {
type IPayaza,
type PayazaErrorResponse,
type PayazaSuccessResponse,
PayazaConnectionMode,
} from 'react-native-payaza'
// ...
const payaza = React.useRef(null);
// ...
const payNow = () => {
payaza.current?.createTransaction({
amount: Number(110),
connectionMode: PayazaConnectionMode.LIVE_CONNECTION_MODE,
email: "example@example.com",
firstName: "",
lastName: "",
phoneNumber: "<+12345678900>",
currencyCode: 'NGN',
transactionReference: "transaction_reference",
});
}
const handleError = (response: PayazaErrorResponse) => {
Alert.alert(response.data.message, 'Error Occurred');
};
const handleSuccess = (response: PayazaSuccessResponse) => {
Alert.alert(
response.data.message,
`Transaction reference {$response.data.payaza_reference}`
);
};
// ...
return (
Pay Now
)
```
--------------------------------
### Initialize Payaza Checkout with TypeScript
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Configure and initialize the PayazaCheckout with TypeScript, utilizing the provided interface for type safety. Ensure all required options are correctly defined.
```typescript
import PayazaCheckout from "payaza-web-sdk";
import { PayazaCheckoutOptionsInterface } from 'payaza-web-sdk/lib/PayazaCheckoutDataInterface'
...
const data:PayazaCheckoutOptionsInterface = {
merchant_key: "",
connection_mode:"Live", // Live || Test
currency_code: "NGN",
email_address: "example@email.com",
first_name: '',
last_name: '',
phone_number: "+1200000000",
transaction_reference: 'your_reference',
//Set Virtual account time limit (optional)
virtual_account_configuration: {
"expires_in_minutes": 15
},
// Additional details added here (metadata)
additional_details: {
user_id: "1273",
ticket: "TEUBD9382892"
},
onClose: function() {
console.log("Closed")
},
callback: function(callbackResponse) {
console.log(callbackResponse)
}
}
const checkout = new PayazaCheckout(data)
checkout.showPopup()
```
--------------------------------
### Payaza Error Response: Connection Code Mismatch
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
This error occurs when the provided business profile credentials do not match the selected connection mode (Live or Test).
```json
{
"type": "error",
"status": 401,
"data": {
"message": "Business Profile Credentials does not match connection mode selected"
}
}
```
--------------------------------
### Show Popup
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Triggers the display of the Payaza checkout popup to the user.
```APIDOC
## Show Popup
### Description
Displays the Payaza checkout popup interface to the user.
### Method Signature
`payazaCheckout.showPopup()`
### Request Example (JavaScript)
```javascript
payazaCheckout.showPopup();
```
```
--------------------------------
### Set Callback and OnClose Handlers
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Dynamically set the callback and onClose functions after initializing the PayazaCheckout instance.
```APIDOC
## Set Callback and OnClose Handlers
### Description
Allows setting the callback and onClose functions after the PayazaCheckout instance has been created.
### Method Signature
`payazaCheckout.setCallback(callbackFunction)`
`payazaCheckout.setOnClose(onCloseFunction)`
### Parameters
- **callbackFunction** (function) - The function to handle the transaction response.
- **onCloseFunction** (function) - The function to execute when the popup is closed.
### Request Example (JavaScript)
```javascript
function callback(callbackResponse){
console.log(callbackResponse)
}
function onClose(){
console.log("closed")
}
payazaCheckout.setCallback(callback)
payazaCheckout.setOnClose(onClose)
```
```
--------------------------------
### Create Transaction
Source: https://docs.payaza.africa/developers/apis/sdks/mobile-sdk/react-native
Initiates a payment transaction using the Payaza SDK. This method requires various customer and transaction details, along with your merchant key and connection mode.
```APIDOC
## createTransaction
### Description
Initiates a payment transaction with the provided details.
### Method Signature
`createTransaction(params: { amount: number, connectionMode: PayazaConnectionMode, email: string, firstName: string, lastName: string, phoneNumber: string, currencyCode: string, transactionReference: string })`
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
* **amount** (number) - Required - The amount the customer is expected to pay.
* **connectionMode** (PayazaConnectionMode) - Required - Mode of session (LIVE_CONNECTION_MODE or TEST_CONNECTION_MODE).
* **email** (string) - Required - The email address of the customer.
* **firstName** (string) - Required - The first name of the customer.
* **lastName** (string) - Required - The last name of the customer.
* **phoneNumber** (string) - Required - Phone number of the customer in international standard format (e.g., +12345678900).
* **currencyCode** (string) - Required - The code of the currency (e.g., NGN, USD).
* **transactionReference** (string) - Required - A unique reference generated for the transaction.
### Request Example
```javascript
payaza.current?.createTransaction({
amount: 110,
connectionMode: PayazaConnectionMode.LIVE_CONNECTION_MODE,
email: "example@example.com",
firstName: "",
lastName: "",
phoneNumber: "<+12345678900>",
currencyCode: 'NGN',
transactionReference: "transaction_reference",
});
```
### Response
#### Success Response
* **data** (object) - Contains transaction details upon success.
* **message** (string) - Success message.
* **payaza_reference** (string) - The reference generated by Payaza.
#### Error Response
* **data** (object) - Contains error details.
* **message** (string) - Error message.
### Callbacks
* **onSuccess**: Function called when the transaction is successful.
* **onError**: Function called when the transaction fails.
* **onClose**: Function called when the payment modal is closed.
```
--------------------------------
### Create A Sub Account
Source: https://docs.payaza.africa/developers/apis/make-payments/sub-accounts/create-sub-account
This endpoint creates a new sub-account under your main Payaza account. Access to this API is available upon request; please email support@payaza.africa for approval.
```APIDOC
## POST /live/payaza-account/api/v1/subaccounts/merchant
### Description
This endpoint creates a sub account.
### Method
POST
### Endpoint
https://api.payaza.africa/live/payaza-account/api/v1/subaccounts/merchant
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
- **mainAccountPayazaReference** (string) - Required - The Reference of the main Payaza account
- **name** (string) - Required - The name of this subaccount
- **currency** (string) - Required - The currency code
- **country** (string) - Required - The country code in ISO 3166-1 alpha-3 format
### Request Example
```json
{
"mainAccountPayazaReference": "100000000",
"name": "Test Sub Account",
"currency": "NGN",
"country": "NGA"
}
```
### Response
#### Success Response (200)
- **message** (string) - Indicates the success of the operation.
- **status** (boolean) - Indicates the status of the operation.
- **data** (array) - Contains the details of the created sub-account.
- **id** (integer) - The unique identifier for the sub-account.
- **accountName** (string) - The name of the sub-account.
- **accountStatus** (string) - The current status of the sub-account.
- **accountBalance** (number) - The current balance of the sub-account.
- **escrowBalance** (number) - The current escrow balance of the sub-account.
- **businessFk** (integer) - The foreign key of the associated business.
- **currency** (string) - The currency of the sub-account.
- **owner** (string) - The owner of the sub-account.
- **country** (string) - The country code of the sub-account.
- **creationReference** (string) - The reference generated during creation.
- **actionStatus** (string) - The action status of the sub-account.
- **payazaAccountReference** (string) - The Payaza reference for the sub-account.
- **pnc** (boolean) - Indicates if PNC is enabled.
- **pnd** (boolean) - Indicates if PND is enabled.
- **virtualAccounts** (array) - A list of virtual accounts associated with the sub-account.
- **accountNumber** (string) - The virtual account number.
- **accountName** (string) - The name associated with the virtual account.
- **bankCode** (string) - The bank code for the virtual account.
#### Response Example
```json
{
"message": "New account created",
"status": true,
"data": [
{
"id": 1110,
"accountName": "Test Sub Account",
"accountStatus": "ACTIVE",
"accountBalance": 0,
"escrowBalance": 0,
"businessFk": 11407,
"currency": "NGN",
"owner": "PAYAZA",
"country": "NGA",
"creationReference": "DC625576B5BF426A94CB6B1D868C0",
"actionStatus": "ACTIVE",
"payazaAccountReference": "2010000120",
"pnc": false,
"pnd": false,
"virtualAccounts": [
{
"accountNumber": "9977719429",
"accountName": "MERCHANT(Test Sub Account)",
"bankCode": "000023"
}
]
}
]
}
```
### Authorization Header Values
- **Authorization**: `Payaza {{Public API Key encoded in base 64}}`
- **x-TenantID**: `Connection mode: “live” or “test”`
```
--------------------------------
### Error Handling
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Information on common errors and their corresponding response formats.
```APIDOC
## Errors
### Description
Provides examples of error responses for common integration issues.
### Invalid Merchant Key Error
```json
{
"type": "error",
"status": 401,
"data": {
"message": "Sorry merchant key is not valid"
}
}
```
### Validation Error
```json
{
"type": "error",
"status": 400,
"data": {
"message": "Error during validation",
"errors": [
{
"field": "merchant_key",
"errors": [
"'merchant_key' is required"
]
},
{
"field": "checkout_amount",
"errors": [
"'checkout_amount' must be numeric"
]
},
{
"field": "first_name",
"errors": [
"'first_name' cannot be blank"
]
},
{
"field": "email_address",
"errors": [
"'email_address' cannot be blank",
"'email_address' must be a valid email address"
]
}
]
}
}
```
### Connection Code Mismatch Error
```json
{
"type": "error",
"status": 401,
"data": {
"message": "Business Profile Credentials does not match connection mode selected"
}
}
```
```
--------------------------------
### Callback Response Object
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
Details of the data structure received in the callback function upon transaction completion.
```APIDOC
## Callback Response Object
### Description
Structure of the response object received by the `callback` function.
### Response Body Example
```json
{
"type": "success",
"status": 201,
"data": {
"message": "Transaction Successful",
"payaza_reference": "P-C-20231018-1TLB7K68",
"transaction_reference": "PL296969",
"transaction_fee": 100,
"transaction_total_amount": 105,
"currency": {
"name": "Naira",
"code": "NGN",
"unicode": "₦",
"html_value": "₦"
},
"customer": {
"customer_id": "HCC4ZX96W",
"email_address": "johndoe@gmail.com",
"first_name": "Big",
"last_name": "Maitre",
"mobile_number": "01232425262"
}
}
}
```
```
--------------------------------
### Payaza Error Response: Validation Error
Source: https://docs.payaza.africa/developers/apis/sdks/web-sdk
This error response indicates issues with the provided transaction data. It details which fields failed validation and the specific reasons.
```json
{
"type": "error",
"status": 400,
"data": {
"message": "Error during validation",
"errors": [
{
"field": "merchant_key",
"errors": [
"'merchant_key' is required"
]
},
{
"field": "checkout_amount",
"errors": [
"'checkout_amount' must be numeric"
]
},
{
"field": "first_name",
"errors": [
"'first_name' cannot be blank"
]
},
{
"field": "email_address",
"errors": [
"'email_address' cannot be blank",
"'email_address' must be a valid email address"
]
}
]
}
}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.