Creating Order / Introduction

Scenario

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 checkout page. ECPay will then validate this token to check merchant’s identity before displaying the checkout page.

Credit card payment process flow with 3D secure authentication

  1. Call initialize() function of ECPay’s JavaScript SDK (inputting parameter ServerType, IsLoading and callback).
  2. Call API (/GetTokenByTrade) to get a Token
  3. Call createPayment() function of SDK (inputting Token, Language, and callback).
  4. Consumer (cardholder) press pay button and get PayToken
  5. Call API (/CreatePayment) to create an order.
  6. Return ThreeDURL.
  7. Merchant’s server receives the ThreeDURL and passes it to its web.
  8. Receive payment result from OrderResultURL.
  9. Receive payment result from ReturnURL.

❗ Special note: In step 7, merchants should set up a specific URL to redirect your customer to the ThreeDURL on receiving it. This step is crucial, or else customer will not be able to do 3DS and the payment will not be completed.

Credit card payment without using 3D secure authentication

  1. Call initialize() function of ECPay’s JavaScript SDK (inputting parameter ServerType, IsLoading and callback).
  2. Call API (/GetTokenByTrade) to get a Token
  3. Call createPayment() function of SDK (inputting Token, Language, and callback).
  4. Consumer (cardholder) press pay button and get PayToken
  5. Call API (/CreatePayment) to create an order.
  6. Receive payment result from ReturnURL.

UnionPay card payment

  1. Call initialize() function of ECPay’s JavaScript SDK (inputting parameter ServerType, IsLoading and callback).
  2. Call API (/GetTokenByTrade) to get a Token
  3. Call createPayment() function of SDK (inputting Token, Language, and callback).
  4. Consumer (cardholder) press pay button and get PayToken
  5. Call API (/CreatePayment) to create an order.
  6. Return UnionPayURL.
  7. Merchant’s server receives UnionPayURL and passes it to its web.
  8. Receive payment result from OrderResultURL.
  9. Receive payment result from ReturnURL.

❗ Special note: In step 7, merchants should set up a specific URL to redirect customer to the UnionPayURL on receiving it. This step is crucial, or else customer will not be able to do 3DS and the payment will not be completed.

Non-credit card payment process

  1. Call initialize() function of ECPay’s JavaScript SDK (inputting parameter ServerType, IsLoading and callback).
  2. Call API (/GetTokenByTrade) to get a Token
  3. Call createPayment() function of SDK (inputting Token, Language, and callback).
  4. Consumer (cardholder) press pay button and get PayToken
  5. Call API (/CreatePayment) to create an order.
  6. Receiving payment number from ECPay.
  7. Once the consumer completes the payment, the bank/convenience store will notify ECPay. Receive payment result from ReturnURL.

ApplePay payment process

  1. Before integrating Apple Pay, please follow the path on ECPay’s dashboard to set the domain: ECPay’s dashboard > System development management > ApplePay interface settings (see the following screenshot.) For more details about the setting steps, please check the manual of ECPay’s dashboard, else check the FAQ.

  2. Call initialize() function of ECPay’s JavaScript SDK (inputting parameter ServerType, IsLoading and callback).
  3. Call API (/GetTokenByTrade) to get a Token
  4. Call createPayment() function of SDK (inputting Token, Language, and callback).
  5. Consumer (cardholder) press pay button and get PayToken
  6. Merchants can get payment result by implement via getApplePayResultData().

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

Green World