WEB JS SDK / Use the binding credit card

Use the binding credit card.

Before using ECPay’s Embedded Checkout Page, merchant’s server should call ECPay’s API to get a Token. After receiving the token, merchants should set this token onto merchant’s webpage with the integration of ECPay’s JavaScript SDK to access the binding credit card page.

				
					ECPay.addBindingCard(Token, Language, callBack(errMsg))
				
			

INPUT

Token String
Required

  • A token used to validate merchant’s identity
  • The lifespan is 30 minutes.

Language String
Required

To use multilingual function, and Two languages are avaliable:

  • ECPay.Language.zhTW : Traditional Chinese
  • ECPay.Language.enUS: English

callBack description

The callback function after createPayment is completed. For example, if initialization fails, error message received by the callBack.

				
					function (errMsg) {}
				
			

Get an example of how to use the binding credit card.

				
					ECPay.initialize(serverType, function (errMsg) {
    var lang = getCookie("language");
    if (!lang) {
        lang = ECPay.Language.zhTW;
        }
ECPay.addBindingCard("55a026b8df314f9bb2dc808a5fe21c9d", lang, function (errMsg) {
        //to do..
    });
});
				
			

Copyright © Green World FinTech Service Co., Ltd. All rights reserved.

綠界官方網站