Changeset 2986471
- Timestamp:
- 10/31/2023 12:37:39 AM (2 years ago)
- Location:
- afterpay-gateway-for-woocommerce
- Files:
-
- 42 added
- 18 edited
- 1 copied
-
tags/3.7.0 (copied) (copied from afterpay-gateway-for-woocommerce/trunk)
-
tags/3.7.0/afterpay-gateway-for-woocommerce.php (modified) (8 diffs)
-
tags/3.7.0/build (added)
-
tags/3.7.0/build/afterpay-admin (added)
-
tags/3.7.0/build/afterpay-admin/index.asset.php (added)
-
tags/3.7.0/build/afterpay-admin/index.js (added)
-
tags/3.7.0/build/afterpay-blocks (added)
-
tags/3.7.0/build/afterpay-blocks/index.asset.php (added)
-
tags/3.7.0/build/afterpay-blocks/index.js (added)
-
tags/3.7.0/build/afterpay-express (added)
-
tags/3.7.0/build/afterpay-express/index.asset.php (added)
-
tags/3.7.0/build/afterpay-express/index.js (added)
-
tags/3.7.0/build/afterpay-page-checkout (added)
-
tags/3.7.0/build/afterpay-page-checkout/index.asset.php (added)
-
tags/3.7.0/build/afterpay-page-checkout/index.js (added)
-
tags/3.7.0/build/cart-messaging-block (added)
-
tags/3.7.0/build/cart-messaging-block/block.json (added)
-
tags/3.7.0/build/cart-messaging-block/index.asset.php (added)
-
tags/3.7.0/build/cart-messaging-block/index.js (added)
-
tags/3.7.0/build/product-messaging-block (added)
-
tags/3.7.0/build/product-messaging-block/block.json (added)
-
tags/3.7.0/build/product-messaging-block/index.asset.php (added)
-
tags/3.7.0/build/product-messaging-block/index.js (added)
-
tags/3.7.0/class/WC_Gateway_Afterpay.php (modified) (9 diffs)
-
tags/3.7.0/class/WC_Gateway_Afterpay/form_fields.php (modified) (6 diffs)
-
tags/3.7.0/class/WC_Gateway_Afterpay_Blocks_Support.php (modified) (4 diffs)
-
tags/3.7.0/readme.txt (modified) (2 diffs)
-
tags/3.7.0/vendor/autoload.php (modified) (1 diff)
-
tags/3.7.0/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/3.7.0/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/3.7.0/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/afterpay-gateway-for-woocommerce.php (modified) (8 diffs)
-
trunk/build (added)
-
trunk/build/afterpay-admin (added)
-
trunk/build/afterpay-admin/index.asset.php (added)
-
trunk/build/afterpay-admin/index.js (added)
-
trunk/build/afterpay-blocks (added)
-
trunk/build/afterpay-blocks/index.asset.php (added)
-
trunk/build/afterpay-blocks/index.js (added)
-
trunk/build/afterpay-express (added)
-
trunk/build/afterpay-express/index.asset.php (added)
-
trunk/build/afterpay-express/index.js (added)
-
trunk/build/afterpay-page-checkout (added)
-
trunk/build/afterpay-page-checkout/index.asset.php (added)
-
trunk/build/afterpay-page-checkout/index.js (added)
-
trunk/build/cart-messaging-block (added)
-
trunk/build/cart-messaging-block/block.json (added)
-
trunk/build/cart-messaging-block/index.asset.php (added)
-
trunk/build/cart-messaging-block/index.js (added)
-
trunk/build/product-messaging-block (added)
-
trunk/build/product-messaging-block/block.json (added)
-
trunk/build/product-messaging-block/index.asset.php (added)
-
trunk/build/product-messaging-block/index.js (added)
-
trunk/class/WC_Gateway_Afterpay.php (modified) (9 diffs)
-
trunk/class/WC_Gateway_Afterpay/form_fields.php (modified) (6 diffs)
-
trunk/class/WC_Gateway_Afterpay_Blocks_Support.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
afterpay-gateway-for-woocommerce/tags/3.7.0/afterpay-gateway-for-woocommerce.php
r2972429 r2986471 5 5 * Author: Afterpay 6 6 * Author URI: https://www.afterpay.com/ 7 * Version: 3. 6.17 * Version: 3.7.0 8 8 * Text Domain: afterpay-gateway-for-woocommerce 9 9 * WC requires at least: 3.2.6 10 * WC tested up to: 8. 1.110 * WC tested up to: 8.2.1 11 11 * 12 12 * Copyright: (c) 2020 Afterpay … … 46 46 * the value in the comments above. 47 47 */ 48 public static $version = '3. 6.1';48 public static $version = '3.7.0'; 49 49 50 50 /** … … 108 108 add_filter( 'woocommerce_get_price_html', array($gateway, 'filter_woocommerce_get_price_html'), 10, 2 ); 109 109 add_filter( 'woocommerce_gateway_icon', array($gateway, 'filter_woocommerce_gateway_icon'), 10, 2 ); 110 add_filter( 111 '__experimental_woocommerce_blocks_add_data_attributes_to_namespace', 112 function ( $allowed_namespaces ) { 113 $allowed_namespaces[] = 'afterpay-gateway-for-woocommerce'; 114 return $allowed_namespaces; 115 }, 116 10, 1 117 ); 118 110 119 /** 111 120 * Shortcodes. … … 199 208 public function init_website_assets() 200 209 { 210 self::register_common_assets(); 211 201 212 $instance = WC_Gateway_Afterpay::getInstance(); 202 213 203 if ( $instance->is_enabled()) {214 if (is_checkout() && $instance->is_enabled()) { 204 215 $plugin_version = self::$version; 205 216 206 /** 207 * Register CSS. 208 */ 209 wp_register_style( 'afterpay_css', plugins_url( 'css/afterpay.css', __FILE__ ), array(), $plugin_version ); 210 211 /** 212 * Register & Enqueue JS. 213 * Note: Admin assets are registered in self::init_admin_assets() 214 */ 215 $subdomain = $instance->get_api_env() == 'production' ? 'js' : 'js-sandbox'; 216 wp_register_script( 'square_marketplace_js', "https://{$subdomain}.squarecdn.com/square-marketplace.js", array(), null, true ); 217 218 if (is_checkout()) { 219 wp_enqueue_style( 'afterpay_css' ); 220 wp_enqueue_script( 221 'afterpay_checkout_page', 222 plugins_url('build/afterpay-page-checkout.js', __FILE__), 223 ['jquery', 'square_marketplace_js'], 224 $plugin_version, 225 true 226 ); 227 } 228 229 if(is_cart()) { 230 wp_register_script( 'afterpay_express', plugins_url( 'build/afterpay-express.js', __FILE__ ), array('jquery', 'square_marketplace_js'), $plugin_version, true ); 231 wp_localize_script( 'afterpay_express', 'afterpay_express_js_config', array( 232 'ajaxurl' => admin_url('admin-ajax.php'), 233 'ec_start_nonce' => wp_create_nonce("ec_start_nonce"), 234 'ec_change_nonce' => wp_create_nonce("ec_change_nonce"), 235 'ec_change_shipping_nonce' => wp_create_nonce("ec_change_shipping_nonce"), 236 'ec_complete_nonce' => wp_create_nonce("ec_complete_nonce"), 237 'country_code' => $instance->get_country_code() 238 ) ); 239 } 217 wp_enqueue_style( 'afterpay_css' ); 218 wp_enqueue_script( 219 'afterpay_checkout_page', 220 plugins_url('build/afterpay-page-checkout/index.js', __FILE__), 221 ['jquery', 'square_marketplace_js'], 222 $plugin_version, 223 true 224 ); 240 225 } 241 226 } … … 249 234 public function init_admin_assets($hook) 250 235 { 236 self::register_common_assets(); 237 251 238 if ( $hook == 'woocommerce_page_wc-settings' && 252 239 isset($_GET['section']) && $_GET['section'] == 'afterpay' 253 240 ) { 241 $plugin_version = self::$version; 254 242 $instance = WC_Gateway_Afterpay::getInstance(); 255 $subdomain = $instance->get_api_env() == 'production' ? 'js' : 'js-sandbox'; 256 wp_register_script( 'square_marketplace_js', "https://{$subdomain}.squarecdn.com/square-marketplace.js", array(), null, true ); 257 258 wp_enqueue_script( 'afterpay_admin_js', plugins_url( 'build/afterpay-admin.js', __FILE__ ), array('square_marketplace_js'), false, true ); 243 244 wp_enqueue_script( 'afterpay_admin_js', plugins_url( 'build/afterpay-admin/index.js', __FILE__ ), array('square_marketplace_js'), $plugin_version, true ); 259 245 wp_localize_script( 'afterpay_admin_js', 'afterpay_ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' )) ); 260 246 wp_localize_script( 'afterpay_admin_js', 'afterpay_config', array( … … 265 251 ) ); 266 252 } 253 } 254 255 public static function register_js_lib() { 256 $instance = WC_Gateway_Afterpay::getInstance(); 257 $subdomain = $instance->get_api_env() == 'production' ? 'js' : 'js-sandbox'; 258 wp_register_script( 'square_marketplace_js', "https://{$subdomain}.squarecdn.com/square-marketplace.js", array(), null, true ); 259 } 260 261 public static function register_common_assets() { 262 self::register_js_lib(); 263 264 $plugin_version = self::$version; 265 $instance = WC_Gateway_Afterpay::getInstance(); 266 267 wp_register_style( 'afterpay_css', plugins_url( 'css/afterpay.css', __FILE__ ), array(), $plugin_version ); 268 269 wp_register_script( 'afterpay_express', plugins_url( 'build/afterpay-express/index.js', __FILE__ ), array('jquery', 'square_marketplace_js'), $plugin_version, true ); 270 wp_localize_script( 'afterpay_express', 'afterpay_express_js_config', array( 271 'ajaxurl' => admin_url('admin-ajax.php'), 272 'ec_start_nonce' => wp_create_nonce("ec_start_nonce"), 273 'ec_change_nonce' => wp_create_nonce("ec_change_nonce"), 274 'ec_change_shipping_nonce' => wp_create_nonce("ec_change_shipping_nonce"), 275 'ec_complete_nonce' => wp_create_nonce("ec_complete_nonce"), 276 'country_code' => $instance->get_country_code() 277 ) ); 267 278 } 268 279 … … 433 444 } 434 445 } 446 447 public static function register_blocks() { 448 if ( ! function_exists( 'register_block_type' ) ) { 449 // Block editor is not available. 450 return; 451 } 452 453 self::register_js_lib(); 454 455 $instance = WC_Gateway_Afterpay::getInstance(); 456 457 // Register product messaging block 458 register_block_type( 459 __DIR__ . '/build/product-messaging-block/block.json', 460 array( 461 'editor_script_handles' => [ 'square_marketplace_js' ], 462 'view_script_handles' => [ 'square_marketplace_js' ], 463 'render_callback' => array($instance, 'render_product_messaging_block') 464 ) 465 ); 466 467 /** 468 * Register cart messaging block 469 * Note: Unable to retrieve the WC()->cart object on the server side, 470 * hence it cannot get the cart total dynamically, or loop through the cart items 471 * to check restricted categories, or fetch the skus and categories for analytics. 472 */ 473 $cart_messaging_asset = include( plugin_dir_path( __FILE__ ) . 'build/cart-messaging-block/index.asset.php'); 474 wp_register_script( 'afterpay_cart_messaging', 475 plugins_url('build/cart-messaging-block/index.js', __FILE__), 476 $cart_messaging_asset['dependencies'], 477 $cart_messaging_asset['version'], 478 true 479 ); 480 wp_localize_script( 'afterpay_cart_messaging','plugin_data', array( 481 'frontend_is_ready' => $instance->frontend_is_ready(), 482 'placement_attributes' => $instance->get_cart_placement_attributes(), 483 ) ); 484 register_block_type( 485 __DIR__ . '/build/cart-messaging-block/block.json', 486 array( 487 'editor_script_handles' => [ 'square_marketplace_js' ], 488 'view_script_handles' => [ 'square_marketplace_js' ], 489 'render_callback' => array($instance, 'render_cart_messaging_block') 490 ) 491 ); 492 } 435 493 } 436 494 … … 439 497 register_uninstall_hook( __FILE__, array('Afterpay_Plugin', 'uninstall_plugin') ); 440 498 499 add_action( 'init', array('Afterpay_Plugin', 'register_blocks') ); 441 500 add_action( 'plugins_loaded', array('Afterpay_Plugin', 'init'), 10, 0 ); 442 501 add_action( 'upgrader_process_complete', array('Afterpay_Plugin', 'upgrade_complete'), 10, 2 ); -
afterpay-gateway-for-woocommerce/tags/3.7.0/class/WC_Gateway_Afterpay.php
r2972429 r2986471 822 822 */ 823 823 private function cart_products_are_supported() { 824 if (did_action('wp_loaded') ) {824 if (did_action('wp_loaded') && WC()->cart) { 825 825 foreach (WC()->cart->get_cart() as $cart_item) { 826 826 $product = $cart_item['data']; … … 944 944 public function render_express_checkout_on_cart_page() { 945 945 if ( 946 !isset($this->settings['show-express-on-cart-page']) || 947 $this->settings['show-express-on-cart-page'] != 'yes' || 948 get_woocommerce_currency() != $this->settings['settlement-currency'] || 949 !$this->cart_is_within_limits() || 950 !$this->cart_products_are_supported() || 951 $this->cart_is_virtual() 946 !$this->express_is_available() || 947 !$this->cart_is_within_limits() 952 948 ) { 953 949 return; … … 962 958 'tr' => true, 963 959 'td' => array( 'colspan' => true, 'class' => true, ), 960 'button' => array( 'id' => true, 'class' => true, 'type' => true, 'disabled' => true, ), 961 'img' => array( 'src' => true, 'alt' => true, ), 962 )); 963 } 964 965 public function express_is_available() { 966 // Need to check cart total separately 967 return isset($this->settings['show-express-on-cart-page']) 968 && 'yes' == $this->settings['show-express-on-cart-page'] 969 && get_woocommerce_currency() == $this->settings['settlement-currency'] 970 && $this->cart_products_are_supported() 971 && !$this->cart_is_virtual(); 972 } 973 974 public function get_express_checkout_button_for_block() { 975 $button_html = str_replace('[THEME]', $this->settings['express-button-theme'], $this->assets['cart_page_express_button']); 976 977 return wp_kses($button_html, array( 964 978 'button' => array( 'id' => true, 'class' => true, 'type' => true, 'disabled' => true, ), 965 979 'img' => array( 'src' => true, 'alt' => true, ), … … 1508 1522 $address['city'] = $address['suburb']; 1509 1523 1524 $address = apply_filters( 'woocommerce_cart_calculate_shipping_address', $address ); 1525 1510 1526 if ( $address['postcode'] && ! WC_Validation::is_postcode( $address['postcode'], $address['country'] ) ) { 1511 1527 throw new Exception( __( 'Please enter a valid postcode / ZIP.', 'woocommerce' ) ); … … 1560 1576 $customer->save(); 1561 1577 1562 //do_action( 'woocommerce_calculated_shipping' );1578 do_action( 'woocommerce_calculated_shipping' ); 1563 1579 1564 1580 WC()->cart->calculate_totals(); … … 1574 1590 $response = array(); 1575 1591 $currency = get_woocommerce_currency(); 1576 $totals = WC()->cart->get_totals();1577 $cart_total = $totals['cart_contents_tax'] + (float)$totals['cart_contents_total'];1578 1592 $maximum = floatval($this->getOrderLimitMax()); 1579 1593 1580 1594 foreach ($methods as $method) { 1581 $shipping_cost = (float)$method->get_cost() + $method->get_shipping_tax(); 1582 $total = $cart_total + $shipping_cost; 1583 1584 if ($total <= $maximum) { 1595 /** 1596 * Mimic WC_AJAX::update_shipping_method() to get the correct total amounts. 1597 * Mainly for 'Local Pickup' shipping option, because it calculates taxes 1598 * based on the base store location by default, and not the customer’s address. 1599 */ 1600 WC()->session->set( 'chosen_shipping_methods', array($method->get_id()) ); 1601 WC()->cart->calculate_totals(); 1602 1603 $shipping_amount = (float)WC()->cart->get_shipping_total(); // without tax 1604 $order_amount = (float)WC()->cart->get_total(''); // incl. shipping and taxes 1605 $tax_amount = (float)WC()->cart->get_total_tax(); 1606 1607 if ($order_amount <= $maximum) { 1585 1608 $response[] = array( 1586 1609 'id' => $method->get_id(), … … 1588 1611 'description' => $method->get_label(), 1589 1612 'shippingAmount' => array( 1590 'amount' => number_format($shipping_ cost, 2, '.', ''),1613 'amount' => number_format($shipping_amount, 2, '.', ''), 1591 1614 'currency' => $currency 1592 1615 ), 1593 1616 'orderAmount' => array( 1594 'amount' => number_format($total, 2, '.', ''), 1617 'amount' => number_format($order_amount, 2, '.', ''), 1618 'currency' => $currency 1619 ), 1620 'taxAmount' => array( 1621 'amount' => number_format($tax_amount, 2, '.', ''), 1595 1622 'currency' => $currency 1596 1623 ), … … 1837 1864 */ 1838 1865 private function cart_is_virtual() { 1839 foreach ( WC()->cart->get_cart() as $cart_item ) { 1840 if (!$cart_item['data']->is_virtual()) { 1841 return false; 1866 if (WC()->cart) { 1867 foreach ( WC()->cart->get_cart() as $cart_item ) { 1868 if (!$cart_item['data']->is_virtual()) { 1869 return false; 1870 } 1842 1871 } 1843 1872 } … … 2417 2446 return !empty($this->settings[$key]) ? $this->settings[$key] : ''; 2418 2447 } 2448 2449 public function render_product_messaging_block($attributes, $content, $block) { 2450 $style = "display:block;float:none;clear:both;"; 2451 if (isset($attributes['align'])) { 2452 $style .= "text-align:{$attributes['align']};"; 2453 } 2454 $wrapper_attributes = get_block_wrapper_attributes(); 2455 2456 if (isset($block->context['postId'])) { 2457 $post_id = $block->context['postId']; 2458 $product = wc_get_product($post_id); 2459 2460 if ($product) { 2461 if (isset($block->context['singleProduct']) && $block->context['singleProduct']) { 2462 $context = 'product-pages'; 2463 } else { 2464 $context = 'category-pages'; 2465 } 2466 ob_start(); 2467 echo "<div {$wrapper_attributes} style={$style}>"; 2468 $this->render_placement($context, $product); 2469 echo "</div>"; 2470 $markup = ob_get_clean(); 2471 return $markup; 2472 } 2473 } 2474 } 2475 2476 public function render_cart_messaging_block($attributes, $content, $block) { 2477 $wrapper_attributes = get_block_wrapper_attributes(); 2478 return "<div {$wrapper_attributes}></div>"; 2479 } 2480 2481 public function get_cart_placement_attributes() { 2482 $attributes = []; 2483 2484 $attributes['data-mpid'] = $this->get_mpid(); 2485 $attributes['data-currency'] = get_woocommerce_currency(); 2486 2487 $input = $this->settings['cart-page-placement-attributes']; 2488 if (preg_match_all('/data(-[a-z]+)+="[^"]+"/', $input, $raw_attributes)) { 2489 foreach ($raw_attributes[0] as $pair) { 2490 if (preg_match('/data(-[a-z]+)+(?==")/', $pair, $key) 2491 && preg_match('/(?<==")[^"]+(?=")/', $pair, $value) 2492 ) { 2493 $attributes[$key[0]] = $value[0]; 2494 } 2495 } 2496 } 2497 if (!$this->cart_products_are_supported()) { 2498 $attributes['data-cart-is-eligible'] = 'false'; 2499 } 2500 2501 $attributes['data-platform'] = 'WooCommerce'; 2502 $attributes['data-page-type'] = 'cart'; 2503 $attributes['data-item-skus'] = $this->get_cart_item_skus(); 2504 $attributes['data-item-categories'] = $this->get_cart_item_categories(); 2505 2506 return $attributes; 2507 } 2419 2508 } 2420 2509 } -
afterpay-gateway-for-woocommerce/tags/3.7.0/class/WC_Gateway_Afterpay/form_fields.php
r2959051 r2986471 33 33 'title' => __( 'Merchant ID (Production)', 'woo_afterpay' ), 34 34 'type' => 'text', 35 'custom_attributes' => array( 36 'environment-field' => 'production' 37 ), 35 38 'default' => '' 36 39 ), … … 38 41 'title' => __( 'Secret Key (Production)', 'woo_afterpay' ), 39 42 'type' => 'password', 43 'custom_attributes' => array( 44 'environment-field' => 'production' 45 ), 40 46 'default' => '' 41 47 ), … … 45 51 'description' => __( 'This information is supplied by Afterpay and cannot be edited.', 'woo_afterpay' ), 46 52 'custom_attributes' => array( 47 'readonly' => 'true' 48 ), 53 'readonly' => 'true', 54 'environment-field' => 'production' 55 ), 49 56 'default' => '' 50 57 ), … … 52 59 'title' => __( 'Merchant ID (Sandbox)', 'woo_afterpay' ), 53 60 'type' => 'text', 61 'custom_attributes' => array( 62 'environment-field' => 'sandbox' 63 ), 54 64 'default' => '' 55 65 ), … … 57 67 'title' => __( 'Secret Key (Sandbox)', 'woo_afterpay' ), 58 68 'type' => 'password', 69 'custom_attributes' => array( 70 'environment-field' => 'sandbox' 71 ), 59 72 'default' => '' 60 73 ), … … 64 77 'description' => __( 'This information is supplied by Afterpay and cannot be edited.', 'woo_afterpay' ), 65 78 'custom_attributes' => array( 66 'readonly' => 'true' 67 ), 79 'readonly' => 'true', 80 'environment-field' => 'sandbox' 81 ), 68 82 'default' => '' 69 83 ), -
afterpay-gateway-for-woocommerce/tags/3.7.0/class/WC_Gateway_Afterpay_Blocks_Support.php
r2959051 r2986471 41 41 */ 42 42 public function get_payment_method_script_handles() { 43 $asset_path = WC_GATEWAY_AFTERPAY_PATH . '/build/afterpay-blocks .asset.php';43 $asset_path = WC_GATEWAY_AFTERPAY_PATH . '/build/afterpay-blocks/index.asset.php'; 44 44 $version = Afterpay_Plugin::$version; 45 45 $dependencies = []; … … 55 55 wp_register_script( 56 56 'wc-afterpay-blocks-integration', 57 WC_GATEWAY_AFTERPAY_URL . '/build/afterpay-blocks .js',57 WC_GATEWAY_AFTERPAY_URL . '/build/afterpay-blocks/index.js', 58 58 $dependencies, 59 59 $version, 60 60 true 61 61 ); 62 return [ 'wc-afterpay-blocks-integration' ];62 return [ 'wc-afterpay-blocks-integration', 'afterpay_express' ]; 63 63 } 64 64 … … 70 70 public function get_payment_method_data() { 71 71 $instance = WC_Gateway_Afterpay::getInstance(); 72 wp_enqueue_script('square_marketplace_js');73 72 wp_enqueue_style( 'afterpay_css' ); 74 73 return [ … … 78 77 'testmode' => $this->get_setting('testmode'), 79 78 'locale' => $instance->get_js_locale(), 80 'supports' => $this->get_supported_features() 79 'supports' => $this->get_supported_features(), 80 'ec_available' => $instance->express_is_available(), 81 'ec_button' => $instance->get_express_checkout_button_for_block(), 81 82 ]; 82 83 } -
afterpay-gateway-for-woocommerce/tags/3.7.0/readme.txt
r2972429 r2986471 3 3 Tags: woocommerce, afterpay 4 4 Requires at least: 4.8.3 5 Tested up to: 6.3. 16 Stable tag: 3. 6.15 Tested up to: 6.3.2 6 Stable tag: 3.7.0 7 7 License: GNU Public License 8 8 License URI: https://www.gnu.org/licenses/ … … 39 39 40 40 == Changelog == 41 42 = 3.7.0 = 43 *Release Date: Tuesday, 31 Oct 2023* 44 45 * Created messaging block types for product and cart blocks. 46 * Added support for express checkout in cart and checkout blocks. 47 * Tested and verified support for WordPress 6.3.2 and WooCommerce 8.2.1. 41 48 42 49 = 3.6.1 = -
afterpay-gateway-for-woocommerce/tags/3.7.0/vendor/autoload.php
r2972429 r2986471 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit d1b79db0b8d59aaf8ea8aa86543d756f::getLoader();25 return ComposerAutoloaderInit40b20a308214f7ee0fb661161f18ab08::getLoader(); -
afterpay-gateway-for-woocommerce/tags/3.7.0/vendor/composer/autoload_real.php
r2972429 r2986471 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit d1b79db0b8d59aaf8ea8aa86543d756f5 class ComposerAutoloaderInit40b20a308214f7ee0fb661161f18ab08 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit d1b79db0b8d59aaf8ea8aa86543d756f', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInit40b20a308214f7ee0fb661161f18ab08', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit d1b79db0b8d59aaf8ea8aa86543d756f', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInit40b20a308214f7ee0fb661161f18ab08', 'loadClassLoader')); 28 28 29 29 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInit40b20a308214f7ee0fb661161f18ab08::getInitializer($loader)); 31 31 32 32 $loader->register(true); -
afterpay-gateway-for-woocommerce/tags/3.7.0/vendor/composer/autoload_static.php
r2972429 r2986471 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f7 class ComposerStaticInit40b20a308214f7ee0fb661161f18ab08 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 28 28 { 29 29 return \Closure::bind(function () use ($loader) { 30 $loader->prefixLengthsPsr4 = ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f::$prefixLengthsPsr4;31 $loader->prefixDirsPsr4 = ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f::$prefixDirsPsr4;32 $loader->classMap = ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f::$classMap;30 $loader->prefixLengthsPsr4 = ComposerStaticInit40b20a308214f7ee0fb661161f18ab08::$prefixLengthsPsr4; 31 $loader->prefixDirsPsr4 = ComposerStaticInit40b20a308214f7ee0fb661161f18ab08::$prefixDirsPsr4; 32 $loader->classMap = ComposerStaticInit40b20a308214f7ee0fb661161f18ab08::$classMap; 33 33 34 34 }, null, ClassLoader::class); -
afterpay-gateway-for-woocommerce/tags/3.7.0/vendor/composer/installed.php
r2972429 r2986471 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 0fad5e51d0a6de8476a97c6d54bc409bbdf40fe2',6 'reference' => '28e7f01931141bac147c154a8b6a043ef9498b8c', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' 0fad5e51d0a6de8476a97c6d54bc409bbdf40fe2',16 'reference' => '28e7f01931141bac147c154a8b6a043ef9498b8c', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
afterpay-gateway-for-woocommerce/trunk/afterpay-gateway-for-woocommerce.php
r2972429 r2986471 5 5 * Author: Afterpay 6 6 * Author URI: https://www.afterpay.com/ 7 * Version: 3. 6.17 * Version: 3.7.0 8 8 * Text Domain: afterpay-gateway-for-woocommerce 9 9 * WC requires at least: 3.2.6 10 * WC tested up to: 8. 1.110 * WC tested up to: 8.2.1 11 11 * 12 12 * Copyright: (c) 2020 Afterpay … … 46 46 * the value in the comments above. 47 47 */ 48 public static $version = '3. 6.1';48 public static $version = '3.7.0'; 49 49 50 50 /** … … 108 108 add_filter( 'woocommerce_get_price_html', array($gateway, 'filter_woocommerce_get_price_html'), 10, 2 ); 109 109 add_filter( 'woocommerce_gateway_icon', array($gateway, 'filter_woocommerce_gateway_icon'), 10, 2 ); 110 add_filter( 111 '__experimental_woocommerce_blocks_add_data_attributes_to_namespace', 112 function ( $allowed_namespaces ) { 113 $allowed_namespaces[] = 'afterpay-gateway-for-woocommerce'; 114 return $allowed_namespaces; 115 }, 116 10, 1 117 ); 118 110 119 /** 111 120 * Shortcodes. … … 199 208 public function init_website_assets() 200 209 { 210 self::register_common_assets(); 211 201 212 $instance = WC_Gateway_Afterpay::getInstance(); 202 213 203 if ( $instance->is_enabled()) {214 if (is_checkout() && $instance->is_enabled()) { 204 215 $plugin_version = self::$version; 205 216 206 /** 207 * Register CSS. 208 */ 209 wp_register_style( 'afterpay_css', plugins_url( 'css/afterpay.css', __FILE__ ), array(), $plugin_version ); 210 211 /** 212 * Register & Enqueue JS. 213 * Note: Admin assets are registered in self::init_admin_assets() 214 */ 215 $subdomain = $instance->get_api_env() == 'production' ? 'js' : 'js-sandbox'; 216 wp_register_script( 'square_marketplace_js', "https://{$subdomain}.squarecdn.com/square-marketplace.js", array(), null, true ); 217 218 if (is_checkout()) { 219 wp_enqueue_style( 'afterpay_css' ); 220 wp_enqueue_script( 221 'afterpay_checkout_page', 222 plugins_url('build/afterpay-page-checkout.js', __FILE__), 223 ['jquery', 'square_marketplace_js'], 224 $plugin_version, 225 true 226 ); 227 } 228 229 if(is_cart()) { 230 wp_register_script( 'afterpay_express', plugins_url( 'build/afterpay-express.js', __FILE__ ), array('jquery', 'square_marketplace_js'), $plugin_version, true ); 231 wp_localize_script( 'afterpay_express', 'afterpay_express_js_config', array( 232 'ajaxurl' => admin_url('admin-ajax.php'), 233 'ec_start_nonce' => wp_create_nonce("ec_start_nonce"), 234 'ec_change_nonce' => wp_create_nonce("ec_change_nonce"), 235 'ec_change_shipping_nonce' => wp_create_nonce("ec_change_shipping_nonce"), 236 'ec_complete_nonce' => wp_create_nonce("ec_complete_nonce"), 237 'country_code' => $instance->get_country_code() 238 ) ); 239 } 217 wp_enqueue_style( 'afterpay_css' ); 218 wp_enqueue_script( 219 'afterpay_checkout_page', 220 plugins_url('build/afterpay-page-checkout/index.js', __FILE__), 221 ['jquery', 'square_marketplace_js'], 222 $plugin_version, 223 true 224 ); 240 225 } 241 226 } … … 249 234 public function init_admin_assets($hook) 250 235 { 236 self::register_common_assets(); 237 251 238 if ( $hook == 'woocommerce_page_wc-settings' && 252 239 isset($_GET['section']) && $_GET['section'] == 'afterpay' 253 240 ) { 241 $plugin_version = self::$version; 254 242 $instance = WC_Gateway_Afterpay::getInstance(); 255 $subdomain = $instance->get_api_env() == 'production' ? 'js' : 'js-sandbox'; 256 wp_register_script( 'square_marketplace_js', "https://{$subdomain}.squarecdn.com/square-marketplace.js", array(), null, true ); 257 258 wp_enqueue_script( 'afterpay_admin_js', plugins_url( 'build/afterpay-admin.js', __FILE__ ), array('square_marketplace_js'), false, true ); 243 244 wp_enqueue_script( 'afterpay_admin_js', plugins_url( 'build/afterpay-admin/index.js', __FILE__ ), array('square_marketplace_js'), $plugin_version, true ); 259 245 wp_localize_script( 'afterpay_admin_js', 'afterpay_ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' )) ); 260 246 wp_localize_script( 'afterpay_admin_js', 'afterpay_config', array( … … 265 251 ) ); 266 252 } 253 } 254 255 public static function register_js_lib() { 256 $instance = WC_Gateway_Afterpay::getInstance(); 257 $subdomain = $instance->get_api_env() == 'production' ? 'js' : 'js-sandbox'; 258 wp_register_script( 'square_marketplace_js', "https://{$subdomain}.squarecdn.com/square-marketplace.js", array(), null, true ); 259 } 260 261 public static function register_common_assets() { 262 self::register_js_lib(); 263 264 $plugin_version = self::$version; 265 $instance = WC_Gateway_Afterpay::getInstance(); 266 267 wp_register_style( 'afterpay_css', plugins_url( 'css/afterpay.css', __FILE__ ), array(), $plugin_version ); 268 269 wp_register_script( 'afterpay_express', plugins_url( 'build/afterpay-express/index.js', __FILE__ ), array('jquery', 'square_marketplace_js'), $plugin_version, true ); 270 wp_localize_script( 'afterpay_express', 'afterpay_express_js_config', array( 271 'ajaxurl' => admin_url('admin-ajax.php'), 272 'ec_start_nonce' => wp_create_nonce("ec_start_nonce"), 273 'ec_change_nonce' => wp_create_nonce("ec_change_nonce"), 274 'ec_change_shipping_nonce' => wp_create_nonce("ec_change_shipping_nonce"), 275 'ec_complete_nonce' => wp_create_nonce("ec_complete_nonce"), 276 'country_code' => $instance->get_country_code() 277 ) ); 267 278 } 268 279 … … 433 444 } 434 445 } 446 447 public static function register_blocks() { 448 if ( ! function_exists( 'register_block_type' ) ) { 449 // Block editor is not available. 450 return; 451 } 452 453 self::register_js_lib(); 454 455 $instance = WC_Gateway_Afterpay::getInstance(); 456 457 // Register product messaging block 458 register_block_type( 459 __DIR__ . '/build/product-messaging-block/block.json', 460 array( 461 'editor_script_handles' => [ 'square_marketplace_js' ], 462 'view_script_handles' => [ 'square_marketplace_js' ], 463 'render_callback' => array($instance, 'render_product_messaging_block') 464 ) 465 ); 466 467 /** 468 * Register cart messaging block 469 * Note: Unable to retrieve the WC()->cart object on the server side, 470 * hence it cannot get the cart total dynamically, or loop through the cart items 471 * to check restricted categories, or fetch the skus and categories for analytics. 472 */ 473 $cart_messaging_asset = include( plugin_dir_path( __FILE__ ) . 'build/cart-messaging-block/index.asset.php'); 474 wp_register_script( 'afterpay_cart_messaging', 475 plugins_url('build/cart-messaging-block/index.js', __FILE__), 476 $cart_messaging_asset['dependencies'], 477 $cart_messaging_asset['version'], 478 true 479 ); 480 wp_localize_script( 'afterpay_cart_messaging','plugin_data', array( 481 'frontend_is_ready' => $instance->frontend_is_ready(), 482 'placement_attributes' => $instance->get_cart_placement_attributes(), 483 ) ); 484 register_block_type( 485 __DIR__ . '/build/cart-messaging-block/block.json', 486 array( 487 'editor_script_handles' => [ 'square_marketplace_js' ], 488 'view_script_handles' => [ 'square_marketplace_js' ], 489 'render_callback' => array($instance, 'render_cart_messaging_block') 490 ) 491 ); 492 } 435 493 } 436 494 … … 439 497 register_uninstall_hook( __FILE__, array('Afterpay_Plugin', 'uninstall_plugin') ); 440 498 499 add_action( 'init', array('Afterpay_Plugin', 'register_blocks') ); 441 500 add_action( 'plugins_loaded', array('Afterpay_Plugin', 'init'), 10, 0 ); 442 501 add_action( 'upgrader_process_complete', array('Afterpay_Plugin', 'upgrade_complete'), 10, 2 ); -
afterpay-gateway-for-woocommerce/trunk/class/WC_Gateway_Afterpay.php
r2972429 r2986471 822 822 */ 823 823 private function cart_products_are_supported() { 824 if (did_action('wp_loaded') ) {824 if (did_action('wp_loaded') && WC()->cart) { 825 825 foreach (WC()->cart->get_cart() as $cart_item) { 826 826 $product = $cart_item['data']; … … 944 944 public function render_express_checkout_on_cart_page() { 945 945 if ( 946 !isset($this->settings['show-express-on-cart-page']) || 947 $this->settings['show-express-on-cart-page'] != 'yes' || 948 get_woocommerce_currency() != $this->settings['settlement-currency'] || 949 !$this->cart_is_within_limits() || 950 !$this->cart_products_are_supported() || 951 $this->cart_is_virtual() 946 !$this->express_is_available() || 947 !$this->cart_is_within_limits() 952 948 ) { 953 949 return; … … 962 958 'tr' => true, 963 959 'td' => array( 'colspan' => true, 'class' => true, ), 960 'button' => array( 'id' => true, 'class' => true, 'type' => true, 'disabled' => true, ), 961 'img' => array( 'src' => true, 'alt' => true, ), 962 )); 963 } 964 965 public function express_is_available() { 966 // Need to check cart total separately 967 return isset($this->settings['show-express-on-cart-page']) 968 && 'yes' == $this->settings['show-express-on-cart-page'] 969 && get_woocommerce_currency() == $this->settings['settlement-currency'] 970 && $this->cart_products_are_supported() 971 && !$this->cart_is_virtual(); 972 } 973 974 public function get_express_checkout_button_for_block() { 975 $button_html = str_replace('[THEME]', $this->settings['express-button-theme'], $this->assets['cart_page_express_button']); 976 977 return wp_kses($button_html, array( 964 978 'button' => array( 'id' => true, 'class' => true, 'type' => true, 'disabled' => true, ), 965 979 'img' => array( 'src' => true, 'alt' => true, ), … … 1508 1522 $address['city'] = $address['suburb']; 1509 1523 1524 $address = apply_filters( 'woocommerce_cart_calculate_shipping_address', $address ); 1525 1510 1526 if ( $address['postcode'] && ! WC_Validation::is_postcode( $address['postcode'], $address['country'] ) ) { 1511 1527 throw new Exception( __( 'Please enter a valid postcode / ZIP.', 'woocommerce' ) ); … … 1560 1576 $customer->save(); 1561 1577 1562 //do_action( 'woocommerce_calculated_shipping' );1578 do_action( 'woocommerce_calculated_shipping' ); 1563 1579 1564 1580 WC()->cart->calculate_totals(); … … 1574 1590 $response = array(); 1575 1591 $currency = get_woocommerce_currency(); 1576 $totals = WC()->cart->get_totals();1577 $cart_total = $totals['cart_contents_tax'] + (float)$totals['cart_contents_total'];1578 1592 $maximum = floatval($this->getOrderLimitMax()); 1579 1593 1580 1594 foreach ($methods as $method) { 1581 $shipping_cost = (float)$method->get_cost() + $method->get_shipping_tax(); 1582 $total = $cart_total + $shipping_cost; 1583 1584 if ($total <= $maximum) { 1595 /** 1596 * Mimic WC_AJAX::update_shipping_method() to get the correct total amounts. 1597 * Mainly for 'Local Pickup' shipping option, because it calculates taxes 1598 * based on the base store location by default, and not the customer’s address. 1599 */ 1600 WC()->session->set( 'chosen_shipping_methods', array($method->get_id()) ); 1601 WC()->cart->calculate_totals(); 1602 1603 $shipping_amount = (float)WC()->cart->get_shipping_total(); // without tax 1604 $order_amount = (float)WC()->cart->get_total(''); // incl. shipping and taxes 1605 $tax_amount = (float)WC()->cart->get_total_tax(); 1606 1607 if ($order_amount <= $maximum) { 1585 1608 $response[] = array( 1586 1609 'id' => $method->get_id(), … … 1588 1611 'description' => $method->get_label(), 1589 1612 'shippingAmount' => array( 1590 'amount' => number_format($shipping_ cost, 2, '.', ''),1613 'amount' => number_format($shipping_amount, 2, '.', ''), 1591 1614 'currency' => $currency 1592 1615 ), 1593 1616 'orderAmount' => array( 1594 'amount' => number_format($total, 2, '.', ''), 1617 'amount' => number_format($order_amount, 2, '.', ''), 1618 'currency' => $currency 1619 ), 1620 'taxAmount' => array( 1621 'amount' => number_format($tax_amount, 2, '.', ''), 1595 1622 'currency' => $currency 1596 1623 ), … … 1837 1864 */ 1838 1865 private function cart_is_virtual() { 1839 foreach ( WC()->cart->get_cart() as $cart_item ) { 1840 if (!$cart_item['data']->is_virtual()) { 1841 return false; 1866 if (WC()->cart) { 1867 foreach ( WC()->cart->get_cart() as $cart_item ) { 1868 if (!$cart_item['data']->is_virtual()) { 1869 return false; 1870 } 1842 1871 } 1843 1872 } … … 2417 2446 return !empty($this->settings[$key]) ? $this->settings[$key] : ''; 2418 2447 } 2448 2449 public function render_product_messaging_block($attributes, $content, $block) { 2450 $style = "display:block;float:none;clear:both;"; 2451 if (isset($attributes['align'])) { 2452 $style .= "text-align:{$attributes['align']};"; 2453 } 2454 $wrapper_attributes = get_block_wrapper_attributes(); 2455 2456 if (isset($block->context['postId'])) { 2457 $post_id = $block->context['postId']; 2458 $product = wc_get_product($post_id); 2459 2460 if ($product) { 2461 if (isset($block->context['singleProduct']) && $block->context['singleProduct']) { 2462 $context = 'product-pages'; 2463 } else { 2464 $context = 'category-pages'; 2465 } 2466 ob_start(); 2467 echo "<div {$wrapper_attributes} style={$style}>"; 2468 $this->render_placement($context, $product); 2469 echo "</div>"; 2470 $markup = ob_get_clean(); 2471 return $markup; 2472 } 2473 } 2474 } 2475 2476 public function render_cart_messaging_block($attributes, $content, $block) { 2477 $wrapper_attributes = get_block_wrapper_attributes(); 2478 return "<div {$wrapper_attributes}></div>"; 2479 } 2480 2481 public function get_cart_placement_attributes() { 2482 $attributes = []; 2483 2484 $attributes['data-mpid'] = $this->get_mpid(); 2485 $attributes['data-currency'] = get_woocommerce_currency(); 2486 2487 $input = $this->settings['cart-page-placement-attributes']; 2488 if (preg_match_all('/data(-[a-z]+)+="[^"]+"/', $input, $raw_attributes)) { 2489 foreach ($raw_attributes[0] as $pair) { 2490 if (preg_match('/data(-[a-z]+)+(?==")/', $pair, $key) 2491 && preg_match('/(?<==")[^"]+(?=")/', $pair, $value) 2492 ) { 2493 $attributes[$key[0]] = $value[0]; 2494 } 2495 } 2496 } 2497 if (!$this->cart_products_are_supported()) { 2498 $attributes['data-cart-is-eligible'] = 'false'; 2499 } 2500 2501 $attributes['data-platform'] = 'WooCommerce'; 2502 $attributes['data-page-type'] = 'cart'; 2503 $attributes['data-item-skus'] = $this->get_cart_item_skus(); 2504 $attributes['data-item-categories'] = $this->get_cart_item_categories(); 2505 2506 return $attributes; 2507 } 2419 2508 } 2420 2509 } -
afterpay-gateway-for-woocommerce/trunk/class/WC_Gateway_Afterpay/form_fields.php
r2959051 r2986471 33 33 'title' => __( 'Merchant ID (Production)', 'woo_afterpay' ), 34 34 'type' => 'text', 35 'custom_attributes' => array( 36 'environment-field' => 'production' 37 ), 35 38 'default' => '' 36 39 ), … … 38 41 'title' => __( 'Secret Key (Production)', 'woo_afterpay' ), 39 42 'type' => 'password', 43 'custom_attributes' => array( 44 'environment-field' => 'production' 45 ), 40 46 'default' => '' 41 47 ), … … 45 51 'description' => __( 'This information is supplied by Afterpay and cannot be edited.', 'woo_afterpay' ), 46 52 'custom_attributes' => array( 47 'readonly' => 'true' 48 ), 53 'readonly' => 'true', 54 'environment-field' => 'production' 55 ), 49 56 'default' => '' 50 57 ), … … 52 59 'title' => __( 'Merchant ID (Sandbox)', 'woo_afterpay' ), 53 60 'type' => 'text', 61 'custom_attributes' => array( 62 'environment-field' => 'sandbox' 63 ), 54 64 'default' => '' 55 65 ), … … 57 67 'title' => __( 'Secret Key (Sandbox)', 'woo_afterpay' ), 58 68 'type' => 'password', 69 'custom_attributes' => array( 70 'environment-field' => 'sandbox' 71 ), 59 72 'default' => '' 60 73 ), … … 64 77 'description' => __( 'This information is supplied by Afterpay and cannot be edited.', 'woo_afterpay' ), 65 78 'custom_attributes' => array( 66 'readonly' => 'true' 67 ), 79 'readonly' => 'true', 80 'environment-field' => 'sandbox' 81 ), 68 82 'default' => '' 69 83 ), -
afterpay-gateway-for-woocommerce/trunk/class/WC_Gateway_Afterpay_Blocks_Support.php
r2959051 r2986471 41 41 */ 42 42 public function get_payment_method_script_handles() { 43 $asset_path = WC_GATEWAY_AFTERPAY_PATH . '/build/afterpay-blocks .asset.php';43 $asset_path = WC_GATEWAY_AFTERPAY_PATH . '/build/afterpay-blocks/index.asset.php'; 44 44 $version = Afterpay_Plugin::$version; 45 45 $dependencies = []; … … 55 55 wp_register_script( 56 56 'wc-afterpay-blocks-integration', 57 WC_GATEWAY_AFTERPAY_URL . '/build/afterpay-blocks .js',57 WC_GATEWAY_AFTERPAY_URL . '/build/afterpay-blocks/index.js', 58 58 $dependencies, 59 59 $version, 60 60 true 61 61 ); 62 return [ 'wc-afterpay-blocks-integration' ];62 return [ 'wc-afterpay-blocks-integration', 'afterpay_express' ]; 63 63 } 64 64 … … 70 70 public function get_payment_method_data() { 71 71 $instance = WC_Gateway_Afterpay::getInstance(); 72 wp_enqueue_script('square_marketplace_js');73 72 wp_enqueue_style( 'afterpay_css' ); 74 73 return [ … … 78 77 'testmode' => $this->get_setting('testmode'), 79 78 'locale' => $instance->get_js_locale(), 80 'supports' => $this->get_supported_features() 79 'supports' => $this->get_supported_features(), 80 'ec_available' => $instance->express_is_available(), 81 'ec_button' => $instance->get_express_checkout_button_for_block(), 81 82 ]; 82 83 } -
afterpay-gateway-for-woocommerce/trunk/readme.txt
r2972429 r2986471 3 3 Tags: woocommerce, afterpay 4 4 Requires at least: 4.8.3 5 Tested up to: 6.3. 16 Stable tag: 3. 6.15 Tested up to: 6.3.2 6 Stable tag: 3.7.0 7 7 License: GNU Public License 8 8 License URI: https://www.gnu.org/licenses/ … … 39 39 40 40 == Changelog == 41 42 = 3.7.0 = 43 *Release Date: Tuesday, 31 Oct 2023* 44 45 * Created messaging block types for product and cart blocks. 46 * Added support for express checkout in cart and checkout blocks. 47 * Tested and verified support for WordPress 6.3.2 and WooCommerce 8.2.1. 41 48 42 49 = 3.6.1 = -
afterpay-gateway-for-woocommerce/trunk/vendor/autoload.php
r2972429 r2986471 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit d1b79db0b8d59aaf8ea8aa86543d756f::getLoader();25 return ComposerAutoloaderInit40b20a308214f7ee0fb661161f18ab08::getLoader(); -
afterpay-gateway-for-woocommerce/trunk/vendor/composer/autoload_real.php
r2972429 r2986471 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit d1b79db0b8d59aaf8ea8aa86543d756f5 class ComposerAutoloaderInit40b20a308214f7ee0fb661161f18ab08 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit d1b79db0b8d59aaf8ea8aa86543d756f', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInit40b20a308214f7ee0fb661161f18ab08', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit d1b79db0b8d59aaf8ea8aa86543d756f', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInit40b20a308214f7ee0fb661161f18ab08', 'loadClassLoader')); 28 28 29 29 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInit40b20a308214f7ee0fb661161f18ab08::getInitializer($loader)); 31 31 32 32 $loader->register(true); -
afterpay-gateway-for-woocommerce/trunk/vendor/composer/autoload_static.php
r2972429 r2986471 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f7 class ComposerStaticInit40b20a308214f7ee0fb661161f18ab08 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 28 28 { 29 29 return \Closure::bind(function () use ($loader) { 30 $loader->prefixLengthsPsr4 = ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f::$prefixLengthsPsr4;31 $loader->prefixDirsPsr4 = ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f::$prefixDirsPsr4;32 $loader->classMap = ComposerStaticInit d1b79db0b8d59aaf8ea8aa86543d756f::$classMap;30 $loader->prefixLengthsPsr4 = ComposerStaticInit40b20a308214f7ee0fb661161f18ab08::$prefixLengthsPsr4; 31 $loader->prefixDirsPsr4 = ComposerStaticInit40b20a308214f7ee0fb661161f18ab08::$prefixDirsPsr4; 32 $loader->classMap = ComposerStaticInit40b20a308214f7ee0fb661161f18ab08::$classMap; 33 33 34 34 }, null, ClassLoader::class); -
afterpay-gateway-for-woocommerce/trunk/vendor/composer/installed.php
r2972429 r2986471 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 0fad5e51d0a6de8476a97c6d54bc409bbdf40fe2',6 'reference' => '28e7f01931141bac147c154a8b6a043ef9498b8c', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' 0fad5e51d0a6de8476a97c6d54bc409bbdf40fe2',16 'reference' => '28e7f01931141bac147c154a8b6a043ef9498b8c', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.