0.0.11 • Published 4 years ago
omise-nodejs v0.0.11
omise-nodejs
Please read this before using this library.
The omise-nodejs is an unofficial library to integrate with Omise API by using Node.js. Please contract support@omise.co, if you have any questions regarding to any payment flows, or any questions that are related to Omise API.
Installation
From NPM
$ npm install omise-nodejsThe library has been tested with Node version >= 12.0.0 and support only Omise API version 2019-05-29.
Usage
Flow
Please read Omise documents, and please contract support@omise.co if you have any questions related to the flow.
Security
Please carefully read these related security documents.
And especially this section https://www.omise.co/security-overview#tokens.
Examples
Please find some code examples in /examples folder.
const { OmiseClient } from 'omise-nodejs';or
import { OmiseClient } from 'omise-nodejs';Create an OmiseClient object
const client = new OmiseClient({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY,
omiseVersion: '2019-05-29' // if your account is using older version of Omise API, please specific this param.
});APIs
- Account API
- Retrieve account information:
client.account.retrieve() - Update account information:
client.account.update(params)
- Retrieve account information:
- Balance API
- Retrieve the balance:
client.balance.retrieve()
- Retrieve the balance:
- Capability API
- Retrieve account capabilities:
client.capability.retrieve()
- Retrieve account capabilities:
- Chain API
- List sub-merchant chains:
client.chain.list([params]) - Retrieve a sub-merchant chain:
client.chain.retrieve(id) - Revoke a sub-merchant chain:
client.chain.revoke(id)
- List sub-merchant chains:
- Charge API
- Create a charge:
client.charge.create(params) - Retrieve a charge:
client.charge.retrieve(id) - Update a charge:
client.charge.update(id, params) - List charges:
client.charge.list([params]) - Capture a charge:
client.charge.capture(id) - Expire a charge:
client.charge.expire(id) - List events:
client.charge.listEvents(id[, params]) - Mark a charge as failed:
client.charge.markAsFailed(id) - Mark a charge as paid:
client.charge.markAsPaid(id) - Reverse a charge:
client.charge.reverse(id) - Refund a charge:
client.charge.refund(id) - Retrieve a refund of charge:
client.charge.retrieveRefund(chargeId, refundId) - List refunds:
client.charge.listRefunds(id[, params]) - Search charges:
client.charge.search(params) - List charge schedules:
client.charge.listChargeSchedules([params]) - Create a dispute:
client.charge.dispute(chargeId)
- Create a charge:
- Customer API
- Create a customer (and card):
client.customer.create(params) - Retrieve a customer:
client.customer.retrieve(id) - Update a customer:
client.customer.update(id, params) - Destroy a customer:
client.customer.destroy(id) - List customers:
client.customer.list([params]) - List schedules:
client.customer.listSchedules(id[, params]) - Search customers:
client.customer.search(params)
- Create a customer (and card):
- Card API
- Usage:
const card = client.customer.cardsOf(customerId); - Retrieve a card:
card.retrieve(cardId) - Update a card:
card.update(cardId, params) - Destroy a card:
card.destroy(cardId) - List cards:
card.list([params])
- Usage:
- Dispute API
- Create a dispute:
client.dispute.create(chargeId) - Retrieve a dispute:
client.dispute.retrieve(id) - Update a dispute:
client.dispute.update(id, params) - List disputes:
client.dispute.list([params]) - Accept a dispute:
client.dispute.accept(id) - Close a dispute:
client.dispute.close(id) - List closed disputes:
client.dispute.listClosed([params]) - List open disputes:
client.dispute.listOpen([params]) - List pending disputes:
client.dispute.listPending([params]) - Search disputes:
client.dispute.search(params)
- Create a dispute:
- Document API
- Usage:
const document = client.dispute.documentsOf(disputeId) - Upload a document:
document.upload(params) - Retrieve a document:
document.retrieve(id) - Destroy a document:
document.destroy(id) - List documents:
document.list([params])
- Usage:
- Event API
- Retrieve an event:
client.event.retrieve(id) - List events:
client.event.list([params])
- Retrieve an event:
- Forex API
- Retrieve the forex:
client.forex.retrieve(currency)
- Retrieve the forex:
- Link API
- Create a link:
client.link.create(params) - Retrieve a link:
client.link.retrieve(id) - Destroy a link:
client.link.destroy(id) - List links:
client.link.list(params) - List charges for a link:
client.link.listCharges(id[, params]) - Search links:
client.link.search(params)
- Create a link:
- Receipt API
- Retrieve a receipt:
client.receipt.retrieve(id) - List receipts:
client.receipt.list([params])
- Retrieve a receipt:
- Recipient API
- Create a recipient:
client.recipient.create(params) - Retrieve a recipient:
client.recipient.retrieve(id) - Update a recipient:
client.recipient.update(id, params) - Destroy a recipient:
client.recipient.destroy(id) - List recipients:
client.recipient.list([params]) - Mark a recipient as verified:
client.recipient.verify(id) - List schedules:
client.recipient.listSchedules(id[, params]) - Search recipients:
client.recipient.search(params)
- Create a recipient:
- Refund API
- Create a refund:
client.refund.create(chargeId) - Retrieve a refund:
client.refund.retrieve(chargeId, refundId) - List refunds:
client.refund.list([params]) - List refunds for charge:
client.refund.listForCharge(chargeId[, params]) - Search refunds:
client.refund.search(params)
- Create a refund:
- Search API
- Search:
omise.search.list(params)
- Search:
- Source API
- Create a source:
omise.source.create(params) - Retrieve a source:
omise.source.retrieve(id)
- Create a source:
- Token API
- Create a token:
omise.token.create(params) - Retrieve a token:
omise.token.retrieve(id)
- Create a token:
- Transaction API
- Retrieve a transaction:
omise.transaction.retrieve(id) - List transactions:
omise.transaction.list([params]) - Search transactions:
omise.transaction.search([params])
- Retrieve a transaction:
- Transfer API
- Create a transfer:
omise.transfer.create(params) - Retrieve a transfer:
omise.transfer.retrieve(id) - Destroy a transfer:
omise.transfer.destroy(id) - List transfers:
omise.transfer.list([params]) - Mark a transfer as paid:
omise.transfer.markAsPaid(id) - Mark a transfer as sent:
omise.transfer.markAsSent(id) - List transfer schedules:
omise.transfer.listTransferSchedules([params]) - Search transfers:
omise.transfer.search([params])
- Create a transfer:
- Create a schedule:
omise.schedule.create(params) - Destroy a schedule:
omise.schedule.destroy(id) - List schedules:
omise.schedule.list([params]) - List charge schedules for customer:
omise.schedule.listForCustomer(customerId[, params]) - List transfer schedules for recipient:
omise.schedule.listForRecipient(recipientId[, params]) - List transfer schedules:
omise.schedule.listTransferSchedules([params]) - List charge schedules:
client.schedule.listChargeSchedules([params]) - Retrieve a schedule:
client.schedule.retrieve(id) - Search charge schedules:
client.schedule.searchChargeSchedules([params]) - Search transfer schedules:
client.schedule.searchTransferSchedules([params])
- Create a schedule: