|
32 | 32 | trait RivertyPaymentTrait |
33 | 33 | { |
34 | 34 | /** |
35 | | - * Adds the Riverty profile tracking session id as device fingerprint. Profile tracking needs |
36 | | - * both the shop id and the Experian subdomain, and the id only exists once the storefront has |
37 | | - * rendered the tracking tag, so headless channels and gift card partials send nothing. |
| 35 | + * Forces the redirect flow for Riverty installments and adds the Riverty profile tracking |
| 36 | + * session id as device fingerprint. Profile tracking needs both the shop id and the Experian |
| 37 | + * subdomain, and the id only exists once the storefront has rendered the tracking tag, so |
| 38 | + * headless channels and gift card partials send nothing. |
38 | 39 | * |
39 | 40 | * @param SalesChannelContext $salesChannelContext |
40 | 41 | * @param AsyncPaymentTransactionStruct $transaction |
@@ -64,11 +65,25 @@ protected function getAdyenPaymentRequest( |
64 | 65 |
|
65 | 66 | $paymentMethodType = $stateData['paymentMethod']['type'] ?? static::getPaymentMethodCode(); |
66 | 67 |
|
67 | | - if ($paymentMethodType !== static::getPaymentMethodCode() |
68 | | - || !$this->rivertyFingerprintParamsProvider->isProfileTrackingEnabled( |
69 | | - $salesChannelContext->getSalesChannelId() |
70 | | - ) |
71 | | - ) { |
| 68 | + // Partial gift card payments keep their own payment method type, nothing Riverty specific applies. |
| 69 | + if ($paymentMethodType !== static::getPaymentMethodCode()) { |
| 70 | + return $paymentRequest; |
| 71 | + } |
| 72 | + |
| 73 | + // Installments is the only Riverty txvariant Adyen rejects without an explicit redirect |
| 74 | + // flow, and the only one without an Adyen Web component to set the subtype itself - the |
| 75 | + // plain redirect component it falls back to sends none. |
| 76 | + if (static::class === RivertyInstallmentsPaymentMethodHandler::class) { |
| 77 | + $rivertyPaymentMethod = $paymentRequest->getPaymentMethod(); |
| 78 | + |
| 79 | + if (!is_null($rivertyPaymentMethod)) { |
| 80 | + $rivertyPaymentMethod->setSubtype('redirect'); |
| 81 | + } |
| 82 | + } |
| 83 | + |
| 84 | + if (!$this->rivertyFingerprintParamsProvider->isProfileTrackingEnabled( |
| 85 | + $salesChannelContext->getSalesChannelId() |
| 86 | + )) { |
72 | 87 | return $paymentRequest; |
73 | 88 | } |
74 | 89 |
|
|
0 commit comments