From 07acce0d6be14157fee393222e3450e1c2fed988 Mon Sep 17 00:00:00 2001 From: raoulritter <59527829+raoulritter@users.noreply.github.com> Date: Mon, 28 Nov 2022 11:23:48 +0100 Subject: [PATCH 1/4] [PW-7455] - Fix Showpare Affiliate marketing for Adyen Payment Method (#323) * Fix Showpare Affiliate marketing * remove debuggers --- .../app/storefront/src/checkout/confirm-order.plugin.js | 3 +++ .../page/checkout/confirm/confirm-payment.html.twig | 2 ++ src/Subscriber/PaymentSubscriber.php | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/src/Resources/app/storefront/src/checkout/confirm-order.plugin.js b/src/Resources/app/storefront/src/checkout/confirm-order.plugin.js index b9b4c866..68ce201d 100644 --- a/src/Resources/app/storefront/src/checkout/confirm-order.plugin.js +++ b/src/Resources/app/storefront/src/checkout/confirm-order.plugin.js @@ -160,6 +160,9 @@ export default class ConfirmOrderPlugin extends Plugin { const orderId = adyenCheckoutOptions.orderId; let url = null; let callback = null; + formData.set('affiliateCode', adyenCheckoutOptions.affiliateCode); + formData.set('campaignCode', adyenCheckoutOptions.campaignCode); + if (!!orderId) { //Only used if the order is being edited formData.set('orderId', orderId); url = adyenCheckoutOptions.updatePaymentUrl; diff --git a/src/Resources/views/storefront/page/checkout/confirm/confirm-payment.html.twig b/src/Resources/views/storefront/page/checkout/confirm/confirm-payment.html.twig index c7b9c811..1d12e861 100644 --- a/src/Resources/views/storefront/page/checkout/confirm/confirm-payment.html.twig +++ b/src/Resources/views/storefront/page/checkout/confirm/confirm-payment.html.twig @@ -53,6 +53,8 @@ data-selected-payment-method-handler="{{ adyenFrontendData.selectedPaymentMethodHandler }}" data-selected-payment-method-plugin-id="{{ adyenFrontendData.selectedPaymentMethodPluginId }}" data-display-save-credit-card-option="{{ adyenFrontendData.displaySaveCreditCardOption }}" + data-affiliate-code="{{ adyenFrontendData.affiliateCode }}" + data-campaign-code="{{ adyenFrontendData.campaignCode }}" >