PHP code example of useshimmer / laravel-tebex-checkout

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

    

useshimmer / laravel-tebex-checkout example snippets


    $connector = new TebexCheckout('foo', 'bar');
    
    $request = new CreateCheckoutRequest(
        basket: [
            'return_url' => 'http://foo.com',
            'complete_url' => 'http://bar.com',
            'custom' => [
                'baz' => 'buzz',
            ],
        ],
        items: [
            [
                'package' => [
                    'name' => 'foobar',
                    'price' => 12.34,
                ],
            ],
        ]
    );

    $response = $connector->send($request);

    $connector = new TebexCheckout('foo', 'bar');

    $response = $connector->checkout()->create(
        basket: [
            'return_url' => 'http://foo.com',
            'complete_url' => 'http://bar.com',
            'custom' => [
                'baz' => 'buzz',
            ],
        ],
        items: [
            [
                'package' => [
                    'name' => 'foobar',
                    'price' => 12.34,
                ],
            ],
        ]
    );