Changeset 2666098
- Timestamp:
- 01/26/2022 04:18:40 PM (4 years ago)
- Location:
- iwd-checkout-connector/trunk
- Files:
-
- 2 added
- 7 edited
-
includes/api/class-iwd-con-paypal-checkout.php (modified) (1 diff)
-
includes/api/class-iwd-order-update.php (modified) (1 diff)
-
includes/checkout/class-iwd-con-buttons.php (modified) (2 diffs)
-
includes/checkout/class-iwd-con-iframe.php (modified) (1 diff)
-
iwd-checkout-connector.php (modified) (2 diffs)
-
public/js/payment/braintree (added)
-
public/js/payment/braintree/iwd_braintree_apple_pay.js (added)
-
public/js/payment/iwd_paypal_button.js (modified) (3 diffs)
-
public/templates/iwd-checkout-saas.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
iwd-checkout-connector/trunk/includes/api/class-iwd-con-paypal-checkout.php
r2540679 r2666098 43 43 } 44 44 45 $new_session_obj = new WC_Session_Handler(); 46 $session_data = $new_session_obj->get_session( $api->quote_id ); 45 $this->init(); 47 46 48 $data['delivery_methods'] = IWD_CONNECTOR()->shipping->getShippingMethods( $session_data ); 49 $data['chosen_delivery_method'] = IWD_CONNECTOR()->shipping->getSelectedShipping( $session_data ); 50 $data['addresses'] = IWD_CONNECTOR()->customer->getAddresses( $session_data ); 51 $data['cart_items'] = IWD_CONNECTOR()->cart->getCartItems( $session_data ); 52 $data['cart'] = IWD_CONNECTOR()->cart->getCart( $session_data ); 47 if ( ! empty( (array) $api->data ) ) { 48 $this->setSessionData( $api->quote_id ); 49 $session_data = $this->getSessionData( $api->quote_id ); 50 $customer = unserialize( $session_data['customer'] ); 51 IWD_CONNECTOR()->customer->saveAddresses( $api->data, $customer['id'] ); 52 $updated_session = $this->updateSessionData( $api->quote_id ); 53 } else { 54 $updated_session = $this->getSessionData( $api->quote_id ); 55 } 56 57 $data['delivery_methods'] = IWD_CONNECTOR()->shipping->getShippingMethods( $updated_session ); 58 $data['chosen_delivery_method'] = IWD_CONNECTOR()->shipping->getSelectedShipping( $updated_session ); 59 $data['addresses'] = IWD_CONNECTOR()->customer->getAddresses( $updated_session ); 60 $data['cart_items'] = IWD_CONNECTOR()->cart->getCartItems( $updated_session ); 61 $data['cart'] = IWD_CONNECTOR()->cart->getCart( $updated_session ); 53 62 54 63 return $data; -
iwd-checkout-connector/trunk/includes/api/class-iwd-order-update.php
r2629644 r2666098 68 68 $order->add_order_note( sprintf( __( 'Transaction %1$s has been voided in PayPal.' ), $transaction->id ) ); 69 69 $order->update_status( 'cancelled' ); 70 } 70 } elseif ( 'hold' == $paymentAction ) { 71 if ( (property_exists($transaction, 'dispute')) ) { 72 $order->add_order_note('The Order was put on Hold because the Dispute with ID: '.$transaction->dispute->id 73 .' has been opened. Please access your Braintree account for more information.'); 74 } else { 75 $order->add_order_note('Order was put on Hold.'); 76 } 77 $order->update_status( 'on-hold' ); 78 } 71 79 $order->save(); 72 80 -
iwd-checkout-connector/trunk/includes/checkout/class-iwd-con-buttons.php
r2629644 r2666098 58 58 wp_enqueue_style('iwd-buttons-css-apple-pay', IWD_CONNECTOR_URL . 'public/css/iwd_apple_pay_buttons.css', array(), IWD_CONNECTOR_VERSION); 59 59 wp_enqueue_script('iwd-buttons-subscr', IWD_CONNECTOR_URL . 'public/js/payment/iwd_paypal_subscription.js', array('jquery', 'jquery-blockui',), IWD_CONNECTOR_VERSION); 60 } 61 60 $this->add_braintree_scripts(); 61 } 62 63 public function add_braintree_scripts() 64 { 65 wp_enqueue_script('braintree', 'https://js.braintreegateway.com/web/3.85.1/js/client.min.js', false); 66 wp_enqueue_script('applepay', 'https://js.braintreegateway.com/web/3.85.1/js/apple-pay.min.js', false); 67 wp_enqueue_script('iwdApplePayDataCol', 'https://js.braintreegateway.com/web/3.85.1/js/data-collector.min.js', false); 68 wp_enqueue_script('iwd-braintree-apple-pay', IWD_CONNECTOR_URL . 'public/js/payment/braintree/iwd_braintree_apple_pay.js', array('jquery'), IWD_CONNECTOR_VERSION); 69 } 62 70 /** 63 71 * Buttons for cart and mini cart … … 100 108 IWD.PayPal.params = { 101 109 'containerId': '<?php echo esc_html($containerId); ?>', 102 'checkoutPagePath': '<?php echo esc_html(self::CHECKOUT_PAGE_PATH); ?>',110 'checkoutPagePath': '<?php echo home_url(self::CHECKOUT_PAGE_PATH); ?>', 103 111 'grandTotalAmount': "<?php echo esc_html(WC()->cart->get_total('edit')); ?>", 104 112 'btnShape': '<?php echo esc_html(get_option('btn_shape')); ?>', -
iwd-checkout-connector/trunk/includes/checkout/class-iwd-con-iframe.php
r2540679 r2666098 24 24 } 25 25 26 if ( isset( $_GET['paypal_funding_source'] ) && ! empty( $_GET['paypal_funding_source'] ) ) { 27 $params['paypal_funding_source'] = sanitize_text_field( $_GET['paypal_funding_source'] ); 28 } 29 26 30 return IWD_CONNECTOR()->helper->getFrameUrl() . '?' . http_build_query( $params ); 27 31 } -
iwd-checkout-connector/trunk/iwd-checkout-connector.php
r2646929 r2666098 5 5 * Description: Checkout Suite Connector 6 6 * Author: Dominate 7 * Version: 1.0. 47 * Version: 1.0.5 8 8 * Author URI: https://www.dominate.co/ 9 9 * WC requires at least: 2.6.0 … … 30 30 * Define plugin minimums and constants. 31 31 */ 32 define( 'IWD_CONNECTOR_VERSION', '1.0. 4' );32 define( 'IWD_CONNECTOR_VERSION', '1.0.5' ); 33 33 define( 'IWD_CONNECTOR_FILE', __FILE__ ); 34 34 define( 'IWD_CONNECTOR_PATH', plugin_dir_path( __FILE__ ) ); -
iwd-checkout-connector/trunk/public/js/payment/iwd_paypal_button.js
r2586060 r2666098 16 16 init: function() { 17 17 if (window.paypal) { 18 let paypal = window.paypal; 18 let paypal = window.paypal, 19 clickedFundingSource = 'paypal'; 19 20 20 21 paypal.Buttons( … … 29 30 fundingicons: false, 30 31 tagline: false, 32 }, 33 34 onClick: function(data) { 35 clickedFundingSource = data.fundingSource; 31 36 }, 32 37 … … 44 49 45 50 onApprove: function(data) { 46 window.location.href = '/' + IWD.PayPal.params.checkoutPagePath + '?paypal_order_id=' + data.orderID; 51 window.location.href = IWD.PayPal.params.checkoutPagePath 52 + '?paypal_order_id=' + data.orderID + '&paypal_funding_source=' + clickedFundingSource; 47 53 } 48 54 } -
iwd-checkout-connector/trunk/public/templates/iwd-checkout-saas.php
r2629644 r2666098 8 8 // Remove paypal_order_id param from url 9 9 history.replaceState && history.replaceState( 10 null, '', location.pathname + location.search.replace(/[\?&]paypal_order_id=[^&]+/, '').replace(/^&/, '?') 10 null, '', location.pathname 11 + location.search 12 .replace(/[\?&]paypal_order_id=[^&]+/, '') 13 .replace(/[\?&]paypal_funding_source=[^&]+/, '') 14 .replace(/^&/, '?') 11 15 ); 12 16
Note: See TracChangeset
for help on using the changeset viewer.