Changeset 2907185
- Timestamp:
- 05/02/2023 10:30:25 PM (3 years ago)
- Location:
- gratifypay/trunk
- Files:
-
- 5 edited
-
class/wc-gratify-pay-admin.php (modified) (1 diff)
-
class/wc-gratify-pay-gateway.php (modified) (1 diff)
-
gratify-BNPL.php (modified) (1 diff)
-
vendor/gratifypay/plugin-php-sdk/composer.json (modified) (1 diff)
-
vendor/gratifypay/plugin-php-sdk/src/Client.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gratifypay/trunk/class/wc-gratify-pay-admin.php
r2870328 r2907185 48 48 wp_enqueue_script('gratify-pay_admin_js', plugins_url( 'assets/js/gratifypay-admin.js', dirname(__FILE__)), array('jquery')); 49 49 wp_enqueue_style('gratify-pay_admin_css', plugins_url( 'assets/css/gratifypay-admin.css', dirname(__FILE__)) , array(), Gratify_BNPL::$version); 50 wp_enqueue_style('gp', "https://assets.gratifypay.com/plugin/v-latest/styles.css", array(), $plugin_version );50 wp_enqueue_style('gp', "https://assets.gratifypay.com/plugin/v-latest/styles.css", array(), Gratify_BNPL::$version ); 51 51 } 52 52 } -
gratifypay/trunk/class/wc-gratify-pay-gateway.php
r2870328 r2907185 1370 1370 */ 1371 1371 private function api_is_ok() { 1372 return true; 1372 // HTTP get call to /health/fast 1373 // If response is 200, return true 1374 1375 $response = $this->getGratifyClient()->checkApiHealth(); 1376 self::log( 'API Health Check: ' . $response); 1377 // if status code is 200, return true 1378 if($response == 200) { 1379 return true; 1380 } 1381 return false; 1373 1382 } 1374 1383 -
gratifypay/trunk/gratify-BNPL.php
r2870328 r2907185 12 12 * Plugin URI: https://docs.gratifypay.com/docs/woocommerce 13 13 * Description: GratifyPay's Woocommerce plugin for Gratify BNPL payment gateway 14 * Version: 1.3. 214 * Version: 1.3.3 15 15 * Requires PHP: 7.3 16 16 * Author: Gratify Pay -
gratifypay/trunk/vendor/gratifypay/plugin-php-sdk/composer.json
r2813807 r2907185 3 3 "description": "Gratify Pay PHP SDK", 4 4 "license": "AFL-3.0", 5 "version": "1. 2.0 ",5 "version": "1.3.0 ", 6 6 "type": "library", 7 7 "require": { -
gratifypay/trunk/vendor/gratifypay/plugin-php-sdk/src/Client.php
r2774436 r2907185 40 40 41 41 /** 42 * Check the connection 43 * 44 * @return bool success connection or not 45 */ 46 public function checkConnection(): bool { 47 try { 48 $result = $this->getMerchant(); 49 } 50 catch (\Exception $e) { 51 return false; 52 } 53 54 if (!empty($result)) { 55 return true; 56 } 57 58 return false; 59 } 60 61 /** 62 * Check the API health page 63 * 64 * @param bool $fast 65 * @param string $merchantId 66 * @return int HTTP status of 200 OK or 500 SERVER ERROR 67 */ 68 public function checkApiHealth(bool $fast = true, string $merchantId = null): int 69 { 70 $return = 200; 71 try { 72 if(empty($merchantId)) { 73 $merchantId = $this->merchantPublicId; 74 } 75 $params = ['merchant_id' => $merchantId]; 76 $result = $this->request('GET', '/health' . ($fast ? '/fast' : '') . $this->formatParams($params)); 77 } 78 catch (\Exception $e) { 79 $return = 500; 80 } 81 82 if (empty($result)) { 83 $return = 500; 84 } 85 86 return $return; 87 } 88 89 /** 42 90 * @return Merchant 43 91 * @throws \Exception … … 146 194 } 147 195 196 /** 197 * Return $params as a Url formated parameter string 198 * 199 * @param array $params 200 * @return string 201 */ 202 private function formatParams(array $params = []) 203 { 204 return !empty($params) ? '?' . http_build_query($params) : ''; 205 } 148 206 149 207 }
Note: See TracChangeset
for help on using the changeset viewer.