@baumdigital/greenpay-helper
Baum Digital - Integración GreenPay
Last updated 6 months ago by baumdigital .
ISC · Original npm · Tarball · package.json
$ cnpm install @baumdigital/greenpay-helper 
SYNC missed versions from official npm registry.

Baumdigital - greenpay helper

Ejemplo uso:

const credentials = {
  secret: process.env.GREENPAY_SECRET,
  merchantID: process.env.GREENPAY_MERCHANT_ID,
  terminal: process.env.GREENPAY_TERMINAL,
  publicKey: process.env.GREENPAY_PUBLIC_KEY,
  currency: process.env.GREENPAY_CURRENCY
};
//Optional
const apiEndpoints = {
  paymentWithToken: "https://sandbox-merchant.greenpay.me/tokenPayment",
  getRequestToken: "https://sandbox-merchant.GreenPay.me/tokenize",
  getCardToken: "https://sandbox-checkout.greenpay.me/tokenize",
  createSubscription: "https://sandbox-merchant.greenpay.me/subscriptions",
  cancelSubscription:
    "https://sandbox-merchant.greenpay.me/subscriptions/cancel",
  listSubscriptions: "https://sandbox-merchant.greenpay.me/subscriptions/list",
  updateCardTokenSubscription:
    "https://sandbox-merchant.greenpay.me/subscriptions/update/card_token",
  updateSubscriptionAmount:
    "https://sandbox-merchant.greenpay.me/subscriptions/update",
  subscriptionManualPayment:
    "https://sandbox-merchant.greenpay.me/subscriptions/pay",
  listSubscriptionsPayments:
    "https://sandbox-merchant.greenpay.me/subscriptions/list/payments"
};

const {
  Payment,
  Card,
  Subscription,
  Webhook
} = require("@baumdigital/greenpay-helper");

/*
        payment.paymentWithCardToken
*/
const payment = new Payment(credentials, apiEndpoints);
/*
        card.getRequestToken
        card.getCardToken
        card.createCardToken
    */
const card = new Card(credentials, apiEndpoints);
/*
        subscription.createSubscription
        subscription.cancelSubscription
        subscription.listSubscriptions
        subscription.updateSubscriptionCardToken
        subscription.updateSubscriptionAmount
        subscription.subscriptionManualPayment
        subscription.listSubscriptionsPayments
    */
const subscription = new Subscription(credentials, apiEndpoints);
/*
        webhook.validateWebhookRequest
    */
const webhook = new Webhook(credentials, apiEndpoints);

Current Tags

  • 0.2.4                                ...           latest (6 months ago)

6 Versions

  • 0.2.4                                ...           6 months ago
  • 0.2.3                                ...           6 months ago
  • 0.1.3                                ...           6 months ago
  • 0.0.3                                ...           6 months ago
  • 0.0.2                                ...           7 months ago
  • 0.0.1                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 6
Last Month 12
Dependencies (9)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |