PxPay supports multiple parameters to be passed in, and back out again. You should have a good look through the integration guide, it gives a clear definition of what fields are required/optional, what data types or limits apply and what they should be used for.
You can use the fields TxnData1
, TxnData2
, TxnData3
for any custom attributes, as well as MerchantReference
which should be used for the order ID as in your example. Essentially, whatever information you pass in those fields will be passed back to you once the transaction is complete.
Here's an example request to PxPay 2.0:
<GenerateRequest>
<PxPayUserId>your_user_id</PxPayUserId>
<PxPayKey>foobar1234</PxPayKey>
<TxnType>Purchase</TxnType>
<AmountInput>1.23</AmountInput>
<CurrencyInput>NZD</CurrencyInput>
<MerchantReference>YOUR_ORDER_ID_HERE</MerchantReference>
<TxnData1>Custom data field 1</TxnData1>
<TxnData2>Custom data field 2</TxnData2>
<TxnData3>Custom data field 3</TxnData3>
<UrlSuccess>http://stackoverflow.com</UrlSuccess>
<UrlFail>http://facepalm.com</UrlFail>
</GenerateRequest>
I've had a quick look through the code for the Omnipay Payment Express code on GitHub, and you'll find this line in the class that generates a request to PxPay:
public function getData()
{
$this->validate('amount', 'returnUrl');
$data = new SimpleXMLElement('<GenerateRequest/>');
$data->PxPayUserId = $this->getUsername();
$data->PxPayKey = $this->getPassword();
$data->TxnType = $this->action;
$data->AmountInput = $this->getAmount();
$data->CurrencyInput = $this->getCurrency();
$data->MerchantReference = $this->getDescription(); // here's your field
$data->UrlSuccess = $this->getReturnUrl();
$data->UrlFail = $this->getReturnUrl();
return $data;
}
So looks that current code only supports the MerchantReference
field, although I'm sure you could add your own support for the other fields. Fork it on GitHub - sure someone else will appreciate it down the line too.