Skip to content

Commit

Permalink
Merge pull request #57 from Adyen/release/1.0.0-beta.0
Browse files Browse the repository at this point in the history
* created gitignore file, generated retail react app

* feat: use dotenv lib for setting default config (#3)

* Feature/render dropin pwa (#4)

* setup dropin integration
* setup sessions call to Adyen in ssr.js
* fetch basket in ssr.js

---------

Co-authored-by: zaid <[email protected]>

* feat: create sessions controller file (#5)

* Proceed to review (#6)

* feat: create sessions controller file

* feat: present adyen form and create payment instrument

* fix: use AdyenComponent as payment method id

* chore: added payment methods constants

* Api client (#7)

* feat: created api client for sending all requests

* feat: created sessions service

* fix: remove unused imports

* chore: prevent failing in case headers are not preset

* feat: removed api urls file

* feat: provide attributes to session service

* Handle payment (#8)

* feat: make payment using session

* feat: do the payment

* fix: show loading spinner when going to review page

* chore: use the constants file provided by salesforce

* feat: moved payments logic into separate service file

* feat: check for basket address before creating session

* fix: removed salesforce comment

* webhook endpoint with authorization and hmac validation (#9)

 feat: webhook endpoint with validation

* Feature/minor currency unit converter (#10)

feat: minor currency unit parser

* feat: provide billing and shipping address in payment request (#11)

* Provide multiple locales and currencies (#12)

* feat: provide multiple locales and currencies

* fix: revert translation changes

* fix: empty line break

* fix: show checkout component with correct locale

* fix: removed additional config attribute

* fix: not needed comma

* fix: use locale id from request

* feat: increment retail app version (#13)

* Fetch payment methods (#14)

* feat: increment retail app version

* feat: create payment method endpoint to replace sessions call

* fix: remove billing handler

* feat: convert constants into es6 module

* feat: pass country code from frontend

* chore: removed payments call replaced with TODO

* chore: renamed fetch controller

* feat: show payment methods based on shopper locale

* chore: destruct locale object

* fix: check if shopper locale

* Feature/mrt script (#15)

* feat: script to add .env file to mrt env-var

* feat: script to add .env file to mrt env-var

* chore: make env variables name in capital case

* fix: remove dotenv from ssr.js

* fix: imports in server side script

* fix: imports in server side script

* fix: env variables import (#17)

* feat: added payments details endpoint (#16)

* feature: payments api call (#18)

* feature: payments api call

* feature: payments api call

* Payments (#19)

* feat: make the payment and handle action

* feat: redirect shopper in case of result code different than authorised

* feat: use handle action from dropin

* fix: reorder function arguments

* feat: handle 3ds2 action in payment component

* feat: check if successful before navigating to confirm

* fix: remove unused context variables

* chore: removed unused log

* fix: use first two chars from shopper locale as country code

* Add renovate.json (#20)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feature: pass limeItems for openInvoiceMethods (#21)

* fix: linting code (#22)

* Feature/order creation backend (#23)

* feat: move the order creation in the payments api

* fix: submit full state data to details api

* fix: use locale from react dom

* fix: build issue on mrt

* feat: added spinner on payment page

* fix: show pay button false

---------

Co-authored-by: Shani <[email protected]>

* feat: provide shopper interaction and recurring details if customer registered (#24)

* [SFI-311] CodeQL, PR Template and Codeowners (#25)

* feat: added codeql, pr template and codeowners

* fix: PR template text

* Feature/payment methods configuration (#26)

* refactor: paymentMethods configuration

* refactor: paymentMethods configuration

* chore: upgrade retail-react-app v2.0.0 (#27)

* Feature/sfi 440 dropin payments (#28)

* feat: set billing address and payment instrument as part of payments request

* chore: install dependencies

* feat: include secret in env

* fix: comment out updating transaction

* fix: webpack source map; singleton config for adyen checkout (#29)

* fix: webpack source map; singleton config for adyen checkout

* fix: move checkout config in controllers dir

* fix: set devtool only if development

* feature: update billing address before sendPayments (#31)

* Logger service (#30)

* feat: logger service

* fix: revert translations

* chore: empty line

* fix: override onsubmit to work for stored cards

* Fix/mrt deploy (#33)

* show error toast for onsubmit and onAdditionalDetails

* fix: render on mrt

* Redirect payments (#32)

* feat: logger service

* fix: revert translations

* chore: empty line

* fix: override onsubmit to work for stored cards

* feat: handle redirect payments

* feat: show error toast if error occurs during checkout

* fix: removed logs

* feat: set origin in payments request

* feat: use adyen checkout component for redirect

* Fix/apple pay (#35)

* pass amount to checkout component

* pass basket to baseConfig

* Use address provided in state data (#34)

* fix: provide amount and delivery as part of the request

* fix: remove duplicate amount object

* fix: revert code back

* fix: translations

* feat: added husky lib for checking commits and branches (#36)

* Amazon Pay (#37)

* feat: handle amazon session id to make a payment

* feat: provide necessary scripts in order to load the amazon button properly

* feat: provide additional config for amazonpay

* feat: show loading spinner when coming back from amazon

* fix: remove unneded log

* fix: mount amazon on div container

* feat: country list (#39)

* Error page (#38)

* feat: override confirm page and redirect to it in case of error

* fix: show error page only if order number param is error

* fix: treat received as successful result code

* fix: payment methods

* feat: created new environment endpoint

* fix: payment methods from backend

* fix: use on additional details from root level or card

* fix: lint suggestions

* fix: provide SEK as supported currency

* fix: render error page instead of confirmation

* xss and idempotency key (#40)

* feat: use xss lib to prevent cross site scripting

* feat: provide uuid value as idempotency key

* fix: use express validator for escaping query params

* fix: removed param

* Payment card (#41)

* feat: payment card modifications

* fix: remove on bin lookup

* added authorization webhook handler (#43)

* Update payment transaction (#44)

* feat: introduce new order api method

* feat: update payment transaction after sending payments

* feat: refactored the api controllers

* feat: added option for overriding controllers

* chore: removed unused import

* feat: provided the option for extending controllers

* feat: call next() on error

* fix: typo in webhook handler

* feat: remove payment instrument from basket on error (#45)

* chore: provide more examples about overriding endpoints

* feat: fail order in case of payment unsuccessful

* chore: extend example

* chore: clean up unused functions

* chore: clean up unused functions

* feat: restructure

* Feature/npm packages (#46)

* feat: npm packages

* feat: restructure

* feat: npm publish script

* Feature/npm packages (#54)

* feat: npm packages

* feat: restructure

* feat: npm publish script

* chore: remove code from root which is part of adyen retail react app

* chore: refactor package.json

* npm packge build

* npm package build

* npm package build

* npm package build

* npm package build

* chore: return the error page

* fix: conflicts

---------

Co-authored-by: Aleksandar Mihajlovski <[email protected]>

* added readme file and bumped versions (#56)

* feat: added readme file and bumped versions

* feat: readme for pwa package

* feat: include files in package.json

---------

Co-authored-by: zaid <[email protected]>
Co-authored-by: Zaid Dreakh <[email protected]>
Co-authored-by: Shani <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Shani <[email protected]>
  • Loading branch information
6 people authored Dec 1, 2023
2 parents b5f6cdd + 7e4c0cb commit ebe80c0
Show file tree
Hide file tree
Showing 116 changed files with 133,791 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @amihajlovski @shanikantsingh
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- 🎉 Thank you for submitting a pull request! 🎉 -->

## Summary
Describe the changes proposed in this pull request:
- What is the motivation for this change?
- What existing problem does this pull request solve?


## Tested scenarios
Description of tested scenarios:

**Fixed issue**: <!-- #-prefixed issue number -->
51 changes: 51 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Code scanning - action"

on:
push:
pull_request:
schedule:
- cron: '0 3 * * 3'

jobs:
CodeQL-Build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
28 changes: 28 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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: Publish 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/
- run: npm ci
# Copy LICENSE to adyen-salesforce-pwa package
- run: cp LICENSE packages/adyen-salesforce-pwa/
# Copy env example file to adyen-salesforce-pwa package
- run: cp packages/adyen-retail-react-app/.env.example packages/adyen-salesforce-pwa/
# Build and publish to npm
- run: cd packages/adyen-salesforce-pwa/ && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
CI: true
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.idea
.DS_Store
.vagrant
node_modules
dw.json
/.vscode/
/coverage/
screenshots/
playwright-report/
Vagrantfile
.env
/build/
dist
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit
10 changes: 10 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run check-branch-name

cd ./packages/adyen-retail-react-app
npm run lint

cd ../adyen-salesforce-pwa
npm run lint
7 changes: 7 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
printWidth: 100
singleQuote: true
semi: false
bracketSpacing: false
tabWidth: 4
arrowParens: 'always'
trailingComma: 'none'
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

# Adyen Salesforce Headless Commerce PWA

This integration provides the opportunity to use Adyen as a payment service provider when building your Salesforce PWA application.

There are two packages:
* `Adyen retail react app`: reference application how to integrate the solution into the PWA application
* `Adyen salesforce pwa`: NPM package that can be installed and used within the retail react app.

## Prerequisites

* [Adyen test account](https://www.adyen.com/signup)
* [API key](https://docs.adyen.com/development-resources/how-to-get-the-api-key)
* [Client key](https://docs.adyen.com/development-resources/client-side-authentication#get-your-client-key)

## Support

To request a feature, report a bug, or report a security vulnerability, [create a GitHub issue](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa/issues/new/choose).

For other questions, contact our [support team](https://www.adyen.help).

## License

This repository is available under the [MIT license](LICENSE).
13 changes: 13 additions & 0 deletions branching.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
local_branch_name="$(git rev-parse --abbrev-ref HEAD)"

valid_branch_regex='^(feature|bugfix|improvement|library|prerelease|release|hotfix)\/.'

message="There is something wrong with your branch name. Branch names in this project must start with feature|bugfix|improvement|library|prerelease|release|hotfix followed by /. Example: feature/name-of-the-feature."

if [[ ! $local_branch_name =~ $valid_branch_regex ]]; then
echo "$message"
exit 1
fi

exit 0
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
}
Loading

0 comments on commit ebe80c0

Please sign in to comment.