JavaScript SDK
Eximbay JavaScript SDK is utilized for integrating the payment page into your website.
This section provides guidance on
SDK installation, usage methods, parameter details, payment failure handling, and error response management.
Eximbay offers a customized payment page tailored to meet the merchant's requirements.
The payment page can be invoked based on the below transaction_type.
The function of the payment page will vary depending on the transaction_type when calling back the payment page.
PAYMENT: The payment page facilitates the automatic completion of payment authentication, authorization, and acquiring processes.
PAYER_AUTH: In this model, only Authentication will be performed during the payment page initiation. Automated authorization and acquiring API is required for this process.
AUTHORIZE: In this model, Authentication and authorization will be performed during the payment page initiation.Settlement
(acquiring) will be processed through the manual acquiring API initiated by the merchant.
REBILL: In this model, Authentication, authorization, and acquiring are performed without requiring additional card information input. Instead, the process utilizes the token ID generated during the Token Creation step after the payment page is invoked.
An additional contract is required for the manual acquiring API. Kindly inquire for further details.
SDK installation
Kindly add the Eximbay JavaScript SDK library to 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 Eximbay JavaScript SDK library, you can invoke the EXIMBAY.request_pay() method to initiate the payment page.
Payment page initiation
Before invoke payment page generating fgkey to prevent Unauthorized modification and falsification.
Please generate an FGkey using the Payment Preparation API. please refer to the Payment Preparation documentation.
After generating the fgkey, use the response value to initiate the SDK.
When using the SDK to initiate the payment page, ensure that the request parameters align with those of the previously initiated Payment Preparation API. Any discrepancies in parameter values may result in an FGKey mismatch, leading to payment failure.
<button type="button" onclick="payment();">Payment page integration</button>
.
.
.
<script type="text/javascript">
function payment() {
// Payment page integration sdk
EXIMBAY.request_pay({
// Fgkey that created by Payment Ready API
"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>
SDK parameter
Required Parameters to Initiate the Payment Page.
fgkey string
Mandatorypayment object
transaction_type string
Mandatory-
PAYMENT
: The payment page facilitates the automatic completion of payment authentication, authorization, and acquiring processes.
-
PAYER_AUTH
: In this model, only verification will be performed during the payment page initiation. Automated authorization and acquiring API or authorization-only API is required for this process.
-
AUTHORIZE
: In this model, verification and authorization will be performed during the payment page initiation.Settlement (acquiring) will be processed through the manual acquiring API initiated by the merchant.
- * An additional contract is required for the manual acquiring API.
-
REBILL
: In this model, verification, authorization, and acquiring are performed without requiring additional card information input. Instead, the process utilizes the token ID generated during the Token Creation step after the payment page is invoked.
order_id string
MandatoryThis is a unique identifier used to classify a merchant's order. This value cannot be reused for failed orders.
currency string
MandatoryPayment Currency Unit. For detailed information, please refer to the currency code.
amount string
MandatoryTotal Payment Amount. The amount must be greater than "0" and , cannot be used.
lang string
MandatoryLanguage Code: Specifies the language used on the payment page.
payment_method string
Payment Method Code: Defines the designated payment method that will redirect to the payment page. Please refer to the payment method code for details.
multi_payment_method string
* For Cross-Border payment Integration.
merchant object
mid string
MandatoryA unique merchant ID generated by Eximbay to identify the merchant.
shop string
Store Name: If the store name differs from the merchant name, please specify accordingly.
partner_code string
Partner code
url object
return_url string
MandatoryURL Information for the Merchant Page which where the buyer will be redirected after completing the payment process and receiving the payment result. The return URL is browser-based for the customer. If the browser is forcefully terminated, the return URL will not be initiated.
status_url string
Mandatory* Database tasks and payment processing should be handled within the statusURL. The returnURL will not be invoked if the customer forcefully terminates the session
* Duplicate invocation is allowed; however, please ensure that the payment is not processed multiple times.
buyerobject
name string
MandatoryCustomer's name
phone_number string
Customer's contact number
email string
MandatoryCustomer's email address. (for sending payment confirmation letter)
tax object* This parameter is used for Korean local payment processing.
receipt_status string
Select Y or N for issuing a cash payment receipt. For bank transfer payments, you must choose either Y or N for receipt issuance.
amount_tax_free string
The amount deducted for tax from the total payment.
amount_taxable string
The amount for tax from the total payment.
amount_vat string
The amount for VAT from the total payment.
amount_service_fee string
The amount for service charge from the total payment.
Note. 1 - All parameters in the tax object are mandatory for Naver Point payments.
other_param object
param1 string
A preparatory parameter available for merchants if needed. The parameter length is limited to 255 characters.
param2 string
A preparatory parameter available for merchants if needed. The parameter length is limited to 255 characters.
product array * The array length is limited to three.
name string
MandatoryMerchandise Name
quantity string
MandatoryMerchandise quantity
unit_price string
MandatoryMerchandise unit price
link string
MandatoryMerchandise purchasing link. this is mandatory for open market transactions.
surcharge array * The array length is limited to three.
name string
The name of the additional amount category (e.g., discount coupon, delivery fee).
quantity string
The quantity of the additional amount category, which must be greater than zero.
unit_price string
The unit price of the additional amount category, which cannot include , and may be sent with a negative quantity
ship_to object
city string
Delivery city
country string
Delivery country, represented by the ISO 3166 two digit country code
first_name string
Recipient's first name
last_name string
Recipient's last name
phone_number string
Recipient's contact number, with the option to include the country code.
postal_code string
Postal code
state string
Delivery state. This is applicable for delivery addresses in the U.S. and Canada, Please refer to the country code.
street1 string
Provide the remaining address details accordingly
bill_to object
city string
Billing city
country string
Billing country. ISO3166 two digit country code.
first_name string
Card holder's first name
last_name string
Card holder's last name
phone_number string
Card holder's contact number. with the option to include the country code.
postal_code string
Billing postal code
state string
Billing state. This is applicable for delivery addresses in the U.S. and Canada, Please refer to the country code.
street1 string
Provide the remaining address details accordingly
settings object
display_type string
-
P
: Opens the payment page as a pop-up.
-
R
: Redirects to the payment page from the merchant's site.
autoclose string
-
Y
: Redirects to the merchant's page.
-
N
: Redirects to the payment success page (default).
site_foreign_currency string
-
*
If the payment_method parameter is used, only P000 (credit card) can be specified.
-
*
Merchants utilizing the DCC service will have DCC-supported currencies displayed on the payment page. For information on DCC-supported currencies, please refer to the DCC currency code.
-
*
The real-time exchange rate is applied to the transaction amount through Eximbay's DCC service provider. Once the credit card information is entered, the amount will be converted to the currency of the card-issuing country.
-
*
For Cross-Border payment Integration.
call_from_app string
-
Y
: Call in the application environment (iOS, Android).
-
N
: Call in the web browser environment (default).
-
* Call the payment page within an app environment. Please refer to the External App Open in the WebView Integration Guide for further details.
call_from_scheme string
-
* Call the payment page within an app environment. Please refer to the External App Open in the WebView Integration Guide for further details.
issuer_country string
ostype string
-
P
: PC environment (default)
-
M
: Mobile environment
virtualaccount_expiry_datestring
tokenbilling object
token_creation string
: Token creation requested
* This is limited to transactions with the transaction type parameter set as PAYMENT.
unique_token_id string
: Token creation is allowed only for unique payment information (card). The request will be rejected if the payment information (card) already exists.
: Multiple token creations are allowed for the same payment information (card).
* This is limited to transactions with the transaction type parameter set as PAYMENT.
token_id string
* This is limited to transactions with the transaction type parameter set as REBILL.
Note. 1 - An additional contract is required for the token payment.
recurring object * Parameters for recurring payment registration
recurring_amount string
Mandatory, are not allowed as separators.
recurring_start_date string
MandatoryThe recurring date (next payment date) must be set after the start date, with payments processed on a monthly basis.
recurring_interval string
Mandatoryrecurring_noti_url string
remind_email_interval string
(Example: If set to '7', a notification email will be sent 7 days before the recurring payment date.)
fast_payment object
user_id string
Mandatoryuser_ci string
Mandatory* After completing identity verification on the merchant's site, set the 'userCi' as a parameter.
* If identity verification is not conducted on the merchant's site, prior notification to Eximbay is required, and 'userCi' should be set as a blank value.
phone_number string
Mandatory* Set as a blank value, if identity verification is not conducted on the merchant's site.
birthday string
Mandatory* Set as a blank value, if identity verification is not conducted on the merchant's site.
gender string
Mandatory: Male
: Female
* Set as a blank value, if identity verification is not conducted on the merchant's site.
foreigner string
Mandatory: Foreigner
: Citizen
* Set as a blank value, if identity verification is not conducted on the merchant's site.
Note. 1 - An additional contract is required for the fast payment.
SDK Error code
Please refer to the Error Code section for details on SDK callback errors.