PHP code example of mhmfajar / codeigniter-payment-orchestrator

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

    

mhmfajar / codeigniter-payment-orchestrator example snippets


$payment = service('paymentOrchestrator');

$response = $payment->create(array(
    'order_id' => 'INV-001',
    'amount' => 150000,
    'customer_name' => 'Mhmfajar',
    'customer_email' => '[email protected]',
));

return redirect()->to($response->getPaymentUrl());

$payload = $this->request->getJSON(true);

if (! is_array($payload)) {
    $payload = $this->request->getPost();
}

$response = service('paymentOrchestrator')->handleCallback($gateway, $payload);