Subscription Integration Guide

🌐 Language Switch / 语言切换

English | 中文


1. Card Subscription

Card subscription is supported across all three products: Direct API, Drop-in, and LinkPay. The first transaction completes card binding and authorizaition, gererating a token. Subsequent charges are initiated using the saved token without requiring the user to re-enter card details.


1.1 Card Subscription via Direct API

Use the POST /payment endpoint. Set recurringProcessingModel: "Subscription" in the first payment to complete card binding and obtain a token.


1.1.1 Initial Card Binding & Payment

Request example:

{
    "merchantTransInfo": {
        "merchantTransTime": "{{merchantTransTime}}"
    },
    "transAmount": {
        "currency": "HKD",
        "value": "100"
    },
    "paymentMethod": {
        "type": "card",
        "card": {
            "cardInfo": {
                "cardNumber": "4895330111111119",
                "expiryDate": "1231"
            }
        },
        "recurringProcessingModel": "Subscription"
    },
    "userInfo": {
        "reference": "your_user_reference"
    },
    "captureAfterHours": "0",
    "allowAuthentication": true,
    "returnURL": "https://www.evonetglobal.com",
    "webhook": "https://webhook.merchant.com"
}

Key fields:

FieldTypeDescriptionNotes
paymentMethod.typestringPayment methodSet to card for card subscription
paymentMethod.recurringProcessingModelstringTransaction typeSubscription, Unscheduled
userInfo.referencestringUnique user identifier in merchant systemUsed to bind card info and token to the user
allowAuthenticationbooleanEnable 3DS authenticationRecommend false for subscription (MIT)

Key response fields:

FieldTypeDescription
paymentMethod.recurringReferencestringRecurring agreement ID
paymentMethod.token.valuestringToken value for subsequent charges
paymentMethod.paymentMethodVariantstringIndicates Recurring

API Reference: POST /payment , GET /payment/{merchantTransID}


1.1.2 Subsequent Subscription Charges

Use the saved token.value, changing paymentMethod.type to token :

{ 
    "merchantTransInfo": {
        "merchantTransTime": "{{merchantTransTime}}"
    },
    "transAmount": {
        "currency": "HKD",
        "value": "100"
    },
    "paymentMethod": {
        "type": "token",
        "token":{
            "value":"pmt_9a4a8a6355c044ce80903ce3d860eacb"
        },
        "recurringProcessingModel": "Subscription"
    },
    "captureAfterHours": "0",
    "allowAuthentication": false,
    "returnURL": "https://www.evonetglobal.com",
    "webhook": "https://webhook.merchant.com"
}

1.2 Card Subscription via Drop-in

Use the Drop-in pre-built UI component to implement subscription without building a custom payment page.

1.2.1 Obtain sessionID

Pass subscription parameters when calling POST /interaction :

{
    "userInfo": {
        "reference": "your_user_reference"
    },
    "paymentMethod": {
        "recurringProcessingModel": "Subscription"
    }
}

Extract sessionID from the response and pass it to the frontend DropInSDK.

API Reference: POST /interaction

1.2.2 Retrieve Token

Obtain token.value from the webhook notification or GET /interaction/{merchantOrderID} query endpoint. Save it and associate it with userInfo.reference.

API Reference: GET /interaction/{merchantOrderID}

1.2.3 Subsequent Subscription Charges

Same as Direct API — call POST /payment :

{
    "paymentMethod": {
        "token": {
            "value": "previously-saved-token"
        },
        "recurringProcessingModel": "Subscription"
    }
}

1.3 Card Subscription via LinkPay

Use LinkPay payment links to implement subscription. Users click the link, select pay by card, and complete card binding.

1.3.1 Create LinkPay Payment Link

Pass subscription parameters when calling POST /interaction :

{
    "userInfo": {
        "reference": "your_user_reference"
    },
    "paymentMethod": {
        "recurringProcessingModel": "Subscription"
    }
}

After obtaining the payment link (LinkUrl), redirect the user to the LinkPay payment page.

API Reference: POST /payment

1.3.2 Retrieve Token

Obtain token.value from the webhook notification or GET /interaction/{merchantOrderID} query endpoint. Save it and associate it with userInfo.reference.

API Reference: GET /interaction/{merchantOrderID}

1.3.3 Subsequent Subscription Charges

Same as Direct API — call POST /payment :

{
    "paymentMethod": {
        "token": {
            "value": "previously-saved-token"
        },
        "recurringProcessingModel": "Subscription"
    }
}


2. e-Wallet Subscription

Supported Wallets:

