Skip to content

Commit

Permalink
Merge pull request #110 from Adyen/release/1.0.0-beta.6
Browse files Browse the repository at this point in the history
Release/1.0.0 beta.6
  • Loading branch information
amihajlovski authored Feb 5, 2024
2 parents 8af9a29 + 783d39c commit 8da1a5c
Show file tree
Hide file tree
Showing 61 changed files with 30,806 additions and 13,105 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,21 @@ jobs:
working-directory: ./tests
run: npm run test
env:
ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
ADYEN_MERCHANT_ACCOUNT: ${{secrets.ADYEN_MERCHANT_ACCOUNT}}
ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
ADYEN_ENVIRONMENT: ${{secrets.ADYEN_ENVIRONMENT}}
RefArch_ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}}
RefArch_ADYEN_MERCHANT_ACCOUNT: ${{secrets.ADYEN_MERCHANT_ACCOUNT}}
RefArch_ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}}
RefArch_ADYEN_ENVIRONMENT: ${{secrets.ADYEN_ENVIRONMENT}}
RefArch_ADYEN_WEBHOOK_USER: ${{ secrets.ADYEN_WEBHOOK_USER }}
RefArch_ADYEN_WEBHOOK_PASSWORD: ${{ secrets.ADYEN_WEBHOOK_PASSWORD }}
RefArch_ADYEN_HMAC_KEY: ${{ secrets.ADYEN_HMAC_KEY }}
SYSTEM_INTEGRATOR_NAME: ${{ secrets.SYSTEM_INTEGRATOR_NAME }}
HOST_URL: ${{ secrets.HOST_URL }}
COMMERCE_API_CLIENT_ID: ${{ secrets.COMMERCE_API_CLIENT_ID }}
COMMERCE_API_ORG_ID: ${{ secrets.COMMERCE_API_ORG_ID }}
COMMERCE_API_SHORT_CODE: ${{ secrets.COMMERCE_API_SHORT_CODE }}
COMMERCE_API_SITE_ID: ${{ secrets.COMMERCE_API_SITE_ID }}
COMMERCE_API_DEFAULT_SITE: ${{ secrets.COMMERCE_API_DEFAULT_SITE }}
SCAPI_URL: ${{ secrets.SCAPI_URL }}
OCAPI_URL: ${{ secrets.OCAPI_URL }}
ADYEN_WEBHOOK_USER: ${{ secrets.ADYEN_WEBHOOK_USER }}
ADYEN_WEBHOOK_PASSWORD: ${{ secrets.ADYEN_WEBHOOK_PASSWORD }}
ADYEN_HMAC_KEY: ${{ secrets.ADYEN_HMAC_KEY }}
ENVIRONMENT_ID: ${{ secrets.ENVIRONMENT_ID }}
PROJECT_ID: ${{ secrets.PROJECT_ID }}
COMMERCE_API_CLIENT_ID_PRIVATE: ${{ secrets.COMMERCE_API_CLIENT_ID_PRIVATE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- run: cd packages/adyen-salesforce-pwa/ && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
CI: true
CI: true
24 changes: 24 additions & 0 deletions .github/workflows/npm-unpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow will run tests using node and then publish a package when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Unpublish Package

on:
workflow_dispatch:

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: 18.15
registry-url: https://registry.npmjs.org/
# Publish the npm package
- run: npm unpublish @adyen/adyen-salesforce-pwa --force --loglevel verbose
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
CI: true

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adyen-salesforce-pwa",
"version": "1.0.0-beta.4",
"version": "0.0.0",
"license": "See license in LICENSE",
"engines": {
"node": "^16.0.0 || ^18.0.0",
Expand Down
18 changes: 9 additions & 9 deletions packages/adyen-retail-react-app/.env.example
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
ADYEN_API_KEY=""
ADYEN_MERCHANT_ACCOUNT=""
ADYEN_CLIENT_KEY=""
ADYEN_ENVIRONMENT=""
SYSTEM_INTEGRATOR_NAME=""
HOST_URL=""
RefArch_ADYEN_API_KEY=""
RefArch_ADYEN_MERCHANT_ACCOUNT=""
RefArch_ADYEN_CLIENT_KEY=""
RefArch_ADYEN_ENVIRONMENT=""
RefArch_ADYEN_WEBHOOK_USER=""
RefArch_ADYEN_WEBHOOK_PASSWORD=""
RefArch_ADYEN_HMAC_KEY=""
RefArch_SYSTEM_INTEGRATOR_NAME=""

COMMERCE_API_CLIENT_ID=""
COMMERCE_API_ORG_ID=""
COMMERCE_API_SHORT_CODE=""
COMMERCE_API_SITE_ID=""
COMMERCE_API_DEFAULT_SITE=""
SCAPI_URL=""
OCAPI_URL=""
ADYEN_WEBHOOK_USER=""
ADYEN_WEBHOOK_PASSWORD=""
ADYEN_HMAC_KEY=""
ENVIRONMENT_ID=""
PROJECT_ID=""
COMMERCE_API_CLIENT_ID_PRIVATE=""
Expand Down
24 changes: 24 additions & 0 deletions packages/adyen-retail-react-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Adyen Retail React App

This application is a demonstration tool designed to showcase certain features and capabilities of Adyen Salesforce PWA packages.
It is intended for demonstration purposes only.

---

## Important Notice
This application is not intended for production use. It is provided "as is" without any guarantees or warranty. While the application demonstrates key functionalities, it has not been developed with the robustness, security, compatibility, and scalability necessary for production environments.

## Usage
This application allows developers to demonstrate the default functionalities of the [Adyen Salesforce PWA package](https://www.npmjs.com/package/@adyen/adyen-salesforce-pwa), using the following [dependencies and requirements.](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/tree/main/packages/adyen-salesforce-pwa#dependencies--requirements)

## Installation and Configuration
We do not provide instructions for this application, as it cannot be used for any development, testing, or production environments. It can only be used as a demonstration of how to use the NPM package within a PWA application.

## Disclaimer
This application is for demonstration purposes only. The creators and contributors of this application are not responsible for any consequences that arise from its use in a production environment. By using this application, you acknowledge and agree that it is intended for demonstration purposes and should not be deployed in any production or critical systems.

## Support
There is no support provided for this application.

## License
This repository is available under the [MIT license](../../LICENSE).
10 changes: 0 additions & 10 deletions packages/adyen-retail-react-app/config/sites.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ module.exports = [
preferredCurrency: 'SEK'
}
]
},
adyen: {
apiKey: process.env.ADYEN_API_KEY,
clientKey: process.env.ADYEN_CLIENT_KEY,
environment: process.env.ADYEN_ENVIRONMENT,
merchantAccount: process.env.ADYEN_MERCHANT_ACCOUNT,
systemIntegratorName: process.env.SYSTEM_INTEGRATOR_NAME,
webhookUser: process.env.ADYEN_WEBHOOK_USER,
webhookPassword: process.env.ADYEN_WEBHOOK_PASSWORD,
webhookHmacKey: process.env.ADYEN_HMAC_KEY
}
}
]
59 changes: 59 additions & 0 deletions packages/adyen-retail-react-app/overrides/app/routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,46 @@ import {
useProducts,
useShopperBasketsMutation
} from '@salesforce/commerce-sdk-react'
import useMultiSite from '@salesforce/retail-react-app/app/hooks/use-multi-site'

