Skip to content

Commit

Permalink
fix(PT-13143): Remove experience context from card payment
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisGarding authored and mitelg committed Oct 17, 2023
1 parent 28ef8d6 commit 0feaaf6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public function supports($paymentType)
*/
public function createPaymentSourceValue(PayPalOrderParameter $orderParameter)
{
$paymentSourceValue = new Card();
$paymentSourceValue->setExperienceContext($this->createExperienceContext($orderParameter));

return $paymentSourceValue;
return new Card();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,7 @@ public function testCreateOrderForAdvancedCreditDebitCard()
$paymentSource = $result->getPaymentSource();
static::assertInstanceOf(PaymentSource::class, $paymentSource);
static::assertInstanceOf(PaymentSource\Card::class, $paymentSource->getCard());
$experienceContext = $paymentSource->getCard()->getExperienceContext();
static::assertInstanceOf(PaymentSource\ExperienceContext::class, $experienceContext);

static::assertSame('de-DE', $experienceContext->getLocale());
static::assertSame('UnitTest AG', $experienceContext->getBrandName());
static::assertSame('IMMEDIATE_PAYMENT_REQUIRED', $experienceContext->getPaymentMethodPreference());
static::assertSame('PAYPAL', $experienceContext->getPaymentMethodSelected());

static::assertSame('PAY_NOW', $experienceContext->getUserAction());
static::assertSame('SET_PROVIDED_ADDRESS', $experienceContext->getShippingPreference());
static::assertNull($paymentSource->getCard()->getExperienceContext());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ public function testCreatePaymentSource()
$paymentSourceValueResult = $result->getCard();
static::assertInstanceOf(PaymentSource\Card::class, $paymentSourceValueResult);

$experienceContextValueResult = $paymentSourceValueResult->getExperienceContext();
static::assertInstanceOf(PaymentSource\ExperienceContext::class, $experienceContextValueResult);

static::assertSame('SET_PROVIDED_ADDRESS', $experienceContextValueResult->getShippingPreference());
static::assertSame('PAY_NOW', $experienceContextValueResult->getUserAction());
static::assertNull($paymentSourceValueResult->getExperienceContext());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use SwagPaymentPayPalUnified\PayPalBundle\Components\SettingsServiceInterface;
use SwagPaymentPayPalUnified\PayPalBundle\PaymentType;
use SwagPaymentPayPalUnified\PayPalBundle\V2\Api\Order\PaymentSource\Card;
use SwagPaymentPayPalUnified\PayPalBundle\V2\Api\Order\PaymentSource\ExperienceContext;
use SwagPaymentPayPalUnified\Tests\Functional\AssertStringContainsTrait;
use SwagPaymentPayPalUnified\Tests\Functional\ContainerTrait;
use SwagPaymentPayPalUnified\Tests\Functional\ShopRegistrationTrait;
Expand Down Expand Up @@ -48,16 +47,7 @@ public function testCreatePaymentSourceValue()

static::assertInstanceOf(Card::class, $result);

$experienceContextResult = $result->getExperienceContext();
static::assertInstanceOf(ExperienceContext::class, $experienceContextResult);

static::assertSame('de-DE', $experienceContextResult->getLocale());
static::assertSame('anyBrandName', $experienceContextResult->getBrandName());
static::assertSame('IMMEDIATE_PAYMENT_REQUIRED', $experienceContextResult->getPaymentMethodPreference());
static::assertSame('PAYPAL', $experienceContextResult->getPaymentMethodSelected());
static::assertSame('NO_PREFERENCE', $experienceContextResult->getLandingPage());
static::assertSame('SET_PROVIDED_ADDRESS', $experienceContextResult->getShippingPreference());
static::assertSame('PAY_NOW', $experienceContextResult->getUserAction());
static::assertNull($result->getExperienceContext());
}

/**
Expand Down
2 changes: 2 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
<changelog version="6.1.2">
<changes lang="de">
PT-13142 - Verbessert die Bearbeitung von Webhooks;
PT-13143 - Behebt ein Problem mit der Kreditkarten Zahlung;
</changes>
<changes lang="en">
PT-13142 - Improves the processing of webhooks;
PT-13143 - Fixes a problem with credit card payment;
</changes>
</changelog>

Expand Down

0 comments on commit 0feaaf6

Please sign in to comment.