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

Remove issuers from ideal #2495

Merged
merged 7 commits into from
Jan 30, 2025
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
5 changes: 5 additions & 0 deletions .changeset/clean-houses-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/magento-payment-multisafepay': patch
---

Remove issuers field from MultiSafePay in preparation for iDeal 2. Please not that this change requires an upgrade to the Magento module as well.
7 changes: 7 additions & 0 deletions .changeset/eight-wolves-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@graphcommerce/magento-payment-adyen': patch
'@graphcommerce/magento-payment-multisafepay': patch
'@graphcommerce/mollie-magento-payment': patch
---

Remove issuer list from ideal payment method
5 changes: 5 additions & 0 deletions .changeset/mighty-swans-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/algolia-insights': patch
---

Solve issue where the useSendEventAlgolia hook would sometimes throw an error during purchase
2 changes: 1 addition & 1 deletion packages/algolia-insights/hooks/useSendAlgoliaEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const dataLayerToAlgoliaMap: {

const objectIDs = eventData.items.map((item) => atob(item.item_uid))
const relevant = objectIDs.map((objectID) => mapping[objectID])
const filters = [...new Set(...relevant.map((item) => item.filters))]
const filters = [...new Set(...relevant.map((item) => item?.filters ?? []))]

if (filters.length > 0) {
// There is a max of 10 filters per event, if there are more than 10 items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function HppOptions(props: PaymentOptionsProps) {
/** To use an external Pay button we register the current form to be handled there as well. */
useFormCompose({ form, step, submit, key })

if (!conf?.issuers?.length) return <form onSubmit={submit} noValidate />
if (!conf?.issuers?.length || brandCode === 'ideal') return <form onSubmit={submit} noValidate />

/**
* This is the form that the user can fill in. In this case we don't wat the user to fill in
Expand All @@ -95,7 +95,7 @@ export function HppOptions(props: PaymentOptionsProps) {
SelectProps={{ native: true, displayEmpty: true }}
error={formState.isSubmitted && !!formState.errors.issuer}
helperText={formState.isSubmitted && formState.errors.issuer?.message}
label={brandCode === 'ideal' ? 'Select your bank' : conf?.name}
label={conf?.name}
required
>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function MSPPaymentPlaceOrder(props: PaymentPlaceOrderProps) {

if (!selectedMethod?.code) {
throwGenericPlaceOrderError()
return
}

if (url?.error || !url?.payment_url) {
Expand All @@ -46,7 +47,7 @@ export function MSPPaymentPlaceOrder(props: PaymentPlaceOrderProps) {
}

await lock({
method: selectedMethod.code,
method: selectedMethod?.code ?? '',
order_number: result.data.placeOrder.order.order_number,
})

Expand All @@ -64,9 +65,9 @@ export function MSPPaymentPlaceOrder(props: PaymentPlaceOrderProps) {

return (
<form onSubmit={submit}>
{form.data?.placeOrder?.order.multisafepay_payment_url.error && (
{form.data?.placeOrder?.order?.multisafepay_payment_url.error && (
<ErrorSnackbar open>
<>{form.data?.placeOrder?.order.multisafepay_payment_url.error}</>
<>{form.data?.placeOrder?.order?.multisafepay_payment_url?.error}</>
</ErrorSnackbar>
)}
<ApolloErrorSnackbar error={restoreResult.error} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ fragment MSPAvailablePaymentMethod on AvailablePaymentMethod
image
is_preselected
}
multisafepay_available_issuers {
code
description
}
}
5 changes: 5 additions & 0 deletions packages/magento-payment-multisafepay/graphql/MSPCart.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
query MSPCart($cartId: String!) {
multisafepayCart(cart_id: $cartId) {
...CartTotals
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
query MSPPaymentRequestData($cartId: String!) {
multisafepayPaymentRequestData(cart_id: $cartId) {
apiToken
payment_component_template_id
storeId
apiTokenLifeTime
applePayButton {
additionalTotalItems {
amount
label
}
applePayButtonId
cartItems {
label
price
}
getMerchantSessionUrl
getMerchantSessionUrl
isActive
}
cartTotal
currency
environment
googlePayButton {
accountId
googlePayButtonId
isActive
merchantInfo {
merchantId
merchantName
}
mode
}
locale
paymentComponentConfig {
additionalInfo {
image
is_preselected
vaultCode
}
gatewayCode
paymentMethod
paymentType
tokens {
bin
code
display
expired
expiry_date
last4
model
name_holder
token
}
}
paymentComponentContainerId
}
}
6 changes: 3 additions & 3 deletions packages/magento-payment-multisafepay/methods.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { PaymentModule } from '@graphcommerce/magento-cart-payment-method'
import { type PaymentModule } from '@graphcommerce/magento-cart-payment-method'
import { PaymentMethodOptionsNoop } from '@graphcommerce/magento-cart-payment-method/PaymentMethodOptionsNoop/PaymentMethodOptionsNoop'
import { MSPPaymentActionCard } from './components/MSPPaymentActionCard/MSPPaymentActionCard'
import { MSPPaymentHandler } from './components/MSPPaymentHandler/MSPPaymentHandler'
import { MSPPaymentOptions } from './components/MSPPaymentOptions/MSPPaymentOptions'
import { MSPPaymentPlaceOrder } from './components/MSPPaymentPlaceOrder/MSPPaymentPlaceOrder'

const mspModule: PaymentModule = {
PaymentOptions: MSPPaymentOptions,
PaymentOptions: PaymentMethodOptionsNoop,
PaymentActionCard: MSPPaymentActionCard,
PaymentHandler: MSPPaymentHandler,
PaymentPlaceOrder: MSPPaymentPlaceOrder,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 1 addition & 9 deletions packages/mollie-magento-payment/methods.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { PaymentModule } from '@graphcommerce/magento-cart-payment-method'
import { PaymentMethodOptionsNoop } from '@graphcommerce/magento-cart-payment-method'
import { MollieActionCard } from './components/MollieActionCard/MollieActionCard'
import { MollieIdealOptions } from './components/MollieOptionsIssuer/MollieIdealOptions'
import { MolliePaymentHandler } from './components/MolliePaymentHandler/MolliePaymentHandler'
import { MolliePlaceOrder } from './components/MolliePlaceOrder/MolliePlaceOrder'

Expand All @@ -12,13 +11,6 @@ const mollieModule: PaymentModule = {
PaymentPlaceOrder: MolliePlaceOrder,
}

const idealModule: PaymentModule = {
PaymentOptions: MollieIdealOptions,
PaymentActionCard: MollieActionCard,
PaymentHandler: MolliePaymentHandler,
PaymentPlaceOrder: MolliePlaceOrder,
}

/** List is extracted from https://github.com/mollie/magento2/blob/master/etc/payment.xml */

export const molliepayments: Record<string, PaymentModule> = {
Expand All @@ -32,7 +24,7 @@ export const molliepayments: Record<string, PaymentModule> = {
mollie_methods_eps: mollieModule,
mollie_methods_giftcard: mollieModule,
mollie_methods_giropay: mollieModule,
mollie_methods_ideal: idealModule,
mollie_methods_ideal: mollieModule,
mollie_methods_in3: mollieModule,
mollie_methods_kbc: mollieModule,
mollie_methods_klarnapaylater: mollieModule,
Expand Down