// Components
const fallback = <Skeleton height="75vh" width="100%" />

/**
* Customize Adyen Checkout
* - Translations
* - Payment Methods
* - Execute Callbacks
*
* const checkoutCustomizations = {
* beforeSubmit: [
* function logAfterSubmit() {
* console.log('before submit')
* return true
* }
* ],
* afterSubmit: [
* function logAfterSubmit() {
* console.log('after submit')
* return true
* }
* ],
* translations: {
* 'en-US': {
* payButton: ''
* }
* },
* paymentMethodsConfiguration: {
* paypal: {
* style: {
* layout: 'vertical',
* color: 'blue'
* }
* }
* }
* }
*/

// Create your pages here and add them to the routes array
// Use loadable to split code into smaller js chunks
// Checkout page from Adyen
Expand All @@ -39,6 +76,8 @@ const Checkout = loadable(() => import('@adyen/adyen-salesforce-pwa'), {
useCustomerId={useCustomerId}
useCustomerType={useCustomerType}
useShopperBasketsMutation={useShopperBasketsMutation}
useMultiSite={useMultiSite}
// adyenConfig={checkoutCustomizations}
/>
)
}
Expand All @@ -57,6 +96,22 @@ const CheckoutConfirmation = loadable(() => import('@adyen/adyen-salesforce-pwa'
useAccessToken={useAccessToken}
useCustomerId={useCustomerId}
useCustomerType={useCustomerType}
useMultiSite={useMultiSite}
/>
)
}
})

// Checkout Redirect page from Adyen
const AdyenCheckoutRedirect = loadable(() => import('@adyen/adyen-salesforce-pwa'), {
fallback: fallback,
resolveComponent: (components) => {
return () => (
<components.AdyenCheckoutRedirect
useAccessToken={useAccessToken}
useCustomerId={useCustomerId}
useCustomerType={useCustomerType}
useMultiSite={useMultiSite}
/>
)
}
Expand All @@ -76,6 +131,10 @@ const routes = [
component: Checkout,
exact: true
},
{
path: '/checkout/redirect',
component: AdyenCheckoutRedirect
},
{
path: '/checkout/error',
component: AdyenCheckoutError
Expand Down
Loading

0 comments on commit 8da1a5c

Please sign in to comment.