WEB JS SDK / Get Apple Pay Result

Get Apple Pay Payment Result

If Apple Pay is provided as a payment method, this function should be implemented in order to receive the callback of payment result notification.

				
					getApplePayResultData(resultData, errMsg)
				
			

❗ Special note:

  • In case of any error happened when receiving the payment result on the front-end (i.e. internet connection error), the payment result notification should be based on that received from the endpoint of ReturnURL (server-side.)
  • If you would like to know the state of the order, you can call the searching order API by sending MerchantID and MerchantTradeNo to check whether the order is valid.

resultData Parameter Description(Json format)

RtnCode Int

Response codes to indicate whether the API is successfully executed or not.

  • 1: API is successfully executed.
  • Others: failed.
  • For more details please see error codes.

RtnMsg String(200)

Response messages.

PlatformID String(10)

Platform merchant’s MerchantID

MerchantID String(10)

Merchant ID

OrderInfo Object

Order information

MerchantTradeNo String(20)

Merchant’s order ID

TradeNo String(20)

ECPay’s order ID

TradeAmt Int
 

Transaction amount

TradeDate String(20)

Time at which the order was created.
Format: yyyy/MM/dd HH:mm:ss

PaymentType String(20)
 

Date of payment.
Format: yyyy/MM/dd HH:mm:ss

PaymentDate String(20)
 

Date of payment.
Format: yyyy/MM/dd HH:mm:ss

ChargeFee Number
 

ECPay’s service charge

TradeStatus String(8)
 

Status of transaction. Possible values:

  • 0 :the order was created but the payment has not yet been made.
  • 1 : the order was created and the payment has been made.

CardInfo Object
 

Card information

AuthCode String(6)
 

Authorization code

Gwsr Int
 

ID of authorization

ProcessDate String(20)
 

Date of processing authorization.
Format: yyyy/MM/dd HH:mm:ss

Amount Int
 

Transaction/authorization amount

Eci Int
 

Return value of 3D (VBV).This is a value returned from the Directory Server (Visa, MasterCard, and JCB) to indicate the authentication results of cardholder’s credit card payment on 3D Secure.

Possible values:

5, 6, 2, 1: The value returned (ECI) means that transaction was a 3D secure authentication.

Card6No String(6)
 

First 6 digits of credit card

Card4No String(4)
 

Last 4 digits of credit card

IssuingBank String(30)
 

Bank name

IssuingBankCode String(10)
 

Bank code

CustomField String(200)
 

A parameter for merchant to place customized value.

Example

				
					function getApplePayResultData(resultData, errMsg) {
    Console.log(resultData);
    If(resultData != null){
    /*your code*/
    }
};
				
			

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

Green World