Download the PHP package muhammadnan/tripay-payment-gateway without Composer
On this page you can find all versions of the php package muhammadnan/tripay-payment-gateway. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download muhammadnan/tripay-payment-gateway
More information about muhammadnan/tripay-payment-gateway
Files in muhammadnan/tripay-payment-gateway
Package tripay-payment-gateway
Short Description PHP Payment Gateway Tripay Library
License GPL-3.0
Homepage https://payment.tripay.co.id
Informations about the package tripay-payment-gateway
Unofficial Tripay Payment Gateway
This package is un-official, already compatible with Composer, for more details please visit Documentation.
This package is made to make it easier for php users
IMPORTANT: Make sure you read the documentation and understand what these methods are used for!
need PHP 8 and above to use this package
Instalation for PHP >8
Instalation for PHP <8
Configuration
before starting further, you must define or import a tripay for further configuration
then after that configure api-key, private-key, merchant-code
or you can create or add env variable in your project (such as laravel, codeigniter) like this
and after add env variable in your project declare main class like this
For mode by default it will be in production mode, to change it to sandbox mode, you can add a 'sandbox' after the merchant code
Contents available
content method available so far
Method | Contents | Status |
---|---|---|
initChannelPembayaran() |
Channel Pembayaran |
OK |
initInstruksiPembayaran(string $code) |
Instruksi Pembayaran |
OK |
initMerchantChannelPembayaran(string $code) |
Merchant Channel Pembayaran |
OK |
initKalkulatorBiaya(string $code, int $amount) |
Kalkulator Biaya |
OK |
initDaftarTransaksi(int $page, int $per_page, string $sort, string $reference, string $merchant_ref, string $method, string $status) |
Daftar Transaksi |
OK |
initTransaction(string $merchantRef) |
Transaksi Open/Close |
OK |
initCallback() |
Callback |
OK |
Request available
request can return the available content, the list of available methods is as follows
Method | Description |
---|---|
getRequest(string $url) |
return return guzzle http client |
getResponse() |
return response |
getJson() |
return json decode |
getStatusCode() |
return status code |
getSuccess() |
return boolean |
getData() |
return data response |
Channel Pembayaran
This API is used to get a list of all available payment channels along with complete information including transaction fees for each channel
the next method can be seen in the request method or can be seen in examples
Instruksi Pembayaran
This API is used to retrieve payment instructions from each channel
the next method can be seen in the request method or can be seen in examples
Merchant Channel Pembayaran
This API is used to obtain a list of payment channels available in your Merchant account along with complete information including transaction fees for each channel
the next method can be seen in the request method or can be seen in examples
Kalkulator Biaya
This API is used to obtain detailed transaction fee calculations for each channel based on a specified nominal
the next method can be seen in the request method or can be seen in examples
Daftar Transaksi
This API is used to get a list of merchant transactions
the next method can be seen in the request method or can be seen in examples
Transaction
Before proceeding to the next step in transactions, please configure your reference merchant
Before making a signature, please set the amount for close transactions and for open transactions, please set the payment method
Note: if you use an open payment do not define the amount and vice versa if you use a close payment do not define the amount
Create Signature
Close Transaction
To define close transaction, use the closeTransaction ()
method
After you define a close transaction, please set the payload with the setPayload (array $ data)
method
examples:
for get the payload u can use method,
after set transaction u can sent the request and get data directly with the getData ()
method or for more method u can seen in the request method or can be see in examples
Get Close Detail Transaction
To see further transaction data, you can see it in transaction details, for close transactions, see below where to get reference code? please go to the simulator menu and get it in the transaction menu, there is a reference code that can be matched here
the next method can be seen in the request method or can be seen in examples
Open Transaction
To define close transaction, use the openTransaction ()
method
After you define a open transaction, please set the payload with the setPayload (array $ data)
method
examples:
for get the payload u can use method,
after set transaction u can sent the request and get data directly with the getData ()
method or for more method u can seen in the request method or can be see in examples
Get Open Detail Transaction
To see further transaction data, you can see it in transaction details, for close transactions, see below where can i get uuid? please open the transaction menu then select open payment then there is a uuid code there
the next method can be seen in the request method or can be seen in examples
Get Daftar Pembayaran Transaction
To see a list of payments made in open transactions you can use this method you can get the uuid in your account.
the next method can be seen in the request method or can be seen in examples
Callback
Callback is a method of sending transaction notifications from the TriPay server to the user's server. When the payment from the customer is completed, the TriPay system will provide a notification containing transaction data which can then be further managed by the user's system.
please define the method below before starting
Receive JSON
to get the json that was sent by tripay you can use the method below
Decode JSON
rather than wasting time on json_decode, this package provides that
Get The Signature
take signature from tripay using the method below
Callback Signature
tripay also sends a callback signature to validate customer data
Call Event
for re-validation, tripay sends an event in the form of payment_status
this package also captures that
Validate Signature
To shorten the code, we prepared signature validation as well.
Validate Event
To shorten the code too, we also set up validate events to go a step further
Testing
This package is tested using PHPunit, but mostly direct testing
Contribute
If you want to contribute this SDK, you can fork, edit and create pull request. And we will review your request and if we finish to review your request. We will merge your request to developemnt branch. Thanks
All versions of tripay-payment-gateway with dependencies
symfony/http-foundation Version ^6.0
vlucas/phpdotenv Version ^5.3