Changeset 3383633
- Timestamp:
- 10/23/2025 08:47:49 PM (4 months ago)
- Location:
- paybyrd/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (2 diffs)
-
languages/paybyrd-woocommerce-en_US.po (modified) (1 diff)
-
languages/paybyrd-woocommerce-pt_PT.po (modified) (1 diff)
-
languages/paybyrd-woocommerce.pot (modified) (1 diff)
-
paybyrd-payment.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
paybyrd/trunk/README.txt
r3047898 r3383633 5 5 Requires at least: 4.7 6 6 Tested up to: 5.8 7 Stable tag: 2. 19.07 Stable tag: 2.20.0 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 60 60 * Also possible to use our webhook to change order statuses even if user closes the tab after a payment. 61 61 62 = 2. 19.0 =62 = 2.20.0 = 63 63 * Upgraded to be fully compatible with Paybyrd's last Webhook design. -
paybyrd/trunk/languages/paybyrd-woocommerce-en_US.po
r3042194 r3383633 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: Paybyrd Payment Plugin 2. 19.0\n"3 "Project-Id-Version: Paybyrd Payment Plugin 2.20.0\n" 4 4 "MIME-Version: 1.0\n" 5 5 "Content-Type: text/plain; charset=UTF-8\n" -
paybyrd/trunk/languages/paybyrd-woocommerce-pt_PT.po
r3042194 r3383633 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: Paybyrd Payment Plugin 2. 19.0\n"3 "Project-Id-Version: Paybyrd Payment Plugin 2.20.0\n" 4 4 "MIME-Version: 1.0\n" 5 5 "Content-Type: text/plain; charset=UTF-8\n" -
paybyrd/trunk/languages/paybyrd-woocommerce.pot
r3042194 r3383633 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: Paybyrd Payment Plugin 2. 19.0\n"3 "Project-Id-Version: Paybyrd Payment Plugin 2.20.0\n" 4 4 "MIME-Version: 1.0\n" 5 5 "Content-Type: text/plain; charset=utf-8\n" -
paybyrd/trunk/paybyrd-payment.php
r3042194 r3383633 5 5 * Author: Paybyrd 6 6 * Author URI: https://www.paybyrd.com 7 * Version: 2. 19.07 * Version: 2.20.0 8 8 * Domain Path: /languages 9 9 */ … … 53 53 $this->recreate_hook = $this->get_option('recreate_hook'); 54 54 $this->hook_id = $this->get_option('hook_id'); 55 $this->hook_key = $this->get_option('hook_key'); 55 56 $this->hook_test_id = $this->get_option('hook_test_id'); 57 $this->hook_test_key = $this->get_option('hook_test_key'); 56 58 $this->hf_background_color = $this->get_option('hf_background_color'); 57 59 $this->hf_form_background_color = $this->get_option('hf_form_background_color'); … … 152 154 'url' => $baseURL.'paybyrd/v1/webhook', 153 155 'credentialType' => 'api-key', 154 'apiKey' => $this->api_key,155 156 'events' => [ 156 157 'order.created', … … 180 181 $response = wp_remote_retrieve_body($response); 181 182 $response = json_decode($response, true); 182 $data = $response['data']; 183 184 if ($data && $data['id']) { 185 $this->update_option('hook_id', $data['id']); 186 183 $hookId = $response['data']['id'] ?? null; 184 $hookKey = $response['data']['credential']['apiKey'] ?? null; 185 186 if ($hookId && $hookKey) { 187 $this->update_option('hook_id', $hookId); 188 $this->update_option('hook_key', $hookKey); 187 189 $prod_success = true; 188 190 } … … 196 198 'url' => $baseURL.'paybyrd/v1/webhook', 197 199 'credentialType' => 'api-key', 198 'apiKey' => $this->test_api_key,199 200 'events' => [ 200 201 'order.created', … … 224 225 $response = wp_remote_retrieve_body($response); 225 226 $response = json_decode($response, true); 226 $data = $response['data']; 227 228 if ($data && $data['id']) { 229 $this->update_option('hook_test_id', $data['id']); 230 227 $hookId = $response['data']['id'] ?? null; 228 $hookKey = $response['data']['credential']['apiKey'] ?? null; 229 230 if ($hookId && $hookKey) { 231 $this->update_option('hook_test_id', $hookId); 232 $this->update_option('hook_test_key', $hookKey); 231 233 $test_success = true; 232 234 } … … 306 308 'custom_attributes' => ['readonly' => 'readonly'], 307 309 ], 310 'hook_key' => [ 311 'title' => __('Webhook Key', 'paybyrd-woocommerce'), 312 'type' => 'password', 313 'custom_attributes' => ['readonly' => 'readonly'], 314 ], 308 315 'hook_test_id' => [ 309 316 'title' => __('Webhook Test ID', 'paybyrd-woocommerce'), 310 317 'type' => 'text', 318 'custom_attributes' => ['readonly' => 'readonly'], 319 ], 320 'hook_test_key' => [ 321 'title' => __('Webhook Test Key', 'paybyrd-woocommerce'), 322 'type' => 'password', 311 323 'custom_attributes' => ['readonly' => 'readonly'], 312 324 ], … … 739 751 740 752 // GET Webhook Info and Validate Auth 741 $headers = getallheaders(); 742 $headerAuth = $headers['X-Api-Key']; 743 744 if ($headerAuth !== $paybyrd->test_api_key && $headerAuth !== $paybyrd->api_key) { 745 echo json_encode(["code" => 401, "message" => "Not authorized"]); 753 $headers = array_change_key_case(getallheaders(), CASE_LOWER); 754 $headerAuth = $headers['x-api-key'] ?? null; 755 756 if ( 757 $headerAuth !== $paybyrd->test_api_key && 758 $headerAuth !== $paybyrd->api_key && 759 $headerAuth !== $paybyrd->hook_key && 760 $headerAuth !== $paybyrd->hook_test_key 761 ) { 762 echo json_encode(["code" => 401, "message" => $headers]); 746 763 http_response_code(401); 747 764 exit();
Note: See TracChangeset
for help on using the changeset viewer.