Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PT-13143): Remove experience context from card payment #39

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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