From 57046249ec2b2f426eb4b3a421d105429d7b0858 Mon Sep 17 00:00:00 2001 From: nafezly Date: Sun, 2 Oct 2022 19:20:52 +0200 Subject: [PATCH] add PayTabs --- src/Classes/PayPalPayment.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Classes/PayPalPayment.php b/src/Classes/PayPalPayment.php index 4132dc0..192c1cf 100644 --- a/src/Classes/PayPalPayment.php +++ b/src/Classes/PayPalPayment.php @@ -97,7 +97,12 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u */ public function verify(Request $request): array { - $environment = new SandboxEnvironment($this->paypal_client_id, $this->paypal_secret); + + if($this->paypal_mode=="live") + $environment = new ProductionEnvironment($this->paypal_client_id, $this->paypal_secret); + else + $environment = new SandboxEnvironment($this->paypal_client_id, $this->paypal_secret); + $client = new PayPalHttpClient($environment); try {