rasedi-sdk

Universal Rasedi Payment Gateway SDK for React, Vue, Angular, React Native, and Node.js
965
Install
npm install rasedi-sdk
Latest Version:1.0.9
License:MIT
Last Updated:May 10, 2026
Links: npm
Maintainer: maziar.daraei

Rasedi SDK

Universal Rasedi Payment Gateway SDK for Nodejs, React, Vue, Angular and React Native

Github Repository

Check the Github Repository for full implementations:

Installation

npm install rasedi-sdk

Initialization

Initialize the client with your credentials. Obtain your keys from the Rasedi Dashboard.

import { RasediClient, Gateway, PaymentStatus } from 'rasedi-sdk';

const client = new RasediClient('YOUR_PRIVATE_KEY', 'YOUR_SECRET_KEY');

1. Create a Payment

Initiate a new payment request. You can specify multiple gateways and various options.

const paymentResponse = await client.createPayment({
  amount: "1050", // Amount in smallest currency unit (e.g., cents or local equivalent)
  title: "Order #12345",
  description: "Premium Subscription Plan",
  gateways: [Gateway.CREDIT_CARD, Gateway.ZAIN], // Specify allowed payment methods
  redirectUrl: "https://your-domain.com/payment/success",
  callbackUrl: "https://your-domain.com/api/webhooks/payment", // For server-to-server notifications
  collectFeeFromCustomer: false,
  collectCustomerEmail: true,
  collectCustomerPhoneNumber: true
});

console.log(`Payment Initiated: ${paymentResponse.body.referenceCode}`);
console.log(`Redirect URL: ${paymentResponse.body.redirectUrl}`);

2. Check Payment Status

Retrieve the current status of a payment using its unique referenceCode. This is useful for polling or verifying payment completion.

const statusResponse = await client.getPaymentByReference(paymentResponse.body.referenceCode);

if (statusResponse.body.status === PaymentStatus.PAID) {
  console.log("Payment successful!");
} else {
  console.log(`Current Status: ${statusResponse.body.status}`);
}

3. Cancel a Payment

Cancel a pending payment. This operation is only valid for payments that are still in a PENDING state.

const cancelResponse = await client.cancelPayment(paymentResponse.body.referenceCode);

if (cancelResponse.body.status === PaymentStatus.CANCELED) {
  console.log("Payment successfully canceled.");
}

Enums & Constants

Gateway

Supported payment gateways:

Enum Value Description
Gateway.FIB First Iraqi Bank
Gateway.ZAIN ZainCash
Gateway.ASIA_PAY AsiaPay
Gateway.FAST_PAY FastPay
Gateway.NASS_WALLET NassWallet
Gateway.CREDIT_CARD Credit Card (Visa/Mastercard)

PaymentStatus

Possible states of a payment:

Enum Value Description
PaymentStatus.PENDING Payment created and awaiting user action
PaymentStatus.PAID Payment successfully completed
PaymentStatus.FAILED Payment failed or was declined
PaymentStatus.CANCELED Payment was manually canceled
PaymentStatus.TIMED_OUT Payment session expired

Examples

Check the repository for full implementations:

License

MIT

Related Packages

paymid-sdk

A frontend SDK for Paymid payment processing

15,682
@ackplus/nest-auth-client

NestJS authentication for REST APIs

20,047 4
@ackplus/nest-crud-request

Framework-agnostic query builder for REST APIs - build complex queries with filt...

15,220 2
@querri-inc/embed

Embed Querri views in your application. Core SDK + React, Vue, Svelte, and Angul...

3,622 0
auth.js

A simple authentication and authorization module for building APIs when using fr...

2,037

Version History

Version Released License
1.0.9 MIT
1.0.8 MIT
1.0.6 MIT
1.0.5 MIT
1.0.4 MIT