Payment page integration preparation
For payment page integration, the Payment Preparation API callback is included as part of the validation process.
Therefore, both SDK preparation and API preparation are required for completion. The FGKey is essential—before invoking the payment page via the SDK, ensure that the FGKey is properly prepared.
Attach the SDK
Install the Eximbay library on the HTML page to integrate the payment page.
<!-- jQuery -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<!-- SDK -->
<script type="text/javascript" src="https://api-test.eximbay.com/v1/javascriptSDK.js"></script>
After installing the SDK library, you may initiate the request_pay method using the EXIMBAY object. If the payment page successfully pops up, the integration is complete.
<button type="button" onclick="payment();">Payment page integration</button>
.
.
.
<script type="text/javascript">
function payment() {
EXIMBAY.request_pay({
"fgkey" : "0E9BE04BA239A519E68171F26B68604ADA0A85C8350DBF5C8C0FCCF98461DB09",
"payment" : {
"transaction_type" : "PAYMENT",
"order_id" : "20220819105102",
"currency" : "USD",
"amount" : "1",
"lang" : "EN"
},
"merchant" : {
"mid" : "1849705C64"
},
"buyer" : {
"name" : "eximbay",
"email" : "test@eximbay.com"
},
"url" : {
"return_url" : "eximbay.com",
"status_url" : "eximbay.com"
}
});
}
</script>
The URL for calling back the SDK differs between the test environment and the production environment. Please refer to the URLs below.
Integration environment | URL |
---|---|
Production environment | https://api.eximbay.com |
Test environment | https://api-test.eximbay.com |
For further details on the Eximbay SDK, please refer to the JavaScript SDK documentation.
API preparation
Please prepare the API key, verification process, and request protocol settings to enable the API callback.
API key used for verification
To make a request to the Eximbay API, a verification process is required. The API key, which was received after signing the Eximbay payment gateway contract, must be used to initiate the verification process. Before the contract is finalized, please use the test API key for testing purposes.
mid: 1849705C64
API Key: test_1849705C642C217E0B2D
The API key received via email must be kept secure. It should not be used in publicly accessible environments, such as a web browser.
Issuing API Key
To issue the API key, an Eximbay payment gateway contract is required. Upon signing the contract, the API key and merchant MID will be sent to the designated email address.
During the development stage of Eximbay online payment integration, the test API key and test MID will be used in the testing environment. Once the testing environment development is complete, the production API key and MID will be used. When performing payment tests with the test API key, funds will not be deducted from the bank account. The test API key begins with test_ while the production API key begins with live_.
API key category | Item | Description | Fund deduction | Precautions or not |
---|---|---|---|---|
Live key | live_ | Production payment is processed for customers in the live payment environment. | O | Fund will be deducted from bank account. |
Test key | test_ | Test payment is conducted for the purpose of validating a merchant's payment integration. | X | Fund will not be deducted from bank account. |
The URL for calling back the API differs between the test environment and the production environment. Please refer to the URLs below.
Integration environment | URL |
---|---|
Production environment | https://api.eximbay.com |
Test environment | https://api-test.eximbay.com |
Authentication
Add an Authorization field to the HTTP request header, encoding the API key using Base64. Ensure that you append a colon : to the end of the API key before encoding it, and prefix the encoded API key with the word 'Basic'.
Authorization: Basic dGVzdF8xODQ5NzA1QzY0MkMyMTdFMEIyRDo=
Basic authorization is part of the HTTP Basic Authentication process, where the username:password is encoded using Base64. However, in the Eximbay API, only the username (API key) is included in the encoding, while the password is not used.
Request protocol configuration
All requests to the Eximbay API endpoints must adhere to the HTTPS protocol. SSL/TLS versions below TLS 1.2 are considered vulnerable to security risks. Only versions above TLS 1.2 are supported