0

I am having trouble mapping the documentation from eway to the omnipay eway code.

Reading the eway documentation Rapid 3.0 Transparent Redirect API (page 23) uses a field InvoiceReference 'The merchant’s reference number for this transaction'. I want to use this as a UUID on my website. Then my response handler can match that UUID and confirm the payment.

The problem i have is matching the documentation from the eway API to the code in omnipay.

In eway/src/Message/RapidPurchaseRequest.php there is:

$data['Payment'] = array();
$data['Payment']['TotalAmount'] = $this->getAmountInteger();
$data['Payment']['InvoiceNumber'] = $this->getTransactionId();
$data['Payment']['InvoiceDescription'] = $this->getDescription();
$data['Payment']['CurrencyCode'] = $this->getCurrency();

but nothing about 'InvoiceReference'. I understand the omnipay gateway has its own editorial rules for variable names, and if the documentation was not so sparse I could probably work it out.

So, can i use the (eway) InvoiceReference (string:50) attribute with omnipay? or has that just not been implemented in the eway module?

pgee70
  • 3,707
  • 4
  • 35
  • 41

1 Answers1

3

Update Feb 2015: My pull request has been accepted and the Invoice Reference has been added to the OmniPay eWAY library.


You are correct - the field hasn't been implemented in the eWAY module yet, at the moment only the standard OmniPay fields that match eWAY fields have been implemented.

You could modify the RapidPurchaseRequest class to add the get/set functions and include the InvoiceReference field with the other Payment variables.

Or, it you prefer not to modify the OmniPay module, you can alter the data in your code before it gets sent:

$data = $request->getData();
$data['Payment']['InvoiceReference'] = 'INV-0001';
$response = $request->sendData($data);

If you are after a unique ID, the response to this request comes with the AccessCode variable, which is documented as "A unique access code that is used to identify this transaction". This is also the code you can use to get the transaction results.

John C
  • 8,223
  • 2
  • 36
  • 47
  • I've submitted a [pull request](https://github.com/omnipay/eway/pull/5) with the additional fields for eWAY. [My fork](https://github.com/incarnate/eway) also has them until the pull is accepted. – John C May 31 '14 at 02:14