Skip to content

Accept payments on your .NET website with cards, wallets, and key local payment methods

License

Notifications You must be signed in to change notification settings

adyen-examples/adyen-dotnet-online-payments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

200 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Adyen Online Payment Integration Demos

.NET E2E Testing Suite (Playwright)

This repository includes a collection of PCI-compliant UI integrations that show how to integrate with Adyen using different payment methods. The demos below leverages Adyen's API Library for .NET (GitHub | Documentation).

Run with GitHub Codespaces

This repository is configured to work with GitHub Codespaces. Each example can be opened in its own Codespace with all dependencies pre-installed.

For detailed setup instructions, see the GitHub Codespaces Instructions.

Prerequisites

Before running any example, you'll need to set up the following environment variables in your Codespace:

Setting Environment Variables

  1. Go to Codespaces settings
  2. Under Secrets, Click on "New secret"
  3. Add the required environment variables and repo access
  4. Restart your Codespace

Alternatively, you can set them in the terminal after starting Codespaces:

export ADYEN_API_KEY="your_adyen_api_key"
export ADYEN_CLIENT_KEY="your_adyen_client_key"
export ADYEN_MERCHANT_ACCOUNT="your_adyen_merchant_account"

Running an Example

  1. Click on any "Open in GitHub Codespaces" button below
  2. Select an example to run
  3. Wait for the Codespace to initialize
  4. Navigate to desired project and run dotnet run to start the application
  5. Open the forwarded port in your browser

Open in GitHub Codespaces

Demos Description Details
Checkout Example E-commerce checkout flow with different payment methods. See below
Checkout Advanced Example E-commerce checkout flow with different payment methods, using the 3 steps flow. See below
Authorisation Adjustment Example Pre-authorise a payment, adjust the authorised amount, capture or reverse the payment. See below
In-person Payments Example In-person payments using a POS terminal and the terminal-api/sync endpoint to create payment requests. See below
In-person Payments Loyalty Example In-person payments using a POS terminal and the terminal-api/sync endpoint to create card acquisition requests. See below
Gift Card Example Gift Cards checkout flow using partial orders. See below
Giving Example Donation flow using Adyen Giving. See below
Pay by Link Example Pay by Link flow. See below
Subscription Example Subscription flow using Adyen tokenization. See below

The checkout example repository includes examples of PCI-compliant UI integrations for online payments with Adyen. Within this demo app, you'll find a simplified version of an e-commerce website, complete with commented code to highlight key features and concepts of Adyen's API. Check out the underlying code to see how you can integrate Adyen to give your shoppers the option to pay with their preferred payment methods, all in a seamless checkout experience.

Card Checkout Demo

The advanced checkout example performs the same functionality as the checkout example but using the 3 stages of the Checkout API (Initiate, Submit, and Details) instead of the single /sessions endpoint. See the advanced integration flow for more information.

Card Checkout Demo

The authorisation adjustment example repository includes adjust authorisation example for the following three use cases after a pre-authorised payment: incremental, decremental adjustments. Within this demo app, you'll find a simplified version of a hotel booking, where the shopper perform a booking and administrators can [1] adjust (increase/decrease) the payment amount, [2] extend the authorisation expiry date, [3] capture the final amount and/or [4] reverse (cancel or refund) an authorised payment

Authorisation Adjustment Card Demo

The in-person payments example features an in-person payment cloud terminal API integration. Within this demo app, you can make in-person payments using a terminal, initiate reversals (refunds) and check transaction statuses.

Card In-person Payments Demo

Card In-person Payments Demo

The in-person payments loyalty example features an in-person payment cloud terminal API integration. Within this demo app, you can make in-person payments using a terminal, create card acquisition requests, collect card details and apply discounts.

Card In-person Payments Loyalty Demo

The gift card example repository includes a gift card flow during checkout. Within this demo app, you'll find a simplified version of an e-commerce website. The shopper can choose to use gift cards to complete their purchase or use their preferred payment method to pay the remaining amount.

Gift Card Demo

The giving example repository includes a sample designed to demonstrate the Adyen Giving donations flow. After making a test payment using one of our test card numbers, the donation screen will appear.

Giving Demo

The pay by link example repository includes a Pay by Link flow. Within this demo app, you can create links by specifying the amount. The shopper can choose to accept the links and complete the payment.

Pay by Link Demo

The subscription example repository includes a tokenization example for subscriptions. Within this demo app, you'll find a simplified version of a website that offers a music subscription service. The shopper can purchase a subscription and administrators can manage the saved (tokenized) payment methods on a separate admin panel. The panel allows admins to make payments on behalf of the shopper using this token.

Subscription Demo

Contributing

We commit all our new features directly into our GitHub repository. Feel free to request or suggest new features or code changes yourself as well!

Find out more in our contributing guidelines.

License

MIT license. For more information, see the LICENSE file.

About

Accept payments on your .NET website with cards, wallets, and key local payment methods

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 6