@graphcommerce/magento-payment-multisafepay 9.0.4-canary.12 → 9.0.4-canary.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/components/MSPPaymentPlaceOrder/MSPPaymentPlaceOrder.tsx +4 -3
- package/graphql/MSPAvailablePaymentMethod.graphql +0 -4
- package/graphql/MSPCart.graphql +5 -0
- package/graphql/MSPPaymentRequestData.graphql +58 -0
- package/methods.ts +3 -3
- package/package.json +17 -17
- package/components/MSPPaymentOptions/MSPPaymentOptions.graphql +0 -7
- package/components/MSPPaymentOptions/MSPPaymentOptions.tsx +0 -56
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @graphcommerce/magento-payment-multisafepay
|
|
2
2
|
|
|
3
|
+
## 9.0.4-canary.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2495](https://github.com/graphcommerce-org/graphcommerce/pull/2495) [`cd386e3`](https://github.com/graphcommerce-org/graphcommerce/commit/cd386e3bce61256bab46cca88aacc7c4aa4ac415) - Remove issuers field from MultiSafePay in preparation for iDeal 2. Please not that this change requires an upgrade to the Magento module as well. ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
8
|
+
|
|
9
|
+
- [#2495](https://github.com/graphcommerce-org/graphcommerce/pull/2495) [`0fc9805`](https://github.com/graphcommerce-org/graphcommerce/commit/0fc98051b87cd7fc0363609b50211d2d7382a84d) - Remove issuer list from ideal payment method ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
10
|
+
|
|
11
|
+
## 9.0.4-canary.13
|
|
12
|
+
|
|
3
13
|
## 9.0.4-canary.12
|
|
4
14
|
|
|
5
15
|
## 9.0.4-canary.11
|
|
@@ -35,6 +35,7 @@ export function MSPPaymentPlaceOrder(props: PaymentPlaceOrderProps) {
|
|
|
35
35
|
|
|
36
36
|
if (!selectedMethod?.code) {
|
|
37
37
|
throwGenericPlaceOrderError()
|
|
38
|
+
return
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
if (url?.error || !url?.payment_url) {
|
|
@@ -46,7 +47,7 @@ export function MSPPaymentPlaceOrder(props: PaymentPlaceOrderProps) {
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
await lock({
|
|
49
|
-
method: selectedMethod
|
|
50
|
+
method: selectedMethod?.code ?? '',
|
|
50
51
|
order_number: result.data.placeOrder.order.order_number,
|
|
51
52
|
})
|
|
52
53
|
|
|
@@ -64,9 +65,9 @@ export function MSPPaymentPlaceOrder(props: PaymentPlaceOrderProps) {
|
|
|
64
65
|
|
|
65
66
|
return (
|
|
66
67
|
<form onSubmit={submit}>
|
|
67
|
-
{form.data?.placeOrder?.order
|
|
68
|
+
{form.data?.placeOrder?.order?.multisafepay_payment_url.error && (
|
|
68
69
|
<ErrorSnackbar open>
|
|
69
|
-
<>{form.data?.placeOrder?.order
|
|
70
|
+
<>{form.data?.placeOrder?.order?.multisafepay_payment_url?.error}</>
|
|
70
71
|
</ErrorSnackbar>
|
|
71
72
|
)}
|
|
72
73
|
<ApolloErrorSnackbar error={restoreResult.error} />
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
query MSPPaymentRequestData($cartId: String!) {
|
|
2
|
+
multisafepayPaymentRequestData(cart_id: $cartId) {
|
|
3
|
+
apiToken
|
|
4
|
+
payment_component_template_id
|
|
5
|
+
storeId
|
|
6
|
+
apiTokenLifeTime
|
|
7
|
+
applePayButton {
|
|
8
|
+
additionalTotalItems {
|
|
9
|
+
amount
|
|
10
|
+
label
|
|
11
|
+
}
|
|
12
|
+
applePayButtonId
|
|
13
|
+
cartItems {
|
|
14
|
+
label
|
|
15
|
+
price
|
|
16
|
+
}
|
|
17
|
+
getMerchantSessionUrl
|
|
18
|
+
getMerchantSessionUrl
|
|
19
|
+
isActive
|
|
20
|
+
}
|
|
21
|
+
cartTotal
|
|
22
|
+
currency
|
|
23
|
+
environment
|
|
24
|
+
googlePayButton {
|
|
25
|
+
accountId
|
|
26
|
+
googlePayButtonId
|
|
27
|
+
isActive
|
|
28
|
+
merchantInfo {
|
|
29
|
+
merchantId
|
|
30
|
+
merchantName
|
|
31
|
+
}
|
|
32
|
+
mode
|
|
33
|
+
}
|
|
34
|
+
locale
|
|
35
|
+
paymentComponentConfig {
|
|
36
|
+
additionalInfo {
|
|
37
|
+
image
|
|
38
|
+
is_preselected
|
|
39
|
+
vaultCode
|
|
40
|
+
}
|
|
41
|
+
gatewayCode
|
|
42
|
+
paymentMethod
|
|
43
|
+
paymentType
|
|
44
|
+
tokens {
|
|
45
|
+
bin
|
|
46
|
+
code
|
|
47
|
+
display
|
|
48
|
+
expired
|
|
49
|
+
expiry_date
|
|
50
|
+
last4
|
|
51
|
+
model
|
|
52
|
+
name_holder
|
|
53
|
+
token
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
paymentComponentContainerId
|
|
57
|
+
}
|
|
58
|
+
}
|
package/methods.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PaymentModule } from '@graphcommerce/magento-cart-payment-method'
|
|
2
|
+
import { PaymentMethodOptionsNoop } from '@graphcommerce/magento-cart-payment-method/PaymentMethodOptionsNoop/PaymentMethodOptionsNoop'
|
|
2
3
|
import { MSPPaymentActionCard } from './components/MSPPaymentActionCard/MSPPaymentActionCard'
|
|
3
4
|
import { MSPPaymentHandler } from './components/MSPPaymentHandler/MSPPaymentHandler'
|
|
4
|
-
import { MSPPaymentOptions } from './components/MSPPaymentOptions/MSPPaymentOptions'
|
|
5
5
|
import { MSPPaymentPlaceOrder } from './components/MSPPaymentPlaceOrder/MSPPaymentPlaceOrder'
|
|
6
6
|
|
|
7
7
|
const mspModule: PaymentModule = {
|
|
8
|
-
PaymentOptions:
|
|
8
|
+
PaymentOptions: PaymentMethodOptionsNoop,
|
|
9
9
|
PaymentActionCard: MSPPaymentActionCard,
|
|
10
10
|
PaymentHandler: MSPPaymentHandler,
|
|
11
11
|
PaymentPlaceOrder: MSPPaymentPlaceOrder,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-payment-multisafepay",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.0.4-canary.
|
|
5
|
+
"version": "9.0.4-canary.14",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,22 +12,22 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/ecommerce-ui": "^9.0.4-canary.
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.4-canary.
|
|
17
|
-
"@graphcommerce/graphql": "^9.0.4-canary.
|
|
18
|
-
"@graphcommerce/graphql-mesh": "^9.0.4-canary.
|
|
19
|
-
"@graphcommerce/image": "^9.0.4-canary.
|
|
20
|
-
"@graphcommerce/magento-cart": "^9.0.4-canary.
|
|
21
|
-
"@graphcommerce/magento-cart-checkout": "^9.0.4-canary.
|
|
22
|
-
"@graphcommerce/magento-cart-payment-method": "^9.0.4-canary.
|
|
23
|
-
"@graphcommerce/magento-cart-shipping-address": "^9.0.4-canary.
|
|
24
|
-
"@graphcommerce/magento-product": "^9.0.4-canary.
|
|
25
|
-
"@graphcommerce/magento-product-configurable": "^9.0.4-canary.
|
|
26
|
-
"@graphcommerce/magento-store": "^9.0.4-canary.
|
|
27
|
-
"@graphcommerce/next-ui": "^9.0.4-canary.
|
|
28
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.4-canary.
|
|
29
|
-
"@graphcommerce/react-hook-form": "^9.0.4-canary.
|
|
30
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.4-canary.
|
|
15
|
+
"@graphcommerce/ecommerce-ui": "^9.0.4-canary.14",
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.4-canary.14",
|
|
17
|
+
"@graphcommerce/graphql": "^9.0.4-canary.14",
|
|
18
|
+
"@graphcommerce/graphql-mesh": "^9.0.4-canary.14",
|
|
19
|
+
"@graphcommerce/image": "^9.0.4-canary.14",
|
|
20
|
+
"@graphcommerce/magento-cart": "^9.0.4-canary.14",
|
|
21
|
+
"@graphcommerce/magento-cart-checkout": "^9.0.4-canary.14",
|
|
22
|
+
"@graphcommerce/magento-cart-payment-method": "^9.0.4-canary.14",
|
|
23
|
+
"@graphcommerce/magento-cart-shipping-address": "^9.0.4-canary.14",
|
|
24
|
+
"@graphcommerce/magento-product": "^9.0.4-canary.14",
|
|
25
|
+
"@graphcommerce/magento-product-configurable": "^9.0.4-canary.14",
|
|
26
|
+
"@graphcommerce/magento-store": "^9.0.4-canary.14",
|
|
27
|
+
"@graphcommerce/next-ui": "^9.0.4-canary.14",
|
|
28
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.4-canary.14",
|
|
29
|
+
"@graphcommerce/react-hook-form": "^9.0.4-canary.14",
|
|
30
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.4-canary.14",
|
|
31
31
|
"@lingui/core": "^4.2.1",
|
|
32
32
|
"@lingui/macro": "^4.2.1",
|
|
33
33
|
"@lingui/react": "^4.2.1",
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FormPersist,
|
|
3
|
-
SelectElement,
|
|
4
|
-
useFormAutoSubmit,
|
|
5
|
-
useFormCompose,
|
|
6
|
-
} from '@graphcommerce/ecommerce-ui'
|
|
7
|
-
import { useFormGqlMutationCart } from '@graphcommerce/magento-cart'
|
|
8
|
-
import type { PaymentOptionsProps } from '@graphcommerce/magento-cart-payment-method'
|
|
9
|
-
import { filterNonNullableKeys, FormRow } from '@graphcommerce/next-ui'
|
|
10
|
-
import { i18n } from '@lingui/core'
|
|
11
|
-
import { MSPPaymentOptionsDocument } from './MSPPaymentOptions.gql'
|
|
12
|
-
|
|
13
|
-
/** It sets the selected payment method on the cart. */
|
|
14
|
-
export function MSPPaymentOptions(props: PaymentOptionsProps) {
|
|
15
|
-
const { code, step, multisafepay_available_issuers } = props
|
|
16
|
-
|
|
17
|
-
const form = useFormGqlMutationCart(MSPPaymentOptionsDocument, { mode: 'onChange' })
|
|
18
|
-
|
|
19
|
-
const { handleSubmit, register, control } = form
|
|
20
|
-
|
|
21
|
-
const submit = handleSubmit(() => {})
|
|
22
|
-
useFormAutoSubmit({ form, submit, forceInitialSubmit: true })
|
|
23
|
-
|
|
24
|
-
const key = `PaymentMethodOptions_${code}`
|
|
25
|
-
useFormCompose({ form, step, submit, key })
|
|
26
|
-
|
|
27
|
-
const issuers = filterNonNullableKeys(multisafepay_available_issuers, ['code', 'description'])
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<form onSubmit={submit} noValidate>
|
|
31
|
-
<input type='hidden' value={code} {...register('paymentMethod.code')} />
|
|
32
|
-
|
|
33
|
-
{code === 'multisafepay_ideal' && issuers.length && (
|
|
34
|
-
<FormRow>
|
|
35
|
-
<SelectElement
|
|
36
|
-
control={control}
|
|
37
|
-
name='paymentMethod.multisafepay_ideal.issuer_id'
|
|
38
|
-
required
|
|
39
|
-
rules={{ required: { message: 'Please provide an issuer', value: true } }}
|
|
40
|
-
variant='outlined'
|
|
41
|
-
color='secondary'
|
|
42
|
-
select
|
|
43
|
-
label={i18n._(/* i18n */ 'Select your bank')}
|
|
44
|
-
options={issuers.map(({ code: id, description: label }) => ({ id, label }))}
|
|
45
|
-
/>
|
|
46
|
-
</FormRow>
|
|
47
|
-
)}
|
|
48
|
-
<FormPersist
|
|
49
|
-
form={form}
|
|
50
|
-
name={key}
|
|
51
|
-
persist={['paymentMethod.multisafepay_ideal.issuer_id']}
|
|
52
|
-
storage='localStorage'
|
|
53
|
-
/>
|
|
54
|
-
</form>
|
|
55
|
-
)
|
|
56
|
-
}
|