Changeset 2744264
- Timestamp:
- 06/17/2022 06:13:39 PM (4 years ago)
- Location:
- drip-payments/trunk
- Files:
-
- 3 edited
-
drip-payments.php (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
-
src/DripUtils.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
drip-payments/trunk/drip-payments.php
r2736503 r2744264 4 4 * Description: Forneça a Drip como opção de pagamento para pedidos do WooCommerce. 5 5 * Author: Drip 6 * Version: 1.2. 16 * Version: 1.2.2 7 7 */ 8 8 … … 353 353 } 354 354 355 $headers = $this->getRequestHeaders(); 356 357 $accept_json = str_contains($headers["Accept"], "json"); 358 355 359 if ($checkout->status === 'OK') { 356 360 self::log("Order #{$order_id} approved. (Drip Checkout #{$checkout_id})."); … … 362 366 $order->save(); 363 367 } 368 if ($accept_json) { 369 exit; 370 } 364 371 365 372 if (wp_redirect($this->get_return_url($order))) { … … 373 380 $order->update_status('failed'); 374 381 } 382 if ($accept_json) { 383 exit; 384 } 375 385 376 386 wc_add_notice('Sua requisição de pagamento foi rejeitada pela Drip. Por favor tente com outro método de pagamento.', 'error'); … … 381 391 self::log("Order #{$order_id} checkout not completed. (Drip Checkout #{$checkout_id})."); 382 392 393 if ($accept_json) { 394 exit; 395 } 396 383 397 if (wp_redirect($order->get_checkout_payment_url())) { 384 398 exit; … … 395 409 } 396 410 397 $checkout_id_on_order = get_post_meta($order-> ID, 'drip_paid_checkout_id', true);411 $checkout_id_on_order = get_post_meta($order->get_id(), 'drip_paid_checkout_id', true); 398 412 399 413 if (empty($checkout_id_on_order)) { … … 533 547 return self::$instance; 534 548 } 549 550 private function getRequestHeaders() 551 { 552 $headers = array(); 553 foreach ($_SERVER as $key => $value) { 554 if (substr($key, 0, 5) <> 'HTTP_') { 555 continue; 556 } 557 $header = str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5))))); 558 $headers[$header] = $value; 559 } 560 return $headers; 561 } 535 562 } 536 563 -
drip-payments/trunk/readme.txt
r2736503 r2744264 5 5 Tested up to: 6.0 6 6 Requires PHP: 7.0 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
drip-payments/trunk/src/DripUtils.php
r2736503 r2744264 11 11 const DRIP_PAYMENTS_BASE_URI_PRODUCTION = 'https://drip-be.usedrip.com.br/api/'; 12 12 13 const DRIP_PAYMENTS_ACTUAL_PLUGIN_VERSION = '1.2. 1';13 const DRIP_PAYMENTS_ACTUAL_PLUGIN_VERSION = '1.2.2'; 14 14 } 15 15
Note: See TracChangeset
for help on using the changeset viewer.