RegionPayment Methods
PhilippinesGCash / Maya
IndonesiaDANA
ThailandTruemoney / Rabbit Line Pay
MalaysiaTNG / Boost
South KoreaKakaopay / Naver Pay
SingaporeGrabPay
Hong Kong SARAlipayHK
Mainland ChinaAlipay

2.1 e-Wallet Subscription

The first binding uses POST /paymentMethod to complete wallet linkage and user authorization; subsequent charges use the saved token.


2.1.1 First Binding — POST /paymentMethod

Set paymentMethod.type to e-wallet, recurringProcessingModel to Subscription, and specify the wallet brand:

{
    "merchantTransInfo": {
        "merchantTransTime": "{{merchantTransTime}}"
    },
    "transAmount": {
        "currency": "THB",
        "value": "100"
    },
    "paymentMethod": {
        "type": "e-wallet",
        "e-wallet": {
            "paymrnyBrand": "TrueMoney_Wallet"
        },
        "recurringProcessingModel": "Subscription"
    },
    "userInfo": {
        "reference": "your_user_reference"
    },
		"transInitiator": {
    	"userCreateIP": "222.71.133.101",
    	"platform": "WEB",
		},
    "returnURL": "https://www.evonetglobal.com",
    "webhook": "https://webhook.merchant.com"
}

Key fields:

FieldTypeDescriptionNotes
paymentMethod.typestringPayment methodAlways e-wallet for wallet subscription
paymentMethod.e-wallet.paymentBrandstringWallet brande.g. TrueMoney_Wallet, GCash, Dana
paymentMethod.recurringProcessingModelstringTransaction typeSubscription
userInfo.referencestringUnique user identifierUsed for token binding
paymentMethod.statusstringtokenized_pendingAwaiting user authorization

API Reference: POST /paymentMethod

2.1.2 User Authorization

Redirect the user to action.redirectData.url to complete authorization on the wallet side.

2.1.3 Retrieve Token

Obtain token.value from the webhook notification or GET /paymentMethod?merchantTransID={{}} query endpoint. Save it and associate it with userInfo.reference.

API Reference: GET /paymentMethod?merchantTransID={}

2.1.4 Subsequent Subscription Charges — POST /payment

{
    "paymentMethod": {
        "token": {
            "value": "previously-saved-token"
        },
        "recurringProcessingModel": "Subscription"
    }
}


一、卡订阅

卡订阅支持通过 Direct API、Drop-in、LinkPay 三种方式实现。首次交易完成绑卡授权后生成 token,后续使用 token 发起免密扣款。


1.1 Direct API 实现卡订阅

通过 POST /payment 接口,首次支付时设置 recurringProcessingModel: "Subscription" 完成绑卡并获取 token。

1.1.1 首次绑卡支付

请求示例:

{
    "merchantTransInfo": {
        "merchantTransTime": "{{merchantTransTime}}"
    },
    "transAmount": {
        "currency": "HKD",
        "value": "100"
    },
    "paymentMethod": {
        "type": "card",
        "card": {
            "cardInfo": {
                "cardNumber": "4895330111111119",
                "expiryDate": "1231"
            }
        },
        "recurringProcessingModel": "Subscription"
    },
    "userInfo": {
        "reference": "your_user_reference"
    },
    "captureAfterHours": "0",
    "allowAuthentication": true,
    "returnURL": "https://www.evonetglobal.com",
    "webhook": "https://webhook.merchant.com"
}

关键字段:

字段类型描述注意事项
paymentMethod.typestring支付方式卡订阅设为 card
paymentMethod.recurringProcessingModelstring交易类型Subscription(订阅)、Unscheduled(代扣)
userInfo.referencestring商户系统中的用户唯一标识用于将卡信息及 token 绑定到用户账户
allowAuthenticationboolean是否启用 3DS 认证后续扣款场景建议 false(MIT 免密交易)

响应中关键字段:

字段类型描述
paymentMethod.recurringReferencestring定期扣款协议 ID
paymentMethod.token.valuestringToken 值,用于后续扣款
paymentMethod.paymentMethodVariantstring标识为 Recurring

字段规范: POST /payment​,GET /payment/{merchantTransID}

1.1.2 后续订阅扣款

使用保存的 token.value 发起后续扣款,paymentMethod.type 改为 token

