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.
Example
var alipay = Payment;var paymentUrl = alipay;
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.
Example
var alipayNotification = Notification;try alipayNotification; catch err console;
Notification.directPayNotifyWap(notification, partnerId, partnerKey)
WAP version of Notification.directPayNotify()
, which accepts a XML format payment notification.
LICENSE
MIT