Package Exports
- checkout-com-js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (checkout-com-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Checkout.com API JavaScript Library
Simple library with low level of abstraction
It's an update of https://www.npmjs.com/package/checkout-js-library, since it was no longer following current checkout.com documentation
https://api-reference.checkout.com
https://docs.checkout.com/docs
Tests
npm install
npm run test
Usage
import ApiClient from "checkout-com-js";
const api = new ApiClient({
secretKey: 'sk_',
publicKey: 'pk_',
env: 'LIVE', // 'SANDBOX' // optional
debugMode: true, // optional
})
Methods
Token
api.tokenService.createToken(payload);
Payment
api.paymentService.createPayment(payload);
api.paymentService.getPayment(paymentId);
api.paymentService.getPaymentActions(paymentId);
api.paymentService.capturePayment(paymentId, payload = {});
api.paymentService.refundPayment(paymentId, payload = {});
api.paymentService.voidPayment(paymentId, payload = {});
Webhook
api.webhookService.getWebhooks();
api.webhookService.createWebhook(payload);
api.webhookService.getWebhook(webhookId);
api.webhookService.updateWebhook(webhookId, payload);
api.webhookService.deleteWebhook(webhookId);
Event
api.eventService.getEventTypes();
api.eventService.getEvents();
api.eventService.getEvent(id);
api.eventService.getEvent(eventId);
api.eventService.getEventNotifications(eventId, norificationId);
api.eventService.retryWebhook(eventId, webhookId);
api.eventService.retryAllWebhooks(eventId);
Event
api.eventService.createSource(payload);