A lightweight client-side API Integration for Paymongo API.
npm install paymongo-api-client
following variables have to be declared in your application environment .env
PAYMONGO_VERSION=v1
PAYMONGO_PUBLIC_KEY=<ACCOUNT API PUBLIC KEY>
PAYMONGO_SECRET_KEY=<ACCOUNT SECRET KEY>
import paymongo from 'paymongo-api-client'
A PaymentMethod
resource describes which payment method was used to fulfill a payment. It is used with a PaymentIntent to collect payments.
paymongo.PaymentMethod.create(attributes)
The attributes
nedded to create a Payment Method are documented here
paymongo.PaymentMethod.retrive(methodId)
A PaymentIntent
resource is used to track and handle different states of the payment until it succeeds. for a more detailed explanation on how Payment Intent works, you can refer to their official documentation here
paymongo.PaymentIntent.create(attributes)
The attributes
nedded to create a Payment Intent are documented here
paymongo.PaymentIntent.retrive(intentId)
paymongo.PaymentIntent.attachPaymentMethod(intentId, attributes)
The attributes
nedded to complete attaching a Payment Method to a Payment Intent are documented here
A Payment
resource is an attempt by your customer to send you money in exchange for your product. This is a reference to an amount that you are expecting to receive if a payment resource with paid status becomes a part of a payout. If the payment status is failed, you can determine the reason for failure.
paymongo.Payment.create(attributes)
The attributes
nedded to create Payment are documented here
paymongo.Payment.retrive(paymentId)
paymongo.Payment.list(params)
The params
nedded to get a list of Payments are documented here
A Source
is a resource to generate your customer's payment instrument. This is normally used to generate check out URLs for e-wallet payments.
paymongo.Source.create(attributes)
The attributes
nedded to create Source are documented here
paymongo.Source.retrive(sourceId)
A Webhook
resource primarily refers to a certain URL where we send events that are happening from your account.
paymongo.Webhook.create(attributes)
The attributes
nedded to create Webhook are documented here
paymongo.Webhook.retrieve(webhookId)
paymongo.Webhook.list(attributes)
The params
nedded to get a list of Webhooks are documented here
paymongo.Webhook.enable(webhookId)
paymongo.Webhook.disable(webhookid)
paymongo.Webhook.update(webhookid, atributes)