From d16e0cad0da79c4e32ad43ae69d5ab6dd485439d Mon Sep 17 00:00:00 2001 From: zakariaMogh Date: Thu, 4 Nov 2021 17:50:08 +0100 Subject: [PATCH 1/3] Added the remember user attribute --- README.md | 3 ++- src/CreateTelrRequest.php | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a22637..c06ba87 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ $billingParams = [ 'zip' => '11231', 'country' => 'EG', 'email' => 'example@company.com', + 'custref' => 'user_id_1234' // The user's unique system ID to remember his card ]; return $telrManager->pay('ORDER_ID_GOES_HERE', 'TOTAL_AMOUNT', 'DESCRIPTION ...', $billingParams)->redirect(); @@ -86,4 +87,4 @@ And on telr callback **(Success|Cancel|Declined)** to handle response put the fo ```php $telrManager = new \TelrGateway\TelrManager(); $telrManager->handleTransactionResponse($request); -``` \ No newline at end of file +``` diff --git a/src/CreateTelrRequest.php b/src/CreateTelrRequest.php index 5d665db..70da440 100644 --- a/src/CreateTelrRequest.php +++ b/src/CreateTelrRequest.php @@ -368,6 +368,24 @@ public function getLangCode() return data_get($this->data, 'ivp_lang', null); } + /** + * @return mixed + */ + public function getBillingCustref() + { + return data_get($this->data, 'bill_custref', null); + } + + /** + * @param $email + * @return $this + */ + public function setBillingCustref($custref) + { + $this->data['bill_custref'] = $custref; + return $this; + } + /** * Append order id to URL * @@ -412,6 +430,7 @@ public function toArray() 'bill_zip' => $this->getBillingZip(), 'bill_country' => $this->getBillingCountry(), 'bill_email' => $this->getBillingEmail(), - ]; + 'bill_custref' => $this->getBillingCustref(), + ]; } } From 312622386f358ac9280295622f7ab94c139dfc32 Mon Sep 17 00:00:00 2001 From: zakariaMogh Date: Thu, 4 Nov 2021 17:55:58 +0100 Subject: [PATCH 2/3] Added the phone attribute --- README.md | 1 + src/CreateTelrRequest.php | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c06ba87..b456352 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ $billingParams = [ 'zip' => '11231', 'country' => 'EG', 'email' => 'example@company.com', + 'phone' => '+966000000000', 'custref' => 'user_id_1234' // The user's unique system ID to remember his card ]; diff --git a/src/CreateTelrRequest.php b/src/CreateTelrRequest.php index 70da440..8c5bb2f 100644 --- a/src/CreateTelrRequest.php +++ b/src/CreateTelrRequest.php @@ -386,6 +386,24 @@ public function setBillingCustref($custref) return $this; } + /** + * @return mixed + */ + public function getBillingPhone() + { + return data_get($this->data, 'bill_phone', null); + } + + /** + * @param $phone + * @return $this + */ + public function setBillingPhone($phone) + { + $this->data['bill_phone'] = $phone; + + return $this; + } /** * Append order id to URL * @@ -431,6 +449,7 @@ public function toArray() 'bill_country' => $this->getBillingCountry(), 'bill_email' => $this->getBillingEmail(), 'bill_custref' => $this->getBillingCustref(), - ]; + 'bill_phone' => $this->getBillingPhone(), + ]; } } From 9924b02d86bfa23893b31d68a2997ee48002e963 Mon Sep 17 00:00:00 2001 From: zakariaMogh Date: Thu, 4 Nov 2021 17:58:20 +0100 Subject: [PATCH 3/3] Added the phone attribute --- src/CreateTelrRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CreateTelrRequest.php b/src/CreateTelrRequest.php index 8c5bb2f..be9c942 100644 --- a/src/CreateTelrRequest.php +++ b/src/CreateTelrRequest.php @@ -377,7 +377,7 @@ public function getBillingCustref() } /** - * @param $email + * @param $custref * @return $this */ public function setBillingCustref($custref)