Yes the typo was only in the post.
Code:
$date = cbFormatDate( $variables['var2']->time_initiated, 1, false );
function extract_basket_item($item)
{
return $item->renderColumn();
}
$payment_basket = array (
'date' => $variables['var2']->date,
'user_id' => $variables['var2']->user_id,
'txn_type' => $variables['var2']->txn_type,
'txn_id' => $variables['var2']->txn_id,
'payment_type' => $variables['var2']->payment_type,
'address_street' => $variables['var2']->address_street,
'address_city' => $variables['var2']->address_city,
'address_state' => $variables['var2']->address_state,
'address_zip' => $variables['var2']->address_zip,
'address_country' => $variables['var2']->address_country,
'payer_business_name' => $variables['var2']->payer_business_name,
'first_name' => $variables['var2']->first_name,
'last_name' => $variables['var2']->last_name,
'payer_email' => $variables['var2']->payer_email,
'contact_phone' => $variables['var2']->contact_phone,
'vat_number' => $variables['var2']->vat_number,
'item_name' => $variables['var2']->item_name,
'item_number' => $variables['var2']->item_number,
'quantity' => $variables['var2']->quantity,
'custom' => $variables['var2']->custom,
'invoice' => $variables['var2']->invoice,
'tax' => $variables['var2']->tax,
'payment_date' => $variables['var2']->payment_date,
'shipping' => $variables['var2']->shipping,
'mc_currency' => $variables['var2']->mc_currency,
'mc_fee' => $variables['var2']->mc_fee,
'mc_gross' => $variables['var2']->mc_gross,
'mc_handling' => $variables['var2']->mc_handling,
'mc_shipping' => $variables['var2']->mc_shipping,
'payment_fee' => $variables['var2']->payment_fee,
'payment_gross' => $variables['var2']->payment_gross,
'mc_amount3' => $variables['var2']->mc_amount3,
'basket_items' => $variables['var2']->loadPaymentItems()
);
$context_options = array (
'http' => array (
'method' => 'POST',
'header' => ['Content-type: application/x-www-form-urlencoded',
'Authorization: Bearer xxxxxxx'],
'content' => http_build_query($payment_basket)
)
);
$context = stream_context_create($context_options);
$fp = fopen('https://ipaidthat.io/inv/api/activha-webhook/902', 'r', false, $context);
fpassthru($fp);
fclose($fp);