PHP code example of invays / bog-payments

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

    

invays / bog-payments example snippets


use Invays\BogPayments\BogPayments;

$bog->order->setLanguage('en');
$bog->order->setCurrency('GEL');
$bog->order->setCallbackUrl('https://example.com/notify');

$order_info = $bog->order->create_order([
            'shop_order_id' => 'OR-855',
            'customer'      => [
                'full_name'    => 'John Doe',
                'masked_email' => '[email protected]',
                'masked_phone' => '0123456789',
            ],
            'products'      => [
                [
                    'product_id' => 'product123',
                    'quantity'   => 1,
                    'price'      => 100,
                ],
                [
                    'product_id' => 'product123de',
                    'quantity'   => 1,
                    'price'      => 525,
                ],

            ],
            'delivery_cost' => 1000
        ]);

use Invays\BogPayments\BogPayments;

$bog = new BogPayments(0000, '000000');
$bog->order->setLanguage('en');
$bog->order->setCurrency('GEL');
$bog->order->setCallbackUrl('https://example.com/notify');
$bog->order->setFailureUrl('https://example.com/failure');
$bog->order->setSuccessUrl('https://example.com/success');
$bog->order->setHeaderTheme('dark');

$order_info = $bog->order->create_order([
            'shop_order_id' => 'OR-855',
            'customer'      => [
                'full_name'    => 'John Doe',
                'masked_email' => '[email protected]',
                'masked_phone' => '0123456789',
            ],
            'products'      => [
                [
                    'product_id' => 'product123',
                    'quantity'   => 1,
                    'price'      => 100,
                ],
                [
                    'product_id' => 'product123de',
                    'quantity'   => 1,
                    'price'      => 525,
                ],

            ],
            'delivery_cost' => 1000
        ]);

use Invays\BogPayments\BogPayments;

$bog = new BogPayments(0000, '000000');
$bog->refund->create_refund('order_id', 10.0);


use Invays\BogPayments\BogPayments;

// Use separate key for installment
$bog = new BogPayments(00000, '', 'installment');
$bog->installment->setButtonText('My custom text');
$bog->installment->setCallbackUrl('https://example.com/notify');