首頁 >php教程 >php手册 >KoaHub基於Node.js開發的連接支付寶插件程式碼資訊詳情

KoaHub基於Node.js開發的連接支付寶插件程式碼資訊詳情

WBOY
WBOY原創
2016-10-22 00:00:321144瀏覽

KoaHub平台基於Node.js開發的Koa 連接支付寶插件程式碼資訊詳情
KoaHub平台基於Node.js開發的Koa 連結支付寶插件程式碼資訊詳情
easy-alipay

alipay payment & notification APIs
easy-alipay
Nodejs based Alipay payment & notification APIs
API
Payment.createDirectPay()

Create an Ali direct payment, return an Ali url so client can go to Ali pages to process payments.
Examplevar alipay = require('easy-alipay').Payment;<br> var paymentUrl = alipay.createDirectPay(partnerId, partnerKey, sellerEmail, requestData.subject,<br>       requestData.outTradeNumber, requestData.totalFee, requestData.body, requestData.showUrl,<br>       notifyUrl, returnUrl);
Payment.createDirectPayWap()

Returns an promise. WAP version of Payment.createDirectPay(), which submit a XML format request to ALIPAY and returns an redirect url with valid request token.
Notification.directPayNotify(notification, partnerId, partnerKey)

Returns an promise which resolve with a JSON version of ALIPAY payment notification, and reject when the notification is not from ALIPAY or signature verification failed.
Examplevar alipayNotification = require('easy-alipay').Notification;<br> try {<br>   alipayNotification.directPayNotify(notifyData, partnerId, partnerKey);<br> } catch (err) {<br>   console.error(err);<br> }
Notification.directPayNotifyWap(notification, partnerId, partnerKey)

WAP version of Notification.directPayNotify(), which accepts a XML format payment notification.
LICENSE
MIT

wemall 開源微商城 ,微信商城,商城源碼,三級分銷,微生鮮,微水果,微外賣,微訂餐---專業的o2o系統
wemall網址:http://www.wemallshop.com
程式碼來源:http://js.koahub.com/home/feature/easy-alipay
KoaHub基於Node.js開發的連接支付寶插件程式碼資訊詳情

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn