Unofficial Rust SDK for ABA PayWay Payment Gateway (Cambodia).
- QR Code Generation
- Ecommerce Checkout
- Credentials on File (COF)
- Payouts
- Pre-authorization
- Sandbox + Production environments
[dependencies]
payway = "0.1.0"use payway::{PayWayClient, Currency};
let client = PayWayClient::new("merchant_id", "api_key");
let params = payway::PurchaseParams::builder()
.transaction_id("order-123")
.amount(10.00)
.currency(Currency::Usd)
.return_url("https://example.com/callback")
.build_with_client(&client)?;let client = PayWayClient::new("merchant_id", "api_key");let config = PayWayConfig::production("merchant_id", "api_key");
let client = PayWayClient::with_config(config);let config = PayWayConfig::sandbox("merchant_id", "api_key")
.with_base_url("http://localhost:8080");
let client = PayWayClient::with_config(config);let params = PurchaseParams::builder()
.transaction_id("order-123")
.amount(10.00)
.currency(Currency::Usd)
.first_name("John")
.last_name("Doe")
.email("john@example.com")
.return_url("https://example.com/return")
.build_with_client(&client)?;let request = GenerateQrRequest::builder()
.transaction_id("qr-123")
.amount(10.00)
.currency(Currency::Usd)
.payment_option(PaymentOption::AbapayKhqr)
.qr_template("template1_color")
.build_with_client(&client)?;
let response = client.generate_qr(request).await?;See examples/ directory:
generate_qr.rs- Generate QR codescheckout.rs- Ecommerce checkout
cargo testGNU General Public License v3.0 - See LICENSE
Contributions welcome! Please open an issue or PR on GitHub