PHP code example of darkghosthunter / flow-sdk

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

    

darkghosthunter / flow-sdk example snippets




// Load the Flow SDK.
(__DIR__ . '/www/index.php');



use DarkGhostHunter\FlowSdk\Flow;

$flow = Flow::make('production', [
    'apiKey'    => '1F90971E-8276-4713-97FF-2BLF5091EE3B',
    'secret'    => 'f8b45f9b8bcdb5702dc86a1b894492303741c405',
]);

$paymentResponse = $flow->payment()->commit([
    'commerceOrder'     => 'order#123',
    'subject'           => 'Console',
    'amount'            => 99990,
    'email'             => '[email protected]',
    'urlConfirmation'   => 'https://myapp.com/flow/confirm',
    'urlReturn'         => 'https://myapp.com/flow/return',
    'optional'          => [
        'Message' => 'Your order is being shipped!'
    ]
]);

header('Location: '. $paymentResponse->getUrl());