Skip to content

Commit 1ee2eee

Browse files
Set TransactionType to MOTO when cvn not available.
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 or Recurring 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
1 parent a5f95f4 commit 1ee2eee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Message/RapidDirectPurchaseRequest.php

+5
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ public function getData()
8282
$data['Payment']['CurrencyCode'] = $this->getCurrency();
8383
$data['Payment']['InvoiceReference'] = $this->getInvoiceReference();
8484

85+
if (empty($data['Customer']['CardDetails']['CVN']) && $this->getCardReference()) {
86+
// We have a token and card is not present so treat as MOTO.
87+
$data['TransactionType'] = 'MOTO';
88+
}
89+
8590
if ($this->getCardReference()) {
8691
$data['Method'] = 'TokenPayment';
8792
} else {

0 commit comments

Comments
 (0)