PHP code example of negbross / laravel-duitku

1. Go to this page and download the library: Download negbross/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/ */

    

negbross / laravel-duitku example snippets


use Negbross\LaravelDuitku\Facades\DuitkuAPI;

$listPayments = DuitkuAPI::getPaymentMethod(1000000);

use Negbross\LaravelDuitku\Facades\DuitkuAPI;

DuitkuAPI::createTransaction([
    'merchantOrderId'   => 10000,
    'customerVaName'    => 'Super negbros',
    'email'             => '[email protected]',
    'paymentAmount'     => 100000,
    'paymentMethod'     => 'VC',
    'productDetails'    => 'Buy Ferrari',
    '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'         => 'Super',
        'lastName'          => 'Negbros',
        'email'             => '[email protected]',
        'phoneNumber'       => $phoneNumber,
        'billingAddress'    => $address,
        'shippingAddress'   => $address
    ],
    'additionalParam'   => '', // optional
    'merchantUserInfo'  => '', // optional
]);

use Negbross\LaravelDuitku\Facades\DuitkuAPI;

DuitkuAPI::checkTransactionStatus(1000000);

use Negbross\LaravelDuitku\Facades\DuitkuAPI;

$payment = DuitkuAPI::getNotificationTransaction();

use Negbross\LaravelDuitku\Facades\DuitkuPOP;

DuitkuPOP::createTransaction([
    'merchantOrderId'   => 10000,
    'customerVaName'    => 'Super negbros',
    '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'         => 'Super',
        'lastName'          => 'Negbross',
        'email'             => '[email protected]',
        'phoneNumber'       => $phoneNumber,
        'billingAddress'    => $address,
        'shippingAddress'   => $address
    ],
    'additionalParam'   => '', // optional
    'merchantUserInfo'  => '', // optional
]);

use Negbross\LaravelDuitku\Facades\DuitkuPOP;

$payment = DuitkuPOP::getNotificationTransaction();
bash
   php artisan duitku:install