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
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
You can install the package via composer:
composer require sawirricardo/midtrans-api
$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');
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.