Plugin Directory

Changeset 2807600


Ignore:
Timestamp:
10/31/2022 04:46:06 AM (3 years ago)
Author:
tomlister
Message:

plugin tested upto wordpress6.1

Location:
payflex-payment-gateway
Files:
10 added
2 edited

Legend:

Unmodified
Added
Removed
  • payflex-payment-gateway/trunk/partpay.php

    r2797962 r2807600  
    33Plugin Name: Payflex Payment Gateway
    44Description: Use Payflex as a credit card processor for WooCommerce.
    5 Version: 2.3.9
     5Version: 2.4.0
    66Author: Payflex
    77*/
     
    585585                    $merchantRefe = $order->get_order_number();
    586586                }
    587                 $OrderBodyString = '{
    588                 "amount": ' . number_format($order->get_total() , 2, '.', '') . ',
    589                 "consumer": {
    590                 "phoneNumber":  "' . $order->billing_phone . '",
    591                     "givenNames":  "' . $order->billing_first_name . '",
    592                     "surname":  "' . $order->billing_last_name . '",
    593                     "email":  "' . $order->billing_email . '"
    594                 },
    595                 "billing": {
    596                     "addressLine1":"' . $order->billing_address_1 . '",
    597                     "addressLine2": "' . $order->billing_address_2 . '",
    598                     "suburb": "' . $order->billing_city . '",
    599                     "postcode": "' . $order->billing_postcode . '"
    600                 },
    601                 "shipping": {
    602                     "addressLine1": "' . $order->shipping_address_1 . '",
    603                     "addressLine2": " ' . $order->shipping_address_2 . '",
    604                     "suburb":  "' . $order->shipping_city . '",
    605                     "postcode": "' . $order->shipping_postcode . '"
    606                 },
    607                 "description": "string",
    608                 "items": [';
    609 
     587               
     588
     589                $OrderBodyObj = new stdClass;
     590                $OrderBodyObj->amount = number_format($order->get_total() , 2, '.', '');
     591                $OrderBodyObj->consumer = new stdClass;
     592                $OrderBodyObj->consumer->phoneNumber = (string)$order->billing_phone;
     593                $OrderBodyObj->consumer->givenNames = (string)$order->billing_first_name;
     594                $OrderBodyObj->consumer->surname = (string)$order->billing_last_name;
     595                $OrderBodyObj->consumer->email = (string)$order->billing_email;
     596                $OrderBodyObj->billing = new stdClass;
     597                $OrderBodyObj->billing->addressLine1 = (string)$order->billing_address_1;
     598                $OrderBodyObj->billing->addressLine2 = (string)$order->billing_address_2;
     599                $OrderBodyObj->billing->suburb = (string)$order->billing_city;
     600                $OrderBodyObj->billing->postcode = (string)$order->billing_postcode;
     601                $OrderBodyObj->shipping = new stdClass;
     602                $OrderBodyObj->shipping->addressLine1 = (string)$order->shipping_address_1;
     603                $OrderBodyObj->shipping->addressLine2 = (string)$order->shipping_address_2;
     604                $OrderBodyObj->shipping->suburb =(string) $order->shipping_city;
     605                $OrderBodyObj->shipping->postcode = (string)$order->shipping_postcode;
     606                $OrderBodyObj->description = 'string';
     607                $OrderBodyObj->items = [];
     608                $itms = [];
    610609                foreach ($items as $item)
    611610                {
    612                     $OrderBodyString .= $item[0];
    613                 }
    614 
    615                 $OrderBodyString .= '],
    616                 "merchant": {
    617                     "redirectConfirmUrl": "' . $this->get_return_url($order) . '&order_id=' . $order_id . '&status=confirmed&wc-api=WC_Gateway_PartPay",
    618                     "redirectCancelUrl": "' . $this->get_return_url($order) . '&status=cancelled"
    619                 },
    620                 "merchantReference": "' . $merchantRefe . '",
    621                 "taxAmount": ' . $order->get_total_tax() . ',
    622                 "shippingAmount":' . $shipping_total . '
    623                 }';
    624 
    625                 $OrderBody = json_decode($OrderBodyString);
     611                    array_push($itms,json_decode($item[0]));
     612                }
     613                $OrderBodyObj->items = $itms;
     614                $OrderBodyObj->merchant = new stdClass;
     615                $OrderBodyObj->merchant->redirectConfirmUrl = (string)$this->get_return_url($order) . '&order_id=' . $order_id . '&status=confirmed&wc-api=WC_Gateway_PartPay';
     616                $OrderBodyObj->merchant->redirectCancelUrl = (string)$this->get_return_url($order) . '&status=cancelled';
     617                $OrderBodyObj->merchantReference = (string)$merchantRefe;
     618                $OrderBodyObj->taxAmount = $order->get_total_tax();
     619                $OrderBodyObj->shippingAmount = $shipping_total;
     620                // $OrderBody = json_decode($OrderBodyString);
    626621
    627622                $APIURL = $this->orderurl . '/productSelect';
     
    633628                        'Authorization' => 'Bearer ' . $access_token
    634629                    ) ,
    635                     'body' => json_encode($OrderBody) ,
     630                    'body' => json_encode($OrderBodyObj) ,
    636631                    'timeout' => 30
    637632                );
  • payflex-payment-gateway/trunk/readme.txt

    r2797943 r2807600  
    55Tested up to: 6.0
    66Requires PHP: 7.0
    7 Stable tag: 2.3.9
     7Stable tag: 2.4.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7474= 2.3.9 =
    7575     * added support to woocommerce-sequential-order-numbers
     76= 2.4.0 =
     77     * Updated api request payload for payflex backend
     78     * Plugin tested upto wordpress 6.1
Note: See TracChangeset for help on using the changeset viewer.