👔 Implement the new “use-cards” onboarding flag

This commit is contained in:
Philipp Stracker 2025-03-05 16:52:37 +01:00
parent ac34da21e9
commit 57c2287739
No known key found for this signature in database

View file

@ -47,13 +47,14 @@ class PartnerReferralsData {
/** /**
* Returns the data. * Returns the data.
* *
* @param string[] $products The list of products to use ('PPCP', 'EXPRESS_CHECKOUT'). * @param string[] $products The list of products to use ('PPCP', 'EXPRESS_CHECKOUT').
* Default is based on DCC availability. * Default is based on DCC availability.
* @param string $onboarding_token A security token to finalize the onboarding process. * @param string $onboarding_token A security token to finalize the onboarding process.
* @param bool $use_subscriptions If the merchant requires subscription features. * @param bool $use_subscriptions If the merchant requires subscription features.
* @param bool $use_card_payments If the merchant wants to process credit card payments.
* @return array * @return array
*/ */
public function data( array $products = array(), string $onboarding_token = '', bool $use_subscriptions = null ) : array { public function data( array $products = array(), string $onboarding_token = '', bool $use_subscriptions = null, bool $use_card_payments = true ) : array {
if ( ! $products ) { if ( ! $products ) {
$products = array( $products = array(
$this->dcc_applies->for_country_currency() ? 'PPCP' : 'EXPRESS_CHECKOUT', $this->dcc_applies->for_country_currency() ? 'PPCP' : 'EXPRESS_CHECKOUT',
@ -109,7 +110,7 @@ class PartnerReferralsData {
'partner_config_override' => array( 'partner_config_override' => array(
'return_url' => $return_url, 'return_url' => $return_url,
'return_url_description' => $return_url_label, 'return_url_description' => $return_url_label,
'show_add_credit_card' => true, 'show_add_credit_card' => $use_card_payments,
), ),
'products' => $products, 'products' => $products,
'capabilities' => $capabilities, 'capabilities' => $capabilities,