mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
🔀 Merge branch 'trunk'
This commit is contained in:
commit
a6b0866745
67 changed files with 979 additions and 436 deletions
|
@ -1,7 +1,7 @@
|
|||
import MiniCartBootstap from './modules/ContextBootstrap/MiniCartBootstap';
|
||||
import SingleProductBootstap from './modules/ContextBootstrap/SingleProductBootstap';
|
||||
import CartBootstrap from './modules/ContextBootstrap/CartBootstap';
|
||||
import CheckoutBootstap from './modules/ContextBootstrap/CheckoutBootstap';
|
||||
import MiniCartBootstrap from './modules/ContextBootstrap/MiniCartBootstrap';
|
||||
import SingleProductBootstrap from './modules/ContextBootstrap/SingleProductBootstrap';
|
||||
import CartBootstrap from './modules/ContextBootstrap/CartBootstrap';
|
||||
import CheckoutBootstrap from './modules/ContextBootstrap/CheckoutBootstrap';
|
||||
import PayNowBootstrap from './modules/ContextBootstrap/PayNowBootstrap';
|
||||
import Renderer from './modules/Renderer/Renderer';
|
||||
import ErrorHandler from './modules/ErrorHandler';
|
||||
|
@ -23,7 +23,7 @@ import FormSaver from './modules/Helper/FormSaver';
|
|||
import FormValidator from './modules/Helper/FormValidator';
|
||||
import { loadPaypalScript } from './modules/Helper/ScriptLoading';
|
||||
import buttonModuleWatcher from './modules/ButtonModuleWatcher';
|
||||
import MessagesBootstrap from './modules/ContextBootstrap/MessagesBootstap';
|
||||
import MessagesBootstrap from './modules/ContextBootstrap/MessagesBootstrap';
|
||||
import { apmButtonsInit } from './modules/Helper/ApmButtons';
|
||||
|
||||
// TODO: could be a good idea to have a separate spinner for each gateway,
|
||||
|
@ -246,7 +246,7 @@ const bootstrap = () => {
|
|||
);
|
||||
|
||||
if ( PayPalCommerceGateway.mini_cart_buttons_enabled === '1' ) {
|
||||
const miniCartBootstrap = new MiniCartBootstap(
|
||||
const miniCartBootstrap = new MiniCartBootstrap(
|
||||
PayPalCommerceGateway,
|
||||
renderer,
|
||||
errorHandler
|
||||
|
@ -264,7 +264,7 @@ const bootstrap = () => {
|
|||
( PayPalCommerceGateway.single_product_buttons_enabled === '1' ||
|
||||
hasMessages() )
|
||||
) {
|
||||
const singleProductBootstrap = new SingleProductBootstap(
|
||||
const singleProductBootstrap = new SingleProductBootstrap(
|
||||
PayPalCommerceGateway,
|
||||
renderer,
|
||||
errorHandler
|
||||
|
@ -289,17 +289,17 @@ const bootstrap = () => {
|
|||
}
|
||||
|
||||
if ( context === 'checkout' ) {
|
||||
const checkoutBootstap = new CheckoutBootstap(
|
||||
const checkoutBootstrap = new CheckoutBootstrap(
|
||||
PayPalCommerceGateway,
|
||||
renderer,
|
||||
spinner,
|
||||
errorHandler
|
||||
);
|
||||
|
||||
checkoutBootstap.init();
|
||||
checkoutBootstrap.init();
|
||||
buttonModuleWatcher.registerContextBootstrap(
|
||||
'checkout',
|
||||
checkoutBootstap
|
||||
checkoutBootstrap
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
dispatchButtonEvent,
|
||||
} from '../Helper/PaymentButtonHelpers';
|
||||
|
||||
class CheckoutBootstap {
|
||||
class CheckoutBootstrap {
|
||||
constructor( gateway, renderer, spinner, errorHandler ) {
|
||||
this.gateway = gateway;
|
||||
this.renderer = renderer;
|
||||
|
@ -344,4 +344,4 @@ class CheckoutBootstap {
|
|||
}
|
||||
}
|
||||
|
||||
export default CheckoutBootstap;
|
||||
export default CheckoutBootstrap;
|
|
@ -1,7 +1,7 @@
|
|||
import CartActionHandler from '../ActionHandler/CartActionHandler';
|
||||
import BootstrapHelper from '../Helper/BootstrapHelper';
|
||||
|
||||
class MiniCartBootstap {
|
||||
class MiniCartBootstrap {
|
||||
constructor( gateway, renderer, errorHandler ) {
|
||||
this.gateway = gateway;
|
||||
this.renderer = renderer;
|
||||
|
@ -71,4 +71,4 @@ class MiniCartBootstap {
|
|||
}
|
||||
}
|
||||
|
||||
export default MiniCartBootstap;
|
||||
export default MiniCartBootstrap;
|
|
@ -1,7 +1,7 @@
|
|||
import CheckoutBootstap from './CheckoutBootstap';
|
||||
import CheckoutBootstrap from './CheckoutBootstrap';
|
||||
import { isChangePaymentPage } from '../Helper/Subscriptions';
|
||||
|
||||
class PayNowBootstrap extends CheckoutBootstap {
|
||||
class PayNowBootstrap extends CheckoutBootstrap {
|
||||
constructor( gateway, renderer, spinner, errorHandler ) {
|
||||
super( gateway, renderer, spinner, errorHandler );
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import { strRemoveWord, strAddWord, throttle } from '../Helper/Utils';
|
|||
import merge from 'deepmerge';
|
||||
import { debounce } from '../../../../../ppcp-blocks/resources/js/Helper/debounce';
|
||||
|
||||
class SingleProductBootstap {
|
||||
class SingleProductBootstrap {
|
||||
constructor( gateway, renderer, errorHandler ) {
|
||||
this.gateway = gateway;
|
||||
this.renderer = renderer;
|
||||
|
@ -162,6 +162,12 @@ class SingleProductBootstap {
|
|||
},
|
||||
]
|
||||
.map( ( f ) => f() )
|
||||
.sort((a, b) => {
|
||||
if (parseInt(a.replace(/\D/g, '')) < parseInt(b.replace(/\D/g, '')) ) {
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
})
|
||||
.find( ( val ) => val );
|
||||
|
||||
if ( typeof priceText === 'undefined' ) {
|
||||
|
@ -368,4 +374,4 @@ class SingleProductBootstap {
|
|||
}
|
||||
}
|
||||
|
||||
export default SingleProductBootstap;
|
||||
export default SingleProductBootstrap;
|
|
@ -15,7 +15,7 @@ class PreviewButtonManager {
|
|||
|
||||
/**
|
||||
* Resolves the promise.
|
||||
* Used by `this.boostrap()` to process enqueued initialization logic.
|
||||
* Used by `this.bootstrap()` to process enqueued initialization logic.
|
||||
*/
|
||||
#onInitResolver;
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ class DisabledFundingSources {
|
|||
/**
|
||||
* Filters the final list of disabled funding sources.
|
||||
*
|
||||
* @param array $diabled_funding The filter value, funding sources to be disabled.
|
||||
* @param array $disable_funding The filter value, funding sources to be disabled.
|
||||
* @param array $flags Decision flags to provide more context to filters.
|
||||
*/
|
||||
$disable_funding = apply_filters(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Handles the Early Order logic, when we need to create the WC_Order by ourselfs.
|
||||
* Handles the Early Order logic, when we need to create the WC_Order by ourselves.
|
||||
*
|
||||
* @package WooCommerce\PayPalCommerce\Button\Helper
|
||||
*/
|
||||
|
|
|
@ -20,7 +20,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Factory\CardAuthenticationResultFactory
|
|||
class ThreeDSecure {
|
||||
|
||||
const NO_DECISION = 0;
|
||||
const PROCCEED = 1;
|
||||
const PROCEED = 1;
|
||||
const REJECT = 2;
|
||||
const RETRY = 3;
|
||||
|
||||
|
@ -84,7 +84,7 @@ class ThreeDSecure {
|
|||
$this->logger->info( '3DS Authentication Result: ' . wc_print_r( $result->to_array(), true ) );
|
||||
|
||||
if ( $result->liability_shift() === AuthResult::LIABILITY_SHIFT_POSSIBLE ) {
|
||||
return $this->return_decision( self::PROCCEED, $order );
|
||||
return $this->return_decision( self::PROCEED, $order );
|
||||
}
|
||||
|
||||
if ( $result->liability_shift() === AuthResult::LIABILITY_SHIFT_UNKNOWN ) {
|
||||
|
@ -124,19 +124,19 @@ class ThreeDSecure {
|
|||
$result->enrollment_status() === AuthResult::ENROLLMENT_STATUS_BYPASS
|
||||
&& ! $result->authentication_result()
|
||||
) {
|
||||
return self::PROCCEED;
|
||||
return self::PROCEED;
|
||||
}
|
||||
if (
|
||||
$result->enrollment_status() === AuthResult::ENROLLMENT_STATUS_UNAVAILABLE
|
||||
&& ! $result->authentication_result()
|
||||
) {
|
||||
return self::PROCCEED;
|
||||
return self::PROCEED;
|
||||
}
|
||||
if (
|
||||
$result->enrollment_status() === AuthResult::ENROLLMENT_STATUS_NO
|
||||
&& ! $result->authentication_result()
|
||||
) {
|
||||
return self::PROCCEED;
|
||||
return self::PROCEED;
|
||||
}
|
||||
|
||||
if ( $result->authentication_result() === AuthResult::AUTHENTICATION_RESULT_REJECTED ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue