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

Adyen CC (GCOM-1299) #2148

Draft
wants to merge 13 commits into
base: canary
Choose a base branch
from
1 change: 1 addition & 0 deletions examples/magento-graphcms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@graphcommerce/magento-customer": "7.1.0-canary.61",
"@graphcommerce/magento-graphql": "7.1.0-canary.61",
"@graphcommerce/magento-newsletter": "7.1.0-canary.61",
"@graphcommerce/magento-payment-adyen": "7.1.0-canary.61",
"@graphcommerce/magento-payment-included": "7.1.0-canary.61",
"@graphcommerce/magento-product": "7.1.0-canary.61",
"@graphcommerce/magento-product-bundle": "7.1.0-canary.61",
Expand Down
20 changes: 5 additions & 15 deletions packages/magento-payment-adyen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ We currently have 'Alternative Payment Methods' implemented, this means that it
supports all off-site payment methods that Adyen supports. This includes CC,
iDeal, Bancontact, Sofort, etc.

We do not support on-site credit cards yet. Let us know if you want to have
this.

## Requirements

- Magento Adyen module version 8.5.0 or later
Expand All @@ -17,16 +14,12 @@ this.

1. Find current version of your `@graphcommerce/magento-cart-payment-method` in
your package.json.
2. `yarn add @graphcommerce/[email protected]` (replace 1.2.3 with the
version of the step above)

2. `yarn add @marcheygroup/graphcommerce-magento-payment-adyen@^1.2.3` (replace
1.2.3 with the version of the step above)
3. Configure the Adyen module in Magento Admin like you would normally do.
4. Stores -> Configuration -> Sales -> Payment Methods -> Adyen Payment methods
-> Headless integration -> Payment Origin URL: `https://www.yourdomain.com`
5. Stores -> Configuration -> Sales -> Payment Methods -> Adyen Payment methods
-> Headless integration -> Payment Return URL:
`https://www.yourdomain.com/checkout/payment?locked=1&adyen=1` (make sure the
URL's match for your storeview)
4. Configure the Payment Origin URL Stores -> Configuration -> Sales -> Payment
Methods -> Adyen Payment methods -> Headless integration -> Payment Origin
URL: `https://www.yourdomain.com`

This package uses GraphCommerce plugin systems, so there is no code modification
required.
Expand All @@ -36,6 +29,3 @@ required.
- We don't need to configure the Payment URL's anymore since the 8.3.3 release
https://github.com/Adyen/adyen-magento2/releases/tag/8.3.3, but that isn't
integrated in the frontend yet.

- This package is currently untested inside the GraphCommerce repo, which it
should, but is used in production for multiple shops.
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,44 @@ import { Image } from '@graphcommerce/image'
import { PaymentMethodActionCardProps } from '@graphcommerce/magento-cart-payment-method'
import { ActionCard, useIconSvgSize } from '@graphcommerce/next-ui'
import { Trans } from '@lingui/react'
import { useAdyenPaymentMethod } from '../../hooks/useAdyenPaymentMethod'
import applepay from './applepay.svg'
import googlepay from './googlepay.svg'
import paypal from './paypal.svg'
import scheme from './scheme.svg'

export function AdyenPaymentActionCard(props: PaymentMethodActionCardProps) {
const { child } = props
const iconSize = useIconSvgSize('large')

const icon = useAdyenPaymentMethod(child)?.icon

const icons = {
scheme: {
image: scheme,
},
adyen_cc: {
image: scheme,
},
applepay: {
image: applepay,
},
googlepay: {
image: googlepay,
},
paypal: {
image: paypal,
},
}
return (
<ActionCard
{...props}
details={child === 'ideal' && <Trans id='Pay with iDEAL' />}
image={
!!icon?.url &&
!!icon?.width &&
!!icon?.height && (
!!icons[child]?.image && (
<Image
unoptimized
layout='fixed'
width={icon.width}
height={icon.height}
sx={{ width: `calc(${iconSize} / ${icon.height} * ${icon.width})`, height: iconSize }}
loading='eager'
sizes={iconSize}
unoptimized
src={icon.url}
src={icons[child]['image']}
/>
)
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions packages/magento-payment-adyen/graphql/AdyenStoreConfig.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fragment AdyenStoreConfig on StoreConfig @inject(into: ["StoreConfigFragment"]) {
adyen_demo_mode
adyen_title_renderer
adyen_client_key_live
adyen_client_key_test
adyen_has_holder_name
adyen_return_path_error
adyen_oneclick_card_mode
adyen_holder_name_required
adyen_checkout_frontend_region
}
24 changes: 0 additions & 24 deletions packages/magento-payment-adyen/hooks/adyenHppExpandMethods.ts

This file was deleted.

Loading