Fix “data structure with flags” tests

Following default assuptions changed:

1. The "BILLING_AGREEMENT” feature is always sent
2. The “PAYPAL_WALLET_VAULTING_ADVANCED” flag only depends on the ACDC eligbility (not subscription-opt-in)
This commit is contained in:
Philipp Stracker 2025-05-23 18:08:29 +02:00
parent ca93ce4b83
commit cb6fa6eb9f
No known key found for this signature in database

View file

@ -127,6 +127,7 @@ class PartnerReferralsDataTest extends TestCase {
true, // With cards?
true, // ACDC eligible?
[
'capabilities' => [ 'PAYPAL_WALLET_VAULTING_ADVANCED' ],
'show_add_credit_card' => true,
'has_vault_features' => false,
],
@ -136,6 +137,7 @@ class PartnerReferralsDataTest extends TestCase {
false, // With cards?
true, // ACDC eligible?
[
'capabilities' => [ 'PAYPAL_WALLET_VAULTING_ADVANCED' ],
'show_add_credit_card' => false,
'has_vault_features' => false,
],
@ -249,9 +251,7 @@ class PartnerReferralsDataTest extends TestCase {
$expected['partner_config_override']['show_add_credit_card'] = $expected_changes['show_add_credit_card'];
if ( $has_subscriptions ) {
$expected['operations'][0]['api_integration_preference']['rest_api_integration']['first_party_details']['features'][] = 'BILLING_AGREEMENT';
}
$expected['operations'][0]['api_integration_preference']['rest_api_integration']['first_party_details']['features'][] = 'BILLING_AGREEMENT';
if ( $expected_changes['has_vault_features'] ) {
$expected['operations'][0]['api_integration_preference']['rest_api_integration']['first_party_details']['features'][] = 'FUTURE_PAYMENT';