跳到主要内容

QuickLinkPay Scheme集成指南

什么是QuickLinkPay

QuickLinkPay是Newage提供给商户使用的一款手机终端APP,商户可以通过QuickLinkPay做扫码交易,查询账单,交易汇总等功能。 QuickLinkPay也提供了Scheme调用,让其它APP可以调用LinkPay的支付功能。用户可以从APP Store和Google Play下载LinkPay APP。

什么是Scheme

Scheme是一种定义应用程序中不同页面或函数之间跳转的方法。Scheme允许我们在应用程序内的不同页面之间快速跳转,以及从其他应用程序或网页跳转到我们应用程序中的特定页面。

集成流程

Android Integration Process

  1. 首先,您必须在应用程序文件的 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>
  1. 使用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&notify_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&notify_url=app://payment.com/result"));
startActivity(intent);

IOS集成流程

  1. 首先,您必须在应用程序文件的info.plist文件中设置URL Schemes和Identifier ,以便在linkpay交易完成后可以跳回应用程序界面。如下:
<key>CFBundleURLName</key>
<string>payment.com/result</string>
<key>CFBundleURLSchemes</key>
<array>
<string>app</string>
</array>
  1. 使用scheme启动linkpay,如下所示:

消费报文:

let url = URL(string: "newage.com/cashier?merchant_order_no=1122223&trans_type=1&amount=1&notify_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&notify_url=app://payment.com/result")!
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}

交易报文

请求参数

NameIDTypeMandatoryDescription
Notify URLnotify_urlText(32)MScheme address that needs to be notified when a LinkPay transaction is completed to initiate a callback
Pay Scenariopay_scenarioText(32)OPayment scene, see PayScenario
Example:BSCANQR_PAY
Payment Method IDpay_method_idText(32)OPayment method number. If you want to specify a payment method, see PayMethod
Example:Alipay
Order amountorder_amountAmountMExpressed in the quoted currency.currently, we mainly support the Japanese yen,for example, Example:34
Transaction typetrans_typeNumberMFor transaction types, see TransType, Currently only consumption and refunds are supported
Example:1
Merchant system order numbermerchant_order_noText(32)MRefund 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 numberorig_merchant_order_noText(32)CA maximum of 32 alphanumerical characters must be used if the transaction type is refund trans_type == 3
Example:1217752501201407033233368018
Description information of the orderdescriptionText(32)CDescription information of the order

返回参数

NameIDTypeMandatoryDescription
Trans Notrans_noText(32)MTransaction order number, which is returned when the transaction is successful
Trans Statustrans_statusText(1)MTransaction status, when equals to 2, it means the transaction is successful, other values means the transaction is failed.
Pay Scenariopay_scenarioText(32)OPayment scene, see PayScenario
Example:BSCANQR_PAY
Payment Method IDpay_method_idText(32)OPayment method number. If you want to specify a payment method, see PayMethod
Example:Alipay
Order amountorder_amountAmountMExpressed in the quoted currency.currently, we mainly support the Japanese yen, for example, Example:34
Transaction typetrans_typeNumberMFor transaction types, see TransType, Currently only consumption and refunds are supported
Example:1
Merchant system order numbermerchant_order_noText(32)MRefund 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