@graphcommerce/magento-payment-included 9.1.0-canary.18 → 9.1.0-canary.20

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.1.0-canary.20
4
+
5
+ ## 9.1.0-canary.19
6
+
7
+ ### Patch Changes
8
+
9
+ - [#2499](https://github.com/graphcommerce-org/graphcommerce/pull/2499) [`17312d7`](https://github.com/graphcommerce-org/graphcommerce/commit/17312d7992d91db32ac24e3b0f91b28c271618e1) - Make checkmo respect the payableTo and sendTo values ([@paales](https://github.com/paales))
10
+
3
11
  ## 9.1.0-canary.18
4
12
 
5
13
  ## 9.1.0-canary.17
@@ -0,0 +1,28 @@
1
+ import { useQuery } from '@graphcommerce/graphql'
2
+ import { type PaymentOptionsProps } from '@graphcommerce/magento-cart-payment-method'
3
+ import { PaymentMethodOptionsNoop } from '@graphcommerce/magento-cart-payment-method/PaymentMethodOptionsNoop/PaymentMethodOptionsNoop'
4
+ import { StoreConfigDocument } from '@graphcommerce/magento-store'
5
+ import { SectionContainer } from '@graphcommerce/next-ui'
6
+ import React from 'react'
7
+
8
+ export function CheckmoPaymentOptions(props: PaymentOptionsProps) {
9
+ const config = useQuery(StoreConfigDocument).data?.storeConfig
10
+ const payableTo = config?.check_money_order_make_check_payable_to
11
+ const sendTo = config?.check_money_order_send_check_to?.split('\n')
12
+
13
+ if (!payableTo && !sendTo) return <PaymentMethodOptionsNoop {...props} />
14
+
15
+ return (
16
+ <PaymentMethodOptionsNoop {...props}>
17
+ <SectionContainer labelLeft='Payable to'>{payableTo}</SectionContainer>
18
+ <SectionContainer labelLeft='Send to'>
19
+ {sendTo?.map((line) => (
20
+ <React.Fragment key={line}>
21
+ {line}
22
+ <br />
23
+ </React.Fragment>
24
+ ))}
25
+ </SectionContainer>
26
+ </PaymentMethodOptionsNoop>
27
+ )
28
+ }
@@ -0,0 +1,12 @@
1
+ fragment CheckmoConfig on StoreConfig @inject(into: ["StoreConfigFragment"]) {
2
+ # check_money_order_enabled
3
+ # check_money_order_title
4
+ # check_money_order_new_order_status
5
+ # check_money_order_enable_for_specific_countries
6
+ # check_money_order_payment_from_specific_countries
7
+ check_money_order_make_check_payable_to
8
+ check_money_order_send_check_to
9
+ # check_money_order_min_order_total
10
+ # check_money_order_max_order_total
11
+ # check_money_order_sort_order
12
+ }
package/methods.tsx CHANGED
@@ -2,9 +2,10 @@ import type { PaymentModule } from '@graphcommerce/magento-cart-payment-method/A
2
2
  import { PaymentMethodOptionsNoop } from '@graphcommerce/magento-cart-payment-method/PaymentMethodOptionsNoop/PaymentMethodOptionsNoop'
3
3
  import { PaymentMethodPlaceOrderNoop } from '@graphcommerce/magento-cart-payment-method/PaymentMethodPlaceOrderNoop/PaymentMethodPlaceOrderNoop'
4
4
  import { ActionCard, iconCreditCard, IconSvg } from '@graphcommerce/next-ui'
5
+ import { CheckmoPaymentOptions } from './components/CheckmoPaymentOptions'
5
6
 
6
7
  export const checkmo: PaymentModule = {
7
- PaymentOptions: PaymentMethodOptionsNoop,
8
+ PaymentOptions: CheckmoPaymentOptions,
8
9
  PaymentPlaceOrder: PaymentMethodPlaceOrderNoop,
9
10
  PaymentActionCard: (props) => <ActionCard {...props} image={<IconSvg src={iconCreditCard} />} />,
10
11
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-payment-included",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.1.0-canary.18",
5
+ "version": "9.1.0-canary.20",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,20 +12,20 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.18",
16
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.18",
17
- "@graphcommerce/graphql": "^9.1.0-canary.18",
18
- "@graphcommerce/image": "^9.1.0-canary.18",
19
- "@graphcommerce/magento-cart": "^9.1.0-canary.18",
20
- "@graphcommerce/magento-cart-payment-method": "^9.1.0-canary.18",
21
- "@graphcommerce/magento-cart-shipping-address": "^9.1.0-canary.18",
22
- "@graphcommerce/magento-product": "^9.1.0-canary.18",
23
- "@graphcommerce/magento-product-configurable": "^9.1.0-canary.18",
24
- "@graphcommerce/magento-store": "^9.1.0-canary.18",
25
- "@graphcommerce/next-ui": "^9.1.0-canary.18",
26
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.18",
27
- "@graphcommerce/react-hook-form": "^9.1.0-canary.18",
28
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.18",
15
+ "@graphcommerce/ecommerce-ui": "^9.1.0-canary.20",
16
+ "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.20",
17
+ "@graphcommerce/graphql": "^9.1.0-canary.20",
18
+ "@graphcommerce/image": "^9.1.0-canary.20",
19
+ "@graphcommerce/magento-cart": "^9.1.0-canary.20",
20
+ "@graphcommerce/magento-cart-payment-method": "^9.1.0-canary.20",
21
+ "@graphcommerce/magento-cart-shipping-address": "^9.1.0-canary.20",
22
+ "@graphcommerce/magento-product": "^9.1.0-canary.20",
23
+ "@graphcommerce/magento-product-configurable": "^9.1.0-canary.20",
24
+ "@graphcommerce/magento-store": "^9.1.0-canary.20",
25
+ "@graphcommerce/next-ui": "^9.1.0-canary.20",
26
+ "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.20",
27
+ "@graphcommerce/react-hook-form": "^9.1.0-canary.20",
28
+ "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.20",
29
29
  "@lingui/core": "^4.2.1",
30
30
  "@lingui/macro": "^4.2.1",
31
31
  "@lingui/react": "^4.2.1",