diff --git a/src/XenditPHPClient.php b/src/XenditPHPClient.php index 5ec1940..0370fd5 100644 --- a/src/XenditPHPClient.php +++ b/src/XenditPHPClient.php @@ -21,8 +21,10 @@ function createInvoice ($external_id, $amount, $payer_email, $description, $invo $data['payer_email'] = $payer_email; $data['description'] = $description; - if (!empty($invoice_options['callback_virtual_account_id'])) { - $data['callback_virtual_account_id'] = $invoice_options['callback_virtual_account_id']; + if ( is_array($invoice_options) ) { + foreach ( $invoice_options as $key => $value ) { + $data[$key] = $value; + } } $payload = json_encode($data); @@ -59,8 +61,10 @@ function createDisbursement ($external_id, $amount, $bank_code, $account_holder_ $data['account_holder_name'] = $account_holder_name; $data['account_number'] = $account_number; - if (!empty($disbursement_options['description'])) { - $data['description'] = $disbursement_options['description']; + if ( is_array($disbursement_options) ) { + foreach ( $disbursement_options as $key => $value ) { + $data[$key] = $value; + } } $payload = json_encode($data);