{ 
    "merchantTransInfo": {
        "merchantTransTime": "{{merchantTransTime}}"
    },
    "transAmount": {
        "currency": "HKD",
        "value": "100"
    },
    "paymentMethod": {
        "type": "token",
        "token":{
            "value":"pmt_9a4a8a6355c044ce80903ce3d860eacb"
        },
        "recurringProcessingModel": "Subscription"
    },
    "captureAfterHours": "0",
    "allowAuthentication": false,
    "returnURL": "https://www.evonetglobal.com",
    "webhook": "https://webhook.merchant.com"
}

1.2 Drop-in 实现卡订阅

通过 Drop-in 预构建 UI 组件实现订阅,前端无需自行开发支付页面。

1.2.1 获取 sessionID

调用 POST /interaction 时传入订阅参数:

{
    "userInfo": {
        "reference": "your_user_reference"
    },
    "paymentMethod": {
        "recurringProcessingModel": "Subscription"
    }
}

从响应中获取 sessionID,传递给前端 DropInSDK。

字段规范: POST /interaction

1.2.2 获取 Token

支付完成后,从 webhook 回调通知或 GET /interaction/{merchantOrderID} 查询接口中获取 token.value,保存并与 userInfo.reference 关联。

字段规范:GET /interaction/{merchantOrderID}

1.2.3 后续订阅扣款

与 Direct API 相同,调用 POST /payment

{
    "paymentMethod": {
        "token": {
            "value": "之前保存的token值"
        },
        "recurringProcessingModel": "Subscription"
    }
}

1.3 LinkPay 实现卡订阅

通过 LinkPay 支付链接实现订阅,用户点击链接后选择卡支付完成绑卡。

1.3.1 创建 LinkPay 支付链接

调用 POST /interaction 时传入订阅参数:

{
    "userInfo": {
        "reference": "your_user_reference"
    },
    "paymentMethod": {
        "recurringProcessingModel": "Subscription"
    }
}

获取支付链接(LinkUrl)后,将用户重定向至 LinkPay 支付页面。

字段规范:POST /interaction

1.3.2 获取 Token

支付完成后,从 webhook 回调通知或 GET /interaction/{merchantOrderID} 查询接口中获取 token.value,保存并与 userInfo.reference 关联。

字段规范:GET /interaction/{merchantOrderID}

1.3.4 后续订阅扣款

与 Direct API 相同,调用 POST /payment

{
    "paymentMethod": {
        "token": {
            "value": "之前保存的token值"
        },
        "recurringProcessingModel": "Subscription"
    }
}


二、钱包订阅

支持的钱包:

地区支付方式
菲律宾GCash / Maya
印尼DANA
泰国Truemoney / Rabbit Line Pay
马来TNG / Boost
韩国Kakaopay / Naver Pay
新加坡GrabPay
中国香港AlipayHK
中国大陆Alipay

2.1 实现钱包订阅

首次通过 POST /paymentMethod 完成钱包绑定与用户授权,后续使用 token 发起扣款。

2.1.1 首次绑定 — POST /paymentMethod

paymentMethod.type 设为 e-walletrecurringProcessingModel 设为 Subscription,并指定钱包品牌:

{
    "merchantTransInfo": {
        "merchantTransTime": "{{merchantTransTime}}"
    },
    "transAmount": {
        "currency": "THB",
        "value": "100"
    },
    "paymentMethod": {
        "type": "e-wallet",
        "e-wallet": {
            "paymrnyBrand": "TrueMoney_Wallet"
        },
        "recurringProcessingModel": "Subscription"
    },
    "userInfo": {
        "reference": "your_user_reference"
    },
		"transInitiator": {
    	"userCreateIP": "222.71.133.101",
    	"platform": "WEB",
		},
    "returnURL": "https://www.evonetglobal.com",
    "webhook": "https://webhook.merchant.com"
}

关键字段:

字段类型描述注意事项
paymentMethod.typestring支付方式钱包订阅 e-wallet
paymentMethod.e-wallet.paymentBrandstring钱包品牌TrueMoney_WalletGCashDana
paymentMethod.recurringProcessingModelstring交易类型Subscription
userInfo.referencestring商户用户唯一标识用于绑定 token
paymentMethod.statusstringtokenized_pending等待用户授权

字段规范:POST /paymentMethod

2.1.2 用户授权

将用户重定向至 action.redirectData.url,在钱包端完成授权。

2.1.3 获取 Token

从 webhook 回调通知或 GET /interaction/{merchantOrderID} 查询接口中获取 token.value,保存并与 userInfo.reference 关联。

字段规范: GET /paymentMethod?merchantTransID={}

2.1.4 后续订阅扣款 — POST /payment

{
    "paymentMethod": {
        "token": {
            "value": "之前保存的token值"
        },
        "recurringProcessingModel": "Subscription"
    }
}