From 661250756ec1d9591005d78ab0f02007e014c3fa Mon Sep 17 00:00:00 2001 From: Fabian Gerke <124085586+FabianGerke@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:32:42 +0100 Subject: [PATCH] fix: paypal modes (#870) --- apps/web/components/PayPal/PayPalCreditCardForm.vue | 2 +- apps/web/components/PayPal/PayPalExpressButton.vue | 2 +- apps/web/composables/useApplePay/useApplePay.ts | 2 +- apps/web/composables/useGooglePay/useGooglePay.ts | 2 +- apps/web/composables/usePayPal/usePayPal.ts | 2 +- apps/web/pages/readonly-checkout.vue | 2 +- docs/changelog/changelog_en.md | 1 + 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/web/components/PayPal/PayPalCreditCardForm.vue b/apps/web/components/PayPal/PayPalCreditCardForm.vue index 51bb868fc..b5ba76d48 100644 --- a/apps/web/components/PayPal/PayPalCreditCardForm.vue +++ b/apps/web/components/PayPal/PayPalCreditCardForm.vue @@ -103,7 +103,7 @@ onMounted(() => { if (order) { await executeOrder({ - mode: 'paypal', + mode: 'PAYPAL_UNBRANDED_CARD', plentyOrderId: Number.parseInt(orderGetters.getId(order)), paypalTransactionId: data.orderID, }); diff --git a/apps/web/components/PayPal/PayPalExpressButton.vue b/apps/web/components/PayPal/PayPalExpressButton.vue index bcbf27a5a..3c759d40e 100644 --- a/apps/web/components/PayPal/PayPalExpressButton.vue +++ b/apps/web/components/PayPal/PayPalExpressButton.vue @@ -90,7 +90,7 @@ const onApprove = async (data: OnApproveData) => { if (order) { await executeOrder({ - mode: 'paypal', + mode: 'PAYPAL', plentyOrderId: Number.parseInt(orderGetters.getId(order)), paypalTransactionId: data.orderID, }); diff --git a/apps/web/composables/useApplePay/useApplePay.ts b/apps/web/composables/useApplePay/useApplePay.ts index 0470ba26f..14e5ec298 100644 --- a/apps/web/composables/useApplePay/useApplePay.ts +++ b/apps/web/composables/useApplePay/useApplePay.ts @@ -120,7 +120,7 @@ export const useApplePay = () => { }); await executeOrder({ - mode: 'paypal', + mode: 'PAYPAL_APPLE_PAY', plentyOrderId: Number.parseInt(orderGetters.getId(order)), paypalTransactionId: transaction.id, }); diff --git a/apps/web/composables/useGooglePay/useGooglePay.ts b/apps/web/composables/useGooglePay/useGooglePay.ts index 361138b49..eb376a7c0 100644 --- a/apps/web/composables/useGooglePay/useGooglePay.ts +++ b/apps/web/composables/useGooglePay/useGooglePay.ts @@ -127,7 +127,7 @@ export const useGooglePay = () => { } await executeOrder({ - mode: 'paypal', + mode: 'PAYPAL_GOOGLE_PAY', plentyOrderId: Number.parseInt(orderGetters.getId(order)), paypalTransactionId: transaction.id, }); diff --git a/apps/web/composables/usePayPal/usePayPal.ts b/apps/web/composables/usePayPal/usePayPal.ts index d8eeeaa47..9cb550b69 100644 --- a/apps/web/composables/usePayPal/usePayPal.ts +++ b/apps/web/composables/usePayPal/usePayPal.ts @@ -182,7 +182,7 @@ export const usePayPal = () => { * @example * ``` ts * executeOrder({ - * mode: 'paypal', + * mode: 'PAYPAL', * plentyOrderId: 1234, * paypalTransactionId: 'UHIhhur3h2rh2', * }); diff --git a/apps/web/pages/readonly-checkout.vue b/apps/web/pages/readonly-checkout.vue index 0028b074a..3b0359194 100644 --- a/apps/web/pages/readonly-checkout.vue +++ b/apps/web/pages/readonly-checkout.vue @@ -213,7 +213,7 @@ const handleRegularOrder = async () => { if (data) { await executeOrder({ - mode: 'paypal', + mode: 'PAYPAL', plentyOrderId: Number.parseInt(orderGetters.getId(data)), paypalTransactionId: route?.query?.orderId?.toString() ?? '', }); diff --git a/docs/changelog/changelog_en.md b/docs/changelog/changelog_en.md index 22f46df0f..ad9e2815d 100644 --- a/docs/changelog/changelog_en.md +++ b/docs/changelog/changelog_en.md @@ -80,6 +80,7 @@ Each client supports two PWA instances. With this change, you can designate the - Improved CLS for hero skeleton. - Fixed, createOrder now handles errors more reliable and resets the buy button if an error occurs. - Added missing condition to block action. +- Fixed a bug where PayPal payments were stored as "Cash in Advance". ## v1.7.0 (2024-11-06) Overview of all changes