QuickLinkPay Scheme集成指南
什么是QuickLinkPay
QuickLinkPay是Newage提供给商户使用的一款手机终端APP,商户可以通过QuickLinkPay做扫码交易,查询账单,交易汇总等功能。 QuickLinkPay也提供了Scheme调用,让其它APP可以调用LinkPay的支付功能。用户可以从APP Store和Google Play下载LinkPay APP。
什么是Scheme
Scheme是一种定义应用程序中不同页面或函数之间跳转的方法。Scheme允许我们在应用程序内的不同页面之间快速跳转,以及从其他应用程序或网页跳转到我们应用程序中的特定页面。
集成流程
Android Integration Process
- 首先,您必须在应用程序文件的 AndroidManifest.xml 文件中设置 URL 模式和Identifier,以便在链接支付交易完成后跳回应用程序界面。如下所示:
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="payment.com"
android:path="/result"
android:scheme="app" />
</intent-filter>
</activity>
- 使用scheme启动linkpay,如下所示:
消费报文:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("linkpay://newage.com/cashier?merchant_order_no=1122223&trans_type=1&order_amount=1¬ify_url=app://payment.com/result"));
startActivity(intent);
退款报文:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("linkpay://newage.com/cashier?merchant_order_no=1122223&orig_merchant_order_no=122222&trans_type=3&order_amount=1¬ify_url=app://payment.com/result"));
startActivity(intent);
IOS集成流程
- 首先,您必须在应用程序文件的info.plist文件中设置URL Schemes和Identifier ,以便在linkpay交易完成后可以跳回应用程序界面。如下:
<key>CFBundleURLName</key>
<string>payment.com/result</string>
<key>CFBundleURLSchemes</key>
<array>
<string>app</string>
</array>
- 使用scheme启动linkpay,如下所示:
消费报文:
let url = URL(string: "newage.com/cashier?merchant_order_no=1122223&trans_type=1&amount=1¬ify_url=app://payment.com/result")!
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
退款报文:
let url = URL(string: "newage.com/cashier?merchant_order_no=1122223&orig_merchant_order_no=122222&trans_type=1&amount=1¬ify_url=app://payment.com/result")!
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
交易报文
请求参数
| Name | ID | Type | Mandatory | Description |
|---|---|---|---|---|
| Notify URL | notify_url | Text(32) | M | Scheme address that needs to be notified when a LinkPay transaction is completed to initiate a callback |
| Pay Scenario | pay_scenario | Text(32) | O | Payment scene, see PayScenario Example:BSCANQR_PAY |
| Payment Method ID | pay_method_id | Text(32) | O | Payment method number. If you want to specify a payment method, see PayMethod Example:Alipay |
| Order amount | order_amount | Amount | M | Expressed in the quoted currency.currently, we mainly support the Japanese yen,for example, Example:34 |
| Transaction type | trans_type | Number | M | For transaction types, see TransType, Currently only consumption and refunds are supported Example:1 |
| Merchant system order number | merchant_order_no | Text(32) | M | Refund shall be the order number applied for refund, which is different from the order number of the original consumption transaction. Contains a maximum of 32 alphanumeric characters Example:1217752501201407033233368018 |
| Original merchant system order number | orig_merchant_order_no | Text(32) | C | A maximum of 32 alphanumerical characters must be used if the transaction type is refund trans_type == 3 Example:1217752501201407033233368018 |
| Description information of the order | description | Text(32) | C | Description information of the order |
返回参数
| Name | ID | Type | Mandatory | Description |
|---|---|---|---|---|
| Trans No | trans_no | Text(32) | M | Transaction order number, which is returned when the transaction is successful |
| Trans Status | trans_status | Text(1) | M | Transaction status, when equals to 2, it means the transaction is successful, other values means the transaction is failed. |
| Pay Scenario | pay_scenario | Text(32) | O | Payment scene, see PayScenario Example:BSCANQR_PAY |
| Payment Method ID | pay_method_id | Text(32) | O | Payment method number. If you want to specify a payment method, see PayMethod Example:Alipay |
| Order amount | order_amount | Amount | M | Expressed in the quoted currency.currently, we mainly support the Japanese yen, for example, Example:34 |
| Transaction type | trans_type | Number | M | For transaction types, see TransType, Currently only consumption and refunds are supported Example:1 |
| Merchant system order number | merchant_order_no | Text(32) | M | Refund shall be the order number applied for refund, which is different from the order number of the original consumption transaction. Contains a maximum of 32 alphanumeric characters Example:1217752501201407033233368018 |