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

added adyen payments documentation #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/2-BFF/06-practical-task-4-checkout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
sidebar_position: 7
---

# 2.6. Practical Task - Implement Adyen Checkout

## What is this task about

This task is aimed at developing server-side logic for a checkout flow in a store running on the Magento platform. Your role will be to develop a server-side component whose task is to place an order.

## What should be done

You need to implement a Adyen checkout-session that will be used on the StoreFront side.

- Creating session that managed by Adyen
- Storefront should use your BFF API to proceed payment

#### Create Adyen account
To start proceeding payments - create your own test Adyen account.
Registration: https://www.adyen.com/signup

![Adyen SignUp](assets/2.8/adyen-signup.png)

You can use fake data for it, temporary email and phone number.

#### Adyen keys
TO be able to create the sessions and proceed payments, you should generate some keys for app to identify you.
Go to Developers tab/API credentials and select your account.

![Api-Credentials](assets/2.8/api-creds.png)

On the next page you should generate some keys and make a white list with your hosts. Save your keys somewhere.

![Api-key](assets/2.8/api-key.png)

Then generate the client-key, it will be used on the Front-End side. Also you should add the host you're going to use to the white list, to avoid CORS errors.

![client-key-and-hosts](assets/2.8/client-key.jpg)

Make sure you are using the latest version of the Front-End App. Create ".env" file and paste your client-key there in the following way:
`ADYEN_CLIENT_KEY="test_..."`

Also, you'll need merchant account for your session request. So your merchant account is - `{YOUR_COMPANY_NAME}ECOM.`

## Task

1. Create API endpoint `POST /chckout?amount={amount}` for the payment session
Session flow example: https://docs.adyen.com/online-payments/tokenization/sessions-flow/?programming_language=ts
Binary file added docs/2-BFF/assets/2.8/adyen-signup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/2-BFF/assets/2.8/api-creds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/2-BFF/assets/2.8/api-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/2-BFF/assets/2.8/client-key.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.