PHP code example of adityadarma / laravel-duitku
1. Go to this page and download the library: Download adityadarma/laravel-duitku library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
adityadarma / laravel-duitku example snippets
use AdityaDarma\LaravelDuitku\Facades\DuitkuAPI;
$listPayments = DuitkuAPI::getPaymentMethod(1000000);
use AdityaDarma\LaravelDuitku\Facades\DuitkuAPI;
DuitkuAPI::createTransaction([
'merchantOrderId' => 10000,
'customerVaName' => 'Aditya Darma',
'email' => '[email protected] ',
'paymentAmount' => 100000,
'paymentMethod' => 'VC',
'productDetails' => 'Buy Company',
'expiryPeriod' => 10, // optional (minute)
'phoneNumber' => '08123456789', // optional
'itemDetails' => [ // optional
[
'name' => 'Test Item 1',
'price' => 10000,
'quantity' => 1
],[
'name' => 'Test Item 2',
'price' => 10000,
'quantity' => 1
]
],
'customerDetail' => [ // optional
'firstName' => 'Aditya',
'lastName' => 'Darma',
'email' => '[email protected] ',
'phoneNumber' => $phoneNumber,
'billingAddress' => $address,
'shippingAddress' => $address
],
'additionalParam' => '', // optional
'merchantUserInfo' => '', // optional
]);
use AdityaDarma\LaravelDuitku\Facades\DuitkuAPI;
DuitkuAPI::checkTransactionStatus(1000000);
use AdityaDarma\LaravelDuitku\Facades\DuitkuAPI;
$payment = DuitkuAPI::getNotificationTransaction();
use AdityaDarma\LaravelDuitku\Facades\DuitkuPOP;
DuitkuPOP::createTransaction([
'merchantOrderId' => 10000,
'customerVaName' => 'Aditya Darma',
'email' => '[email protected] ',
'paymentAmount' => 100000,
'productDetails' => 'Buy Company',
'expiryPeriod' => 10, // optional (minute)
'phoneNumber' => '08123456789', // optional
'itemDetails' => [ // optional
[
'name' => 'Test Item 1',
'price' => 10000,
'quantity' => 1
],[
'name' => 'Test Item 2',
'price' => 10000,
'quantity' => 1
]
],
'customerDetail' => [ // optional
'firstName' => 'Aditya',
'lastName' => 'Darma',
'email' => '[email protected] ',
'phoneNumber' => $phoneNumber,
'billingAddress' => $address,
'shippingAddress' => $address
],
'additionalParam' => '', // optional
'merchantUserInfo' => '', // optional
]);
use AdityaDarma\LaravelDuitku\Facades\DuitkuPOP;
$payment = DuitkuPOP::getNotificationTransaction();
bash
php artisan duitku:install