mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
👔 Start to customize the production ISU link
This commit is contained in:
parent
0e30ecde82
commit
1a36144095
2 changed files with 34 additions and 0 deletions
|
@ -16,6 +16,8 @@ use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PartnerReferrals
|
* Class PartnerReferrals
|
||||||
|
*
|
||||||
|
* @see https://developer.paypal.com/docs/api/partner-referrals/v2/
|
||||||
*/
|
*/
|
||||||
class PartnerReferrals {
|
class PartnerReferrals {
|
||||||
|
|
||||||
|
|
|
@ -36,5 +36,37 @@ export const flags = ( state ) => {
|
||||||
export const determineProducts = ( state ) => {
|
export const determineProducts = ( state ) => {
|
||||||
const derivedProducts = [];
|
const derivedProducts = [];
|
||||||
|
|
||||||
|
const { isCasualSeller, areOptionalPaymentMethodsEnabled } =
|
||||||
|
persistentData( state );
|
||||||
|
const { canUseVaulting, canUseCardPayments } = flags( state );
|
||||||
|
|
||||||
|
if ( ! canUseCardPayments || ! areOptionalPaymentMethodsEnabled ) {
|
||||||
|
/**
|
||||||
|
* Branch 1: Credit Card Payments not available.
|
||||||
|
* The store uses the Express-checkout product.
|
||||||
|
*/
|
||||||
|
derivedProducts.push( 'EXPRESS_CHECKOUT' );
|
||||||
|
} else if ( isCasualSeller ) {
|
||||||
|
/**
|
||||||
|
* Branch 2: Merchant has no business.
|
||||||
|
* The store uses the Express-checkout product.
|
||||||
|
*/
|
||||||
|
derivedProducts.push( 'EXPRESS_CHECKOUT' );
|
||||||
|
|
||||||
|
// TODO: Add the "BCDC" product/feature
|
||||||
|
// Requirement: "EXPRESS_CHECKOUT with BCDC"
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
|
* Branch 3: Merchant is business, and can use CC payments.
|
||||||
|
* The store uses the advanced PPCP product.
|
||||||
|
*/
|
||||||
|
derivedProducts.push( 'PPCP' );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( canUseVaulting ) {
|
||||||
|
// TODO: Add the "Vaulting" product/feature
|
||||||
|
// Requirement: "... with Vault"
|
||||||
|
}
|
||||||
|
|
||||||
return derivedProducts;
|
return derivedProducts;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue