0.1.5 • Published 10 years ago

easy-alipay v0.1.5

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

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 = require('easy-alipay').Payment;
var paymentUrl = alipay.createDirectPay(partnerId, partnerKey, sellerEmail, requestData.subject,
      requestData.outTradeNumber, requestData.totalFee, requestData.body, requestData.showUrl,
      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.

Example

var alipayNotification = require('easy-alipay').Notification;
try {
  alipayNotification.directPayNotify(notifyData, partnerId, partnerKey);
} catch (err) {
  console.error(err);
}

Notification.directPayNotifyWap(notification, partnerId, partnerKey)

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

LICENSE

MIT

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago