PHP code example of gerbang-bayar / atome

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

    

gerbang-bayar / atome example snippets


use GerbangBayar\Atome\Atome;


// Instantiate connector
$atome = new Atome(username: $username, password: $password, sandbox: false);

$response = $atome->createPayment(
    referenceId: 'someuniquereferenceid',
    currency: 'MYR',
    amount: 1000, // in cents
    callbackUrl: 'https://callbackurl.here',
    paymentResultUrl: 'https:/returnurl.here',
    customerInfo: [
        'name' => 'Raditz Farhan',
        'phone' => '6012345678',
        'email' => '[email protected]'
    ],
    shippingAddress: [
        'countryCode' => 'MY',
        'lines' => [
            'No 1, Taman ABC',
            'Jalan DCEF'
        ],
        'postCode' => '12345'
    ],
    items: [
        [
            'itemId' => 'ITEMSKU',
            'name' => 'Item 1',
            'quantity' => 1,
            'price' => 1000,
        ]
    ]
);