Description
It is a trivial exercise to handle the extra and billing_address fields in token_purchase by modifying token_purchase, as follows:
public function token_purchase($token, $amount, $reference, $cvv = null, $currency = "AUD", $billing_address = null, $extra = null, $metadata = null, $addendum_data = null)
and add the following lines below the payload definition:
if (!is_null($extra)) $payload["extra"] = $extra;
if (!is_null($billing_address)) $payload["billing_address"] = $billing_address;
if (!is_null($metadata)) $payload["metadata"] = $metadata;
if (!is_null($addendum_data)) $payload["addendum_data"] = $addendum_data;
and update the documentation:
* @param array<string,string> $billing_address an assoc. array of billing_address params to merge into the request
* @param array<string,string> $extra an assoc. array of extra params to merge into the request
* @param array<string,string> $metadata an assoc. array of metadata params to merge into the request
* @param array<string,string> $addendum_data an assoc. array of addendum_data params to merge into the request