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

Mandatory
Ensure that the fgkey generated from the Payment Preparation API is used For detailed information please refer to the payment preparation.

payment object

transaction_type string

Mandatory
Classify the payment page type accordingly. The options include PAYMENT, PAYER_AUTH AUTHORIZE REBILL. For detailed information, please refer to the Payment Preparation documentation.
  1. PAYMENT

    : The payment page facilitates the automatic completion of payment authentication, authorization, and acquiring processes.

  2. 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.

  3. 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.

  4. * An additional contract is required for the manual acquiring API.
  5. 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

Mandatory

This is a unique identifier used to classify a merchant's order. This value cannot be reused for failed orders.

currency string

Mandatory

Payment Currency Unit. For detailed information, please refer to the currency code.

amount string

Mandatory

Total Payment Amount. The amount must be greater than "0" and , cannot be used.

lang string

Mandatory

Language 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 multiple payment method designations, use a hyphen - as a separator (e.g., P000-P185-P186)

* For Cross-Border payment Integration.

merchant object

mid string

Mandatory

A 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

Mandatory

URL 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
Upon completion of the payment, the parameters returned via both the return_url, which is triggered based on the customer's browser, and the status_url, which is triggered from the merchant's server, will be identical. Script cookies and session storage cannot be used, as they are not accessible in the browser.

* 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

Mandatory

Customer's name

phone_number string

Customer's contact number

email string

Mandatory

Customer'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

Mandatory

Merchandise Name

quantity string

Mandatory

Merchandise quantity

unit_price string

Mandatory

Merchandise unit price

link string

Mandatory

Merchandise 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

Options for initiating the browser. The default value is P
  1. P

    : Opens the payment page as a pop-up.

  2. R

    : Redirects to the payment page from the merchant's site.

autoclose string

Options for closing the browser after payment completion. The default value is N.
  1. Y

    : Redirects to the merchant's page.

  2. N

    : Redirects to the payment success page (default).

site_foreign_currency string

This parameter is essential for displaying the amount in the currency selected by the customer on the payment page
  1. *

    If the payment_method parameter is used, only P000 (credit card) can be specified.

  2. *

    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.

  3. *

    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.

  4. *

    For Cross-Border payment Integration.

call_from_app string

Options for distinguishing the client environment. The default value is N.
  1. Y

    : Call in the application environment (iOS, Android).

  2. N

    : Call in the web browser environment (default).

  3. * 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

App scheme (App URL Scheme) to redirect from an external app to the merchant's app.
  1. * 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

Parameters for merchants utilizing cross-border payments who wish to adopt Korean local payments. Add the parameter KR to call the Korean local payment page.

ostype string

To call the payment page in a client environment. The default value is P.
  1. P

    : PC environment (default)

  2. M

    : Mobile environment

virtualaccount_expiry_datestring

Set the expiration date for Korean local virtual account payments. The required format is YYYYMMDDHH24.

tokenbilling object

token_creation string

To verify whether a token creation request has been made for cross-border issuing card simplified payment.
Y

: Token creation requested

* This is limited to transactions with the transaction type parameter set as PAYMENT.

unique_token_id string

To verify whether a token creation request has been made based on unique payment information (card).
Y

: Token creation is allowed only for unique payment information (card). The request will be rejected if the payment information (card) already exists.

N

: 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

Issued Token ID by Token creation request.

* 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
Recurring payment total amount : A maximum of 10 digits, including two decimal places (e.g., 10.50, 9.15).
, are not allowed as separators.

recurring_start_date string

Mandatory
Recurring payment start date : must be in an 8-digit format (YYYYMMDD).
The recurring date (next payment date) must be set after the start date, with payments processed on a monthly basis.

recurring_interval string

Mandatory
Processed on a monthly basis. The maximum recurring payment cycle is 10 months. (e.g., If the cycle is 3 months, enter '3').

recurring_noti_url string

Merchant's page to be redirected to after the recurring payment is completed. Maximum length is 255 characters.

remind_email_interval string

Notification email sent prior to the recurring payment (default value: 3). Maximum length is 2 characters.
(Example: If set to '7', a notification email will be sent 7 days before the recurring payment date.)

fast_payment object

user_id string

Mandatory
User ID

user_ci string

Mandatory
User CI

* 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
Phone number

* Set as a blank value, if identity verification is not conducted on the merchant's site.

birthday string

Mandatory
Birth day (YYYYMMDD)

* Set as a blank value, if identity verification is not conducted on the merchant's site.

gender string

Mandatory
Gender
M

: Male

F

: Female

* Set as a blank value, if identity verification is not conducted on the merchant's site.

foreigner string

Mandatory
Foreigner
T

: Foreigner

F

: 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.