pakasir-sdk 0.2.0

Unofficial async Rust SDK for the Pakasir payment gateway (transactions, simulation, webhooks, payment URLs, QRIS QR codes).
Documentation

Pakasir Rust SDK (Unofficial)

License codecov Crates.io Documentation Ask DeepWiki

Unofficial Rust port of the Pakasir Go SDK in this repository.

Status

This crate currently ports the core REST SDK surface:

  • HTTP client with retries and Retry-After support
  • Transaction service (create, cancel, detail)
  • Simulation service (pay)
  • Webhook parsing
  • Payment URL builder
  • QR PNG generation
  • English and Indonesian localized SDK errors

The Go repository's gRPC server layer is not ported yet in this crate.

Quick Start

use pakasir_sdk::{Client, PaymentMethod, TransactionService};

#[tokio::main]
async fn main() -> Result<(), pakasir_sdk::Error> {
    let client = Client::builder("your-project-slug", "your-api-key").build();
    let transactions = TransactionService::new(client);

    let response = transactions
        .create(
            PaymentMethod::Qris,
            &pakasir_sdk::transaction::CreateRequest {
                order_id: "INV123456".into(),
                amount: 99_000,
            },
        )
        .await?;

    println!("payment number: {}", response.payment.payment_number);
    println!("total payment: {}", response.payment.total_payment);

    Ok(())
}

Layout

pakasir-rust-sdk/
├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       └── test.yml
├── Cargo.toml
├── LICENSE
├── Makefile
├── README.md
├── src/
│   ├── client.rs
│   ├── constants.rs
│   ├── error.rs
│   ├── i18n.rs
│   ├── lib.rs
│   ├── payment_url.rs
│   ├── qr.rs
│   ├── simulation.rs
│   ├── timefmt.rs
│   ├── transaction.rs
│   └── webhook.rs
└── tests/
    └── sdk.rs