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 [email protected]
, if you have any questions regarding to any payment flows, or any questions that are related to Omise API.
From NPM
$ npm install omise-nodejs
The library has been tested with Node version >= 12.0.0
and support only Omise API version 2019-05-29
.
Please read Omise documents, and please contract [email protected]
if you have any questions related to the flow.
Please carefully read these related security documents.
And especially this section https://www.omise.co/security-overview#tokens.
Please find some code examples in /examples
folder.
const { OmiseClient } from 'omise-nodejs';
or
import { OmiseClient } from 'omise-nodejs';
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.
});
-
- Retrieve account information:
client.account.retrieve()
- Update account information:
client.account.update(params)
- Retrieve account information:
-
- Retrieve the balance:
client.balance.retrieve()
- Retrieve the balance:
-
- Retrieve account capabilities:
client.capability.retrieve()
- Retrieve account capabilities:
-
- 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:
-
- 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:
-
- 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):
-
- 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:
-
- 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:
-
- 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:
-
- Retrieve an event:
client.event.retrieve(id)
- List events:
client.event.list([params])
- Retrieve an event:
-
- Retrieve the forex:
client.forex.retrieve(currency)
- Retrieve the forex:
-
- 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:
-
- Retrieve a receipt:
client.receipt.retrieve(id)
- List receipts:
client.receipt.list([params])
- Retrieve a receipt:
-
- 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:
-
- 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:
omise.search.list(params)
- Search:
-
- Create a source:
omise.source.create(params)
- Retrieve a source:
omise.source.retrieve(id)
- Create a source:
-
- Create a token:
omise.token.create(params)
- Retrieve a token:
omise.token.retrieve(id)
- Create a token:
-
- Retrieve a transaction:
omise.transaction.retrieve(id)
- List transactions:
omise.transaction.list([params])
- Search transactions:
omise.transaction.search([params])
- Retrieve a transaction:
-
- 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: