From 0fc4104d1705e1b98a16b44673e082ca439b5a6c Mon Sep 17 00:00:00 2001 From: Craig Paul Date: Sat, 22 Oct 2016 20:04:42 -0600 Subject: [PATCH] Adds vault cvd purchase functionality --- src/Gateway.php | 12 +++++++++++- src/Transaction.php | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Gateway.php b/src/Gateway.php index 5fbbc61..00ff18d 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -121,7 +121,17 @@ public function capture($transaction, string $order = null, $amount = null) */ public function cards() { - return new Vault($this->id, $this->token, $this->environment); + $vault = new Vault($this->id, $this->token, $this->environment); + + if (isset($this->avs)) { + $vault->avs = boolval($this->avs); + } + + if (isset($this->cvd)) { + $vault->cvd = boolval($this->cvd); + } + + return $vault; } /** diff --git a/src/Transaction.php b/src/Transaction.php index 73b0a7e..4e40da9 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -162,7 +162,7 @@ public function toXml() $type = $xml->addChild($params['type']); $efraud = in_array( $params['type'], - ['purchase', 'preauth', 'card_verification', 'cavv_purchase', 'cavv_preauth'] + ['purchase', 'preauth', 'card_verification', 'cavv_purchase', 'cavv_preauth', 'res_purchase_cc'] ); unset($params['type']);