Plugin Directory

Changeset 2888142


Ignore:
Timestamp:
03/28/2023 08:15:34 AM (3 years ago)
Author:
chaifinport
Message:

Updating checkout image, making title/description editable, payment obj update description & discount rounding to 2 decimal places

Location:
chaiport-payment/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chaiport-payment/trunk/chaiportGateway.php

    r2884049 r2888142  
    44 * Plugin URI:        https://www.docs.portone.cloud/plugins_and_sdks/woocommerce-plugin.html
    55 * Description:       Single Payment
    6  * Version:           2.0.4
     6 * Version:           2.0.5
    77 * Requires at least: 5.6
    88 * Author:            PortOne
     
    101101        $publicKey = $options["publishable_key"];
    102102        $privateKey = $options["private_key"];
    103         $chaiPortId = $publicKey . "-MERCHANT-" . $orderId;
     103        $chaiPortId = $publicKey . "-" . $orderId;
    104104        $orderStatusType = $options["payment_process_action"];
    105105        $getOrderStatusUrl = $chaiApiUrl . $chaiPortId;
     
    560560                    'description' => 'This is the title which the user sees during checkout.',
    561561                    'default' => 'Credit Card/Debit Card/E-Wallets',
    562                     'desc_tip' => false,
    563                     'custom_attributes' => array('readonly' => 'readonly')
     562                    'desc_tip' => false
    564563                ),
    565564                'description' => array(
     
    567566                    'type' => 'textarea',
    568567                    'description' => 'This is the description which the user sees during checkout.',
    569                     'default' => 'Pay with your Credit Card/Debit Card/E-Wallets via PortOne Payment Service',
    570                     'custom_attributes' => array('readonly' => 'readonly')
     568                    'default' => 'Pay with your Credit Card/Debit Card/E-Wallets via PortOne Payment Service'
    571569                ),
    572570                'testmode' => array(
     
    692690            $environment = $this->testmode ? "sandbox" : "live";
    693691
    694             $merchantOrder = $publicKey . "-MERCHANT-" . $order->get_id();
     692            $merchantOrder = $publicKey . "-" . $order->get_id();
    695693
    696694            $order->add_order_note("PortOne OrderId: $merchantOrder");
     
    753751                "logo" => $image[0],
    754752                "back_url" => get_bloginfo('url') . "/checkout/",
    755                 "shipping_charges" => (float)$order->get_shipping_total(),
    756                 "promo_discount" => $discount_total
     753                "shipping_charges" => round((float)$order->get_shipping_total(), 2),
     754                "promo_discount" => round((float)$discount_total, 2)
    757755            );
    758756
    759757            $this->console_log("Environment is: " . $environment, '');
    760             if ($amount != ((float)$order->get_shipping_total() + $item_total - $discount_total)) {
     758            if ($amount != ((float)$order->get_shipping_total() + $item_total - round((float)$discount_total, 2))) {
    761759                $this->console_log("Not sending item details", '');
    762760                $isItemsAvailable = false;
     
    772770                $this->console_log("Items total is: " . $item_total, '');
    773771                $this->console_log("Shipping amount is: " . (float)$order->get_shipping_total(), '');
    774                 $this->console_log("Discount is: " . $discount_total, '');
     772                $this->console_log("Discount is: " . round((float)$discount_total, 2), '');
    775773            }
    776774
     
    811809                    "amount" => (float)$amount,
    812810                    "currency" => "$currencyCode",
    813                     "description" => "Your order-id is: $merchantOrder",
     811                    "description" => "Order Id: " . $order->get_id(),
    814812                    "order_details" => $itemsArray,
    815813                    "billing_details" => $billingShippingArray[0],
     
    834832                    "amount" => (float)$amount,
    835833                    "currency" => "$currencyCode",
    836                     "description" => "Your order-id is: $merchantOrder",
     834                    "description" => "Order Id: " . $order->get_id(),
    837835                    "billing_details" => $billingShippingArray[0],
    838836                    "shipping_details" => $billingShippingArray[1],
     
    902900            global $woocommerce;
    903901            $order = wc_get_order($order_id);
    904             $woocommerce->session->set(self::SESSION_KEY, get_bloginfo('name') . "-MERCHANT-" . $order_id);
     902            $woocommerce->session->set(self::SESSION_KEY, get_bloginfo('name') . "-" . $order_id);
    905903            $woocommerce->cart->empty_cart();
    906904
  • chaiport-payment/trunk/readme.txt

    r2884049 r2888142  
    44Requires at least: 3.9.2
    55Tested up to: 6.1.1
    6 Stable tag: 2.0.4
     6Stable tag: 2.0.5
    77Requires PHP: 5.6
    88License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.