Changeset 2879753
- Timestamp:
- 03/14/2023 12:06:09 PM (3 years ago)
- Location:
- chaiport-payment/trunk
- Files:
-
- 2 edited
-
chaiportGateway.php (modified) (10 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
chaiport-payment/trunk/chaiportGateway.php
r2860347 r2879753 4 4 * Plugin URI: https://www.docs.portone.cloud/plugins_and_sdks/woocommerce-plugin.html 5 5 * Description: Single Payment 6 * Version: 2.0. 26 * Version: 2.0.3 7 7 * Requires at least: 5.6 8 8 * Author: PortOne … … 111 111 "sub" => $publicKey, 112 112 "iat" => time(), 113 "exp" => time() + 100113 "exp" => time() + 500 114 114 ); 115 115 $payload = json_encode($encodeData); … … 256 256 */ 257 257 add_action('rest_api_init', function () { 258 register_rest_route(' chaiport/v1', 'redirect', array(258 register_rest_route('portone/', 'redirect', array( 259 259 'methods' => WP_REST_Server::READABLE, 260 260 'permission_callback' => '__return_true', … … 292 292 'callback' => 'chaiport_order_manage_webhook' 293 293 )); 294 register_rest_route('portone/', 'webhook', array( 295 'methods' => WP_REST_Server::CREATABLE, 296 'permission_callback' => '__return_true', 297 'callback' => 'chaiport_order_manage_webhook' 298 )); 294 299 }); 295 300 … … 471 476 472 477 $websiteUrl = get_bloginfo('url'); 473 $webhookUrl = $websiteUrl . "/wp-json/ chaiport/v1/webhook";478 $webhookUrl = $websiteUrl . "/wp-json/portone/webhook"; 474 479 475 480 $this->id = 'chaiport'; //payment gateway plugin ID … … 540 545 541 546 $websiteUrl = get_bloginfo('url'); 542 $webhookUrl = $websiteUrl . "/wp-json/ chaiport/v1/webhook";547 $webhookUrl = $websiteUrl . "/wp-json/portone/webhook"; 543 548 544 549 $this->form_fields = array( … … 692 697 693 698 $websiteUrl = get_bloginfo('url'); 694 $red = $websiteUrl . "/wp-json/ chaiport/v1/redirect";699 $red = $websiteUrl . "/wp-json/portone/redirect"; 695 700 696 701 $amount = $order->get_total(); … … 711 716 // Get and Loop Over Order Items 712 717 $discount_total = 0; 718 $item_total = 0; 713 719 foreach ($order->get_items() as $item_id => $item) { 714 720 $order_item_id = $item->get_id(); … … 728 734 $discount_total += $discount; 729 735 } 736 $item_total += ((float)$product->get_regular_price()*$item->get_quantity()); 730 737 array_push($itemsArray, $temp); 731 738 } … … 749 756 "promo_discount" => $discount_total 750 757 ); 758 759 $this->console_log("Environment is: " . $environment, ''); 760 if ($amount != ((float)$order->get_shipping_total() + $item_total - $discount_total)) { 761 $this->console_log("Not sending item details", ''); 762 $isItemsAvailable = false; 763 } else { 764 $this->console_log("Total amount is: " . $amount, ''); 765 $this->console_log("Items total is: " . $item_total, ''); 766 $this->console_log("Shipping amount is: " . (float)$order->get_shipping_total(), ''); 767 $this->console_log("Discount is: " . $discount_total, ''); 768 } 751 769 752 770 $countryCode = $order->get_billing_country(); -
chaiport-payment/trunk/readme.txt
r2860347 r2879753 4 4 Requires at least: 3.9.2 5 5 Tested up to: 6.1.1 6 Stable tag: 2.0. 26 Stable tag: 2.0.3 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.