Skip to content

'queryInvoiceReference' responds with V6170 when multiple transactions present with same reference #5

@danielb93

Description

@danielb93

Hi,

I've been busy building a 'close-loop' solution for transaction attempts that are left in an unknown state. The purpose of this solution is to determine if the transaction attempt occurred in eWay and if so, whether it was successful or not so I may update the record on my end to its respective status 'PAID' or 'FAILED'.

This has been a frequent scenario especially when payment attempts are made within a mobile application (iOS/Android) while on a shoddy mobile network connection. If the payment attempt times out, the payment status will be left in a limbo state (PENDING).

When a transaction attempt is initiated, a record will be created holding a 'PENDING' payment status and will be updated accordingly once the transaction response is received. If this response is never captured for whatever reason, the record remains in a PENDING status and it has been a manual task to move it to a 'happy' state (PAID or FAILED).

I rejoiced when I saw the addition of the 'queryInvoiceReference' into the SDK as this allowed me (or so I thought) to query eWay with the record's primary key (which I populate the 'InvoiceReference' field with on all transaction attempts pertaining to that record) and return any transactions associated with that key and determine the transaction status.

This solution works perfectly when there is a single transaction attempt but to my dismay, fails when there is multiple transaction attempts with the same reference (Error code: V6170). This renders my solution useless as all transaction attempts use the same reference (how else would you track the transactions for a record...?)

Real world scenario:

  1. Payment attempt is made (record's payment status == PENDING) and the payment fails with a response (bad card number), thus the record's payment status is updated to 'FAILED'.
  2. User notices bad card number and enters the correct one and attempts payment again.
  3. Payment status is moved back to PENDING prior to the second payment attempt.
  4. The transaction attempt times out however the payment was successful yet the status is unknown on my end and so the status remains as PENDING.

'queryInvoiceReference' will fail in this scenario as more than one transaction attempt has been made.

So my questions are:

  1. Why does this function not support the return of multiple transactions? (The response model nests the transaction result under the key 'Transactions' which is plural and within an array).
  2. Why does eWay allow you to perform a payment using a non-unique InvoiceReference when it throws errors in other functions?
  3. Can this be changed to return multiple transactions?

Apologies for the wall of text, I wanted to be thorough in my explanation to ensure my concern and my function's purpose is clear.

Thanks,
Daniel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions