Download the PHP package ndradev/okeconnect-php-client without Composer
On this page you can find all versions of the php package ndradev/okeconnect-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package okeconnect-php-client
OkeConnect PHP Client
Package PHP untuk integrasi API OkeConnect H2H dengan parsing lengkap untuk semua response.
Requirement: PHP 8.2 atau lebih baru
Developer: NdraDeveloper
Instalasi
Daftar Contoh Penggunaan
Tersedia 10 file contoh penggunaan lengkap di folder examples/:
| File | Deskripsi |
|---|---|
01_transaction.php |
Transaksi pulsa/data (fixed denom) |
02_transaction_open_denom.php |
Transaksi e-wallet (open denom/bebas nominal) |
03_check_status.php |
Cek status transaksi |
04_parse_webhook.php |
Parse webhook callback |
05_get_price_list.php |
Ambil semua daftar harga |
06_get_price.php |
Ambil harga satu produk |
07_find_product_by_code.php |
Cari produk berdasarkan kode |
08_find_product_by_category.php |
Cari produk berdasarkan kategori |
09_find_product_by_keterangan.php |
Cari produk berdasarkan keterangan |
10_find_product_by_status.php |
Cari produk berdasarkan status |
webhook.php |
Handler webhook untuk callback |
Cara Penggunaan
1. Inisialisasi Client
2. Menggunakan Helper Function
Fitur Transaksi
Transaksi Fixed Denom (Pulsa/Data)
Transaksi Open Denom (E-Wallet)
Cek Status Transaksi
Parse Webhook Callback
Price List dan Pencarian Produk
Ambil Semua Price List
Cari Produk Berdasarkan Kode
Cari Produk Berdasarkan Kategori
Cari Produk Berdasarkan Keterangan
Cari Produk Berdasarkan Status
Ambil Harga Produk
Helper Functions
Webhook Handler
Exception Handling
OkeConnectException Codes
| Code | Constant | Keterangan |
|---|---|---|
| 1001 | MISSING_CREDENTIALS | Kredensial tidak lengkap |
| 1002 | INVALID_PARAMETER | Parameter tidak valid |
| 1003 | REQUEST_FAILED | Gagal connect ke server |
| 1004 | PARSE_ERROR | Gagal parse response |
| 1005 | TRANSACTION_FAILED | Transaksi gagal |
| 1006 | INSUFFICIENT_BALANCE | Saldo tidak cukup |
| 1007 | PRODUCT_NOT_FOUND | Produk tidak ditemukan |
Cara Menggunakan Exception
Validation
Ref ID Validation
- Tidak boleh kosong
- Maksimal 50 karakter
Phone Number Validation
- Tidak boleh kosong
- Harus 10-15 digit angka
Qty Validation (Open Denom)
- Minimal 10.000
- Maksimal 10.000.000
Response Models
TransactionResponse
| Property | Tipe | Keterangan | |
|---|---|---|---|
| transactionId | string | null | ID Transaksi |
| refId | string | null | ID Referensi |
| provider | string | null | Provider |
| nominal | string | null | Nominal |
| productCode | string | null | Kode Produk |
| destination | string | null | Nomor Tujuan |
| status | string | null | Status |
| price | float | null | Harga |
| time | string | null | Waktu |
| serialNumber | string | null | Serial Number |
| failureReason | string | null | Alasan Gagal |
Methods:
isProcessing()- Cek apakah sedang diprosesisSuccessful()- Cek apakah berhasilisFailed()- Cek apakah gagalgetStatusText()- Dapatkan teks statustoArray()- Convert ke arraytoJson()- Convert ke JSON
StatusCheckResponse
| Property | Tipe | Keterangan | |
|---|---|---|---|
| refId | string | null | ID Referensi |
| provider | string | null | Provider |
| nominal | string | null | Nominal |
| productCode | string | null | Kode Produk |
| destination | string | null | Nomor Tujuan |
| transactionTime | string | null | Waktu Transaksi |
| status | string | null | Status |
| serialNumber | string | null | Serial Number |
| price | float | null | Harga |
| failureReason | string | null | Alasan Gagal |
| transactionId | string | null | ID Transaksi |
Methods:
isSuccessful()- Cek apakah suksesisFailed()- Cek apakah gagalisPending()- Cek apakah pendingisNoData()- Cek apakah tidak ada datagetStatusText()- Dapatkan teks statustoArray()- Convert ke arraytoJson()- Convert ke JSON
WebhookCallback
| Property | Tipe | Keterangan | |
|---|---|---|---|
| transactionId | string | null | ID Transaksi |
| refId | string | null | ID Referensi |
| provider | string | null | Provider |
| nominal | string | null | Nominal |
| productCode | string | null | Kode Produk |
| destination | string | null | Nomor Tujuan |
| status | string | null | Status |
| serialNumber | string | null | Serial Number |
| price | float | null | Harga |
| date | string | null | Tanggal |
| time | string | null | Waktu |
| failureReason | string | null | Alasan Gagal |
Methods:
isSuccessful()- Cek apakah suksesisFailed()- Cek apakah gagalgetStatusText()- Dapatkan teks statusgetFullDateTime()- Dapatkan tanggal + waktutoArray()- Convert ke arraytoJson()- Convert ke JSON
PriceListItem
| Property | Tipe | Keterangan |
|---|---|---|
| code | string | Kode Produk |
| description | string | Deskripsi |
| product | string | Nama Produk |
| category | string | Kategori |
| price | float | Harga |
| status | string | Status (1=tersedia) |
Methods:
isAvailable()- Cek ketersediaangetFormattedPrice()- Format harga RupiahgetCategoryShort()- Nama kategori pendektoArray()- Convert ke arraytoJson()- Convert ke JSON
Testing
Changelog
Lihat CHANGELOG.md untuk riwayat perubahan lengkap.
License
MIT License
Developer
NdraDeveloper
- GitHub: https://github.com/NdraDev
- Package: https://github.com/NdraDev/okeconnect-php-client
- Packagist: https://packagist.org/packages/ndradev/okeconnect-php-client
Support
Jika ada pertanyaan atau masalah, silakan buat issue di: https://github.com/NdraDev/okeconnect-php-client/issues
All versions of okeconnect-php-client with dependencies
PHP Build Version
Package Version
The package ndradev/okeconnect-php-client contains the following files
Loading the files please wait ...