Skip to content

More flexible use of transactionReference with Purchase #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ class PurchaseRequest extends AuthorizeRequest

public function getData()
{
if ($this->parameters->get('transactionReference')) {
$realCardExists = ($this->getCard() || $this->getCardReference());
if ($this->parameters->get('transactionReference') && !$realCardExists) {
Copy link
Contributor

@RobvH RobvH Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukeholder simple enough. I'm curious how the expectation here failed.

The original condition is meant to differentiate between a case of a reference sale or card sale. According to this change, checking for card data is needed to truly make that determination. Seems odd, so I'm curious what you're using the transaction reference field for in a card sale...

In all other cases throughout the API (eg. voiding, etc) transaction reference === the ORIGID. Can you show me what you're doing with this field? I'm thinking it shouldn't be there, but I'd like to know if it has a valid use case.

return $this->getReferenceSaleData();
}

Expand Down