sawirricardo / midtrans-api
Interact with Midtrans API. Included Snap and its Core API.
Fund package maintenance!
sawirricardo
Installs: 12 860
Dependents: 2
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 3
Open Issues: 4
Requires
- php: ^8.0
- sammyjo20/saloon: ^1.0
- spatie/data-transfer-object: ^1.0 | ^2.0 | ^3.7
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- pestphp/pest: ^1.20
- spatie/ray: ^1.28
README
Interact with Midtrans API. Included Snap and its Core API.
If you use Laravel, you can use sawirricardo/laravel-midtrans
package, which has more exciting features by default
Support us
Investing on this package is defintely a good move from you. You can support by donating to my wallet
- Wallet 0x3F20d326E5DA8ab6D27d9b2DdD350baB1e589d87
- PayPal https://www.paypal.com/paypalme/sawirricardo.
- BCA 8330123584
Installation
You can install the package via composer:
composer require sawirricardo/midtrans-api
Usage
$midtransClient = \Sawirricardo\Midtrans\Midtrans::make( $serverKey, $clientKey, $isProduction, $is3ds, $isSanitized ); $snapToken = $midtransClient->snap()->create(new \Sawirricardo\Midtrans\Dto\TransactionDto([ 'transaction_details' => [ 'order_id' => 'your-order-id', 'gross_amount' => 10000, ] ])); echo $snapToken->token; echo $snapToken->redirect_url; $transactionStatus = $midtransClient->payment()->getStatus('your-order-id-or-transaction-id');
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.