1. How to install SDK
Payment Gateway Docs
  • Welcome to the Ojire SDK Documentation
  • Callback Mechanism
  • Payment Flow Diagrams
    • Payment Flow with Saved Card
    • Payment Flow without Customer ID (Anonymous/Guest Checkout)
    • Payment Flow with QRIS
    • Payment Flow with Virtual Account
    • Payment Flow with WeChat Pay
    • Payment Flow with Alipay
  • How to install SDK
    • Javascript
    • React Native
    • Kotlin / Java
    • Swift
    • Flutter
  • Payment Intents
    POST
  1. How to install SDK

Javascript

You must get customer_token, payment_secret and payment_id first at your backend to OJIRE API via request to /v1/payment-intents endpoint
Here is the improved and professionally formatted documentation in English.

Installation#

Package Managers#

CDN (Script Tag)#

Add the following line inside your <head> tag or before the closing </body> tag:

Integration Workflow#

1. Backend Initialization (Create Payment Intent)#

Before opening the modal on the frontend, your backend must request a payment_id, clientSecret, and customerToken from the Ojire API.
Important: Never call this endpoint directly from the frontend to avoid exposing your Secret Key.

2. Frontend Implementation#

A. Using Vanilla JS#

When using the script tag, use the global ArtoPay object.

B. Using React / ES Modules#


API Reference#

ArtoPay.openPayment(options)#

ParameterTypeRequiredDescription
tokenstringYesThe customerToken received from your backend.
clientSecretstringYesThe clientSecret from the payment intent.
paymentIdstringYesThe unique transaction ID (payment_id).
orderIdstringYesYour internal system's order reference ID.
sandboxbooleanNoForce sandbox mode (defaults to global config).
onSuccessfunctionNoTriggered when status is settlement or capture.
onPendingfunctionNoTriggered for waiting states (e.g., VA waiting for pay).
onErrorfunctionNoTriggered on failure, expiration, or cancellation.

Helper Methods#

ArtoPay.closePayment(): Programmatically closes the active modal.
ArtoPay.isPaymentOpen(): Returns true if the modal is currently visible.
ArtoPay.configure({ sandbox: boolean }): Global SDK environment setup.

UI Preview#

The SDK will trigger a responsive payment interface as shown below:

Screenshot Example#

screencapture-457469d2-cupang-store-pages-dev-2026-02-04-22_05_45.png
image.png
Previous
Payment Flow with Alipay
Next
React Native