Download the PHP package trisnawan/multi-payment-service without Composer

On this page you can find all versions of the php package trisnawan/multi-payment-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package multi-payment-service

Multi Payment Library for PHP

Library ini digunakan untuk mengakses backend kanal pembayaran private hosted. Backend saat ini belum dapat saya share secara bebas (hanya untuk penggunaan pribadi).

Installation

Environment

Variabel tetap menggunakan nama yang sama dan dibaca melalui getenv(). Muat .env seperti pada aplikasi Anda sebelumnya. payment.api boleh dengan atau tanpa slash terakhir. payment.token adalah bearer token integrasi dari service aktif; payment.webhook adalah webhook secret service tersebut.

Payments

Pilih ID metode dari $payment->findPaymentMethod(10000). Gunakan reference yang sama untuk retry request yang sama; backend mengembalikan transaksi/invoice sebelumnya. Gunakan reference baru untuk pembayaran baru. Nominal IDR berupa integer.

Kompatibilitas

Namespace, constructor, parameter, default argument, dan tipe hasil method lama dipertahankan. Aplikasi yang sudah menggunakan createDirect, findDirect, getDirect, createLink, findLink, getLink, getReport, findPaymentMethod, findCategories, cancelDirect, cancelLink, refreshDirect, atau Webhook::verifyData() tidak perlu mengubah kode pemanggilannya. Konfigurasi environment juga tetap sama.

Helper menerima response object/array langsung dari endpoint lama serta envelope { "status": 200, "data": ... }. requestGet(), requestPost(), dan getData() tetap memberikan response mentah. findDirect() tetap memberikan array ItemTransaction, dan ItemMethod::$fee tetap string. Properti lama tetap tersedia, termasuk direct, redirect, invoice, mobile_number, cashtag, dan return_url.

Data tambahan yang tersedia bila dikirim backend:

Lifecycle, simulasi, dan laporan

Method Hasil
getCapabilities() Array simulation dan remote_cancellation.
getTransaction($id) ItemTransaction untuk transaksi direct maupun redirect.
simulateTransaction($id, $status = 'paid') Array id, status, changed.
simulateDirect($id, $status = 'paid') Alias simulateTransaction.
cancelDirect($id) Array hasil pembatalan transaksi lokal.
cancelLink($id) Array hasil pembatalan invoice dan attempt unpaid.
refreshDirect($id) Array hasil rekonsiliasi status dari provider Pivot.
resendWebhook($id) Array sending setelah webhook berhasil dikirim.
findReport($filters = []) Array total dan data berupa array ItemTransaction.

Simulasi hanya tersedia pada backend dengan CI_ENVIRONMENT selain production (development/testing) dan token integrasi dengan grant client_update. Token yang dibuat dashboard sudah memiliki grant read/create/update. Token hanya dapat mengubah transaksi service miliknya. Status yang diterima: paid, expired, cancel, cancelled, failed; cancel disimpan sebagai cancelled. Pengulangan status yang sama idempotent, perubahan antarstatus final ditolak HTTP 409. Simulasi memperbarui transaksi/invoice/laporan dan mengantrekan webhook sesuai konfigurasi backend.

Production menolak simulasi HTTP 403. Token tanpa izin update ditolak 403; akses di luar service ditolak 404; token dicabut/kedaluwarsa atau service nonactive ditolak 401. Flag development di aplikasi pemakai tidak dapat mengaktifkan simulasi pada backend production.

Pembatalan bersifat lokal; tagihan provider mungkin tetap aktif (remote_cancellation=false). Callback paid yang terverifikasi tetap direkonsiliasi sesudah pembatalan/expiry. findReport() mendukung filter backend limit, offset, status, search, start, end, cat_id, cat_ref, dan client_id sesuai scope token.

Kegagalan API tetap melempar \Exception; getCode() sekarang berisi status HTTP untuk membedakan 403/409/502. getResponseCode(), getData(), dan isSuccess() mengikuti request terakhir, termasuk setelah error. Kegagalan koneksi mempertahankan exception Guzzle.

Webhook

verifyData() tetap membaca raw body dan header request. Untuk framework yang menyediakan keduanya, tersedia $webhook->verifyPayload($rawBody, $headers), dengan hasil ItemTransaction yang sama. Jangan decode/re-encode body sebelum verifikasi. Signature HMAC-SHA256 diverifikasi dengan hash_equals; nama header tidak membedakan huruf besar/kecil. Jika M-Payment-Token dikirim, nilainya juga harus sesuai secret. Webhook lama yang hanya membawa signature tetap didukung. Secret kosong ditolak.

Backend mengirim event transactions dengan status unpaid, paid, expired, cancelled, atau failed. Pengiriman dapat berulang; jangan menurunkan status paid karena callback lama.

Pengujian

Tes regresi memakai Guzzle MockHandler dan tidak membaca .env atau menghubungi provider. Untuk pengujian API sebenarnya, jalankan python tests/integration/verify.py dari direktori payment-service-php; runner membuat database disposable dan memanggil tests/service.php library pada development/testing/production. Lihat README pengujian backend untuk prasyaratnya.


All versions of multi-payment-service with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
guzzlehttp/guzzle Version 7.15.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package trisnawan/multi-payment-service contains the following files

Loading the files please wait ...