Changeset 2800136
- Timestamp:
- 10/17/2022 06:12:11 PM (3 years ago)
- Location:
- paylink/trunk
- Files:
-
- 2 edited
-
paylink.php (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
paylink/trunk/paylink.php
r2754238 r2800136 8 8 Plugin Name: Paylink 9 9 Description: Use this woocommerce payment gateway plugin to enable clients of your store to pay using Paylink gateway. 10 Version: 1. 0910 Version: 1.10 11 11 Author: Paylink Co 12 12 text-domain: paylink … … 42 42 private $_token_auth; 43 43 44 private function postError($error, $calledUrl, $method) 45 { 46 try { 47 $apiId = $this->get_option('app_id'); 48 $apiKey = $this->get_option('secret_key'); 49 50 $post_parameter = [ 51 'error' => $error, 52 'calledUrl' => $calledUrl, 53 'apiId' => $apiId, 54 'apiKey' => $apiKey, 55 'method' => $method 56 ]; 57 wp_safe_remote_post('https://paylinkapp.paylink.sa/careapi/wp_log_error', [ 58 'headers' => [ 59 'Content-Type' => 'application/json', 60 ], 61 'body' => wp_json_encode($post_parameter), 62 ]); 63 } catch (Exception $ex) { 64 } 65 } 66 44 67 /** 45 68 * Constructor for the gateway. … … 164 187 update_post_meta($order_id, 'login_token', $this->_token_auth); 165 188 return $this->createPaylinkInvoiceUrl($this->_token_auth, $order_id); 166 } 167 return false; 189 } else { 190 $this->postError(print_r($this->_token_auth, true), 'n/a', 'generate_paylink_url'); 191 return false; 192 } 168 193 } 169 194 … … 185 210 $note = ''; 186 211 $lang = 'ar'; 187 $customerName = $order-> get_billing_first_name() . ' ' . $order->get_billing_last_name();212 $customerName = $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(); 188 213 $customerPhone = $order->get_billing_phone(); 189 214 … … 217 242 } catch (Exception $exception) { 218 243 error_log(print_r($exception, true)); 244 $this->postError(print_r($exception, true), $this->_addInvoiceUrl, 'createPaylinkInvoiceUrl'); 219 245 return false; 220 246 } … … 241 267 'body' => wp_json_encode($login_parameter), 242 268 ]); 269 $this->postError('logged in', $this->_loginUrl, 'login'); 243 270 return json_decode($login_response['body'])->id_token; 244 271 } catch (Exception $ex) { 245 272 error_log(print_r($ex, true)); 273 $this->postError(print_r($ex, true), $this->_loginUrl, 'login'); 246 274 return false; 247 275 } -
paylink/trunk/readme.txt
r2754238 r2800136 2 2 Contributors: Paylink 3 3 Requires at least: 5.5.1 4 Tested up to: 6.0 5 Stable tag: 1. 094 Tested up to: 6.0.2 5 Stable tag: 1.10 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.