Skip to content

Commit

Permalink
Set TransactionType to recurring when cvn not available.
Browse files Browse the repository at this point in the history
Cvn is required for an onsite purchase. It is not required when processing a recurring payment.
It seems reasonable to assume that if not passed, and we are working with a DirectPayment with
a token then it is a recurring payment.

Setting to MOTO would have the same effect. The practical difference between Recurring & MOTO is not clear
and there is not an obvious Omnipay standard to follow so sticking with this assumption for
now
  • Loading branch information
eileenmcnaughton committed Sep 25, 2017
1 parent a5f95f4 commit 7257c24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Message/RapidDirectPurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public function getData()
$data['Payment']['CurrencyCode'] = $this->getCurrency();
$data['Payment']['InvoiceReference'] = $this->getInvoiceReference();

if (empty($data['Customer']['CardDetails']['CVN']) && $this->getCardReference()) {
$data['TransactionType'] = 'Recurring';
}

if ($this->getCardReference()) {
$data['Method'] = 'TokenPayment';
} else {
Expand Down

0 comments on commit 7257c24

Please sign in to comment.