set_ordermanagement('refund_full'); // Set up the additional information $aporder['invoicenumber'] = 'INVOICE123456'; $aporder['ordernumber'] = 'ORDER1234567'; $aporder['creditinvoicenumber'] = 'CREDITINVOICE123456'; // Create the order object for order management (OM) $Afterpay->set_order($aporder, 'OM'); // Set up the AfterPay credentials and sent the order $authorisation['merchantid'] = ''; $authorisation['portfolioid'] = ''; $authorisation['password'] = ''; $modus = 'test'; // for production set to 'live' // Show request in debug var_dump(array('AfterPay Request' => $Afterpay)); $Afterpay->do_request($authorisation, $modus); // Show result in debug var_dump(array('AfterPay Result' => $Afterpay->order_result));