Changeset 2807600
- Timestamp:
- 10/31/2022 04:46:06 AM (3 years ago)
- Location:
- payflex-payment-gateway
- Files:
-
- 10 added
- 2 edited
-
tags/2.4.0 (added)
-
tags/2.4.0/Checkout.png (added)
-
tags/2.4.0/PIE-CHART-01.png (added)
-
tags/2.4.0/PIE-CHART-02.png (added)
-
tags/2.4.0/PIE-CHART-03.png (added)
-
tags/2.4.0/PIE-CHART-04.png (added)
-
tags/2.4.0/config (added)
-
tags/2.4.0/config/config.php (added)
-
tags/2.4.0/partpay.php (added)
-
tags/2.4.0/readme.txt (added)
-
trunk/partpay.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
payflex-payment-gateway/trunk/partpay.php
r2797962 r2807600 3 3 Plugin Name: Payflex Payment Gateway 4 4 Description: Use Payflex as a credit card processor for WooCommerce. 5 Version: 2. 3.95 Version: 2.4.0 6 6 Author: Payflex 7 7 */ … … 585 585 $merchantRefe = $order->get_order_number(); 586 586 } 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 = []; 610 609 foreach ($items as $item) 611 610 { 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); 626 621 627 622 $APIURL = $this->orderurl . '/productSelect'; … … 633 628 'Authorization' => 'Bearer ' . $access_token 634 629 ) , 635 'body' => json_encode($OrderBody ) ,630 'body' => json_encode($OrderBodyObj) , 636 631 'timeout' => 30 637 632 ); -
payflex-payment-gateway/trunk/readme.txt
r2797943 r2807600 5 5 Tested up to: 6.0 6 6 Requires PHP: 7.0 7 Stable tag: 2. 3.97 Stable tag: 2.4.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 74 74 = 2.3.9 = 75 75 * 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.