From 1ad6d18eacc015eab7b50540983ce6e740d15c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muharrem=20ERI=CC=87N?= Date: Wed, 19 Dec 2018 19:14:50 +0300 Subject: [PATCH] add Campaign URL to response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Muharrem EṘN --- examples/garanti/3d-pay/form.php | 2 +- examples/garanti/3d/form.php | 2 +- examples/garanti/regular/status.php | 2 +- src/EstPos.php | 3 +++ src/GarantiPos.php | 3 +++ src/PosNet.php | 3 +++ 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/garanti/3d-pay/form.php b/examples/garanti/3d-pay/form.php index 1d066c34..0944ba84 100644 --- a/examples/garanti/3d-pay/form.php +++ b/examples/garanti/3d-pay/form.php @@ -11,7 +11,7 @@ $order_id = date('Ymd') . strtoupper(substr(uniqid(sha1(time())),0,4)); -$amount = (double) 320; +$amount = (double) 1; $instalment = '0'; $success_url = $base_url . 'response.php'; diff --git a/examples/garanti/3d/form.php b/examples/garanti/3d/form.php index 4977e4ed..1b9912dc 100644 --- a/examples/garanti/3d/form.php +++ b/examples/garanti/3d/form.php @@ -11,7 +11,7 @@ $order_id = date('Ymd') . strtoupper(substr(uniqid(sha1(time())),0,4)); -$amount = (double) 320; +$amount = (double) 1; $instalment = '0'; $success_url = $base_url . 'response.php'; diff --git a/examples/garanti/regular/status.php b/examples/garanti/regular/status.php index 136720b2..d409530e 100644 --- a/examples/garanti/regular/status.php +++ b/examples/garanti/regular/status.php @@ -8,7 +8,7 @@ // Query Order $query= $pos->bank->status([ - 'order_id' => '2018111377EF', + 'order_id' => '201812195CF2', 'currency' => 'TRY', 'ip' => $ip ]); diff --git a/src/EstPos.php b/src/EstPos.php index e3f24d52..0b3af290 100644 --- a/src/EstPos.php +++ b/src/EstPos.php @@ -360,6 +360,7 @@ public function makeRegularPayment() 'status_detail' => $this->getStatusDetail(), 'error_code' => isset($this->data->Extra->ERRORCODE) ? $this->printData($this->data->Extra->ERRORCODE) : null, 'error_message' => isset($this->data->Extra->ERRORCODE) ? $this->printData($this->data->ErrMsg) : null, + 'campaign_url' => null, 'extra' => isset($this->data->Extra) ? $this->data->Extra : null, 'all' => $this->data, 'original' => $this->data, @@ -428,6 +429,7 @@ public function make3DPayment() 'xid' => (string) $this->request->get('xid'), 'md_error_message' => (string) $this->request->get('mdErrorMsg'), 'name' => (string) $this->request->get('firmaadi'), + 'campaign_url' => null, 'email' => (string) $this->request->get('Email'), 'extra' => isset($this->data->Extra) ? $this->data->Extra : null, 'all' => $this->data, @@ -495,6 +497,7 @@ public function make3DPayPayment() 'md_error_message' => (string) $this->request->get('mdErrorMsg'), 'name' => (string) $this->request->get('firmaadi'), 'email' => (string) $this->request->get('Email'), + 'campaign_url' => null, 'extra' => $this->request->get('Extra'), 'all' => $this->request->request->all(), ]; diff --git a/src/GarantiPos.php b/src/GarantiPos.php index f5abd682..c2702c39 100644 --- a/src/GarantiPos.php +++ b/src/GarantiPos.php @@ -509,6 +509,7 @@ public function makeRegularPayment() 'status_detail' => $this->getStatusDetail(), 'error_code' => isset($this->data->Transaction->Response->Code) ? $this->printData($this->data->Transaction->Response->Code) : null, 'error_message' => isset($this->data->Transaction->Response->ErrorMsg) ? $this->printData($this->data->Transaction->Response->ErrorMsg) : null, + 'campaign_url' => isset($this->data->Transaction->CampaignChooseLink) ? $this->printData($this->data->Transaction->CampaignChooseLink) : null, 'extra' => isset($this->data->Extra) ? $this->data->Extra : null, 'all' => $this->data, 'original' => $this->data, @@ -566,6 +567,7 @@ public function make3DPayment() 'error_code' => isset($this->data->Transaction->Response->ErrorCode) ? $this->printData($this->data->Transaction->Response->ErrorCode) : null, 'error_message' => isset($this->data->Transaction->Response->ErrorMsg) ? $this->printData($this->data->Transaction->Response->ErrorMsg) : null, 'reason_code' => isset($this->data->Transaction->Response->ReasonCode) ? $this->printData($this->data->Transaction->Response->ReasonCode) : null, + 'campaign_url' => isset($this->data->Transaction->CampaignChooseLink) ? $this->printData($this->data->Transaction->CampaignChooseLink) : null, 'md_status' => $this->request->get('mdstatus'), 'rand' => (string) $this->request->get('rnd'), 'hash' => (string) $this->request->get('secure3dhash'), @@ -643,6 +645,7 @@ public function make3DPayPayment() 'error_code' => (string) $this->request->get('errcode'), 'error_message' => (string) $this->request->get('errmsg'), 'md_error_message' => (string) $this->request->get('mderrormessage'), + 'campaign_url' => null, 'name' => (string) $this->request->get('firmaadi'), 'email' => (string) $this->request->get('Email'), 'extra' => $this->request->get('Extra'), diff --git a/src/PosNet.php b/src/PosNet.php index f3e2afe9..94a03e32 100644 --- a/src/PosNet.php +++ b/src/PosNet.php @@ -429,6 +429,7 @@ public function makeRegularPayment() 'status_detail' => $this->getStatusDetail(), 'error_code' => $error_code, 'error_message' => $error_message, + 'campaign_url' => null, 'extra' => null, 'all' => $this->data, 'original' => $this->data, @@ -546,6 +547,7 @@ public function make3DPayment() ], 'xid' => isset($this->data->oosResolveMerchantDataResponse->xid) ? $this->data->oosResolveMerchantDataResponse->xid : null, 'md_error_message' => isset($this->data->oosResolveMerchantDataResponse->mdErrorMessage) ? $this->data->oosResolveMerchantDataResponse->mdErrorMessage : null, + 'campaign_url' => null, 'all' => $this->data, ]; @@ -609,6 +611,7 @@ public function make3DPayPayment() 'md_error_message' => (string) $this->request->get('mdErrorMsg'), 'name' => (string) $this->request->get('firmaadi'), 'email' => (string) $this->request->get('Email'), + 'campaign_url' => null, 'extra' => $this->request->get('Extra'), 'all' => $this->request->request->all(), ];