Home
Softono
a

adyen

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
10

Software by adyen

adyen-ios
Open Source

adyen-ios

![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/adyen/adyen-ios/verify-os-compatibility.yml?branch=develop) [![Pod](https://img.shields.io/cocoapods/v/Adyen.svg?style=flat)](http://cocoapods.org/pods/Adyen) [![SwiftPM](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swiftpackageregistry.com/Adyen/adyen-ios) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Adyen_adyen-ios&metric=coverage)](https://sonarcloud.io/component_measures?metric=coverage&id=Adyen_adyen-ios) [![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=Adyen_adyen-ios&metric=alert_status)](https://sonarcloud.io/dashboard?id=Adyen_adyen-ios) [![SonarCloud Bugs](https://sonarcloud.io/api/project_badges/measure?project=Adyen_adyen-ios&metric=bugs)](https://sonarcloud.io/component_measures/metric/reliability_rating/list?id=Adyen_adyen-ios) [![SonarCloud Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Adyen_adyen-ios&metric=vulnerabilities)](https://sonarcloud.io/component_measures/metric/security_rating/list?id=Adyen_adyen-ios) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Adyen_adyen-ios&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=Adyen_adyen-ios) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Adyen_adyen-ios&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=Adyen_adyen-ios) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Adyen_adyen-ios&metric=security_rating)](https://sonarcloud.io/dashboard?id=Adyen_adyen-ios) [![Swift Versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FAdyen%2Fadyen-ios%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/Adyen/adyen-ios) [![Supported Platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FAdyen%2Fadyen-ios%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/Adyen/adyen-ios) <br/> ![iOS Logo](https://user-images.githubusercontent.com/2648655/198585678-047a1f5c-1463-4837-90b7-01e8094c9830.png) # Adyen iOS Adyen iOS provides you with the building blocks to create a checkout experience for your shoppers, allowing them to pay using the payment method of their choice. You can integrate with Adyen iOS in two ways: * [iOS Drop-in](https://docs.adyen.com/online-payments/build-your-integration/?platform=iOS&integration=Drop-in): an all-in-one solution, the quickest way to accept payments on your iOS app. * [iOS Components](https://docs.adyen.com/online-payments/build-your-integration/?platform=iOS&integration=Components): one Component per payment method and combine with your own payments flow. ## SDK lifecycle | Major version | State | Deprecated | End-of-life | |---------------|-------------|---------------|---------------| | 5.x.x | Active | --- | --- | | 4.x.x | Inactive | December 2026 | December 2027 | | 3.x.x | End-of-life | November 2021 | November 2022 | More information about our versioning and the Drop-in/Components lifecycle can be found [here](https://docs.adyen.com/online-payments/upgrade-your-integration/). ## Installation Adyen iOS is available through either [CocoaPods](http://cocoapods.org) or [Swift Package Manager](https://swift.org/package-manager/). ### Minimum Requirements - iOS 16.0 - Xcode 15.0 - Swift 5.7 ### Swift Package Manager 1. Follow Apple's [Adding Package Dependencies to Your App](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app) guide on how to add a Swift Package dependency. 2. Use `https://github.com/Adyen/adyen-ios` as the repository URL. 3. Specify the version to be at least `4.9.0`. You can add all modules or select individual modules to add to your integration. The `AdyenWeChatPay` module needs to be explicitly added to support WeChat Pay. The `AdyenTwint` module needs to be explicitly added to support Twint native flow. The `AdyenSwiftUI` module needs to be explicitly added to use the SwiftUI specific helpers. * `AdyenDropIn`: all modules except `AdyenWeChatPay`. * `AdyenSession`: handler for the simplified checkout flow. * `AdyenCard`: the card components. * `AdyenComponents`: all other payment components except WeChat Pay. * `AdyenActions`: action components. * `AdyenEncryption`: encryption. * `AdyenWeChatPay`: WeChat Pay component. * `AdyenTwint`: Twint component. * `AdyenSwiftUI`: SwiftUI apps specific module. :warning: _Swift Package Manager for Xcode 12.0 and 12.1 has a [known issue](https://bugs.swift.org/browse/SR-13343) when it comes to importing a dependency that in turn depend on a binary dependencies. A workaround is described [here](https://forums.swift.org/t/swiftpm-binarytarget-dependency-and-code-signing/38953)._ :warning: _`AdyenWeChatPay` and `AdyenWeChatPayInternal` modules don't support any simulators and can only be tested on a real device._ ### CocoaPods 1. Add `pod 'Adyen'` to your `Podfile`. 2. Run `pod install`. You can install all modules or add individual modules, depending on your needs and integration type. The `Adyen/WeChatPay` module needs to be explicitly added to support WeChat Pay. The `Adyen/SwiftUI` module needs to be explicitly added to use the SwiftUI specific helpers. ``` pod 'Adyen' // Add DropIn with all modules except WeChat Pay and SwiftUI. // Add individual modules pod 'Adyen/Card' // Card components. pod 'Adyen/Session' // Handler for the simplified checkout flow. pod 'Adyen/Encryption' // Encryption module. pod 'Adyen/Components' // All other payment components except WeChat Pay. pod 'Adyen/Actions' // Action Components. pod 'Adyen/WeChatPay' // WeChat Pay Component. pod 'Adyen/SwiftUI' // SwiftUI apps specific module. ``` :warning: _`Adyen/AdyenWeChatPay` and `AdyenWeChatPayInternal` modules doesn't support any simulators and can only be tested on a real device._ ### Swift Package Manager 1. Follow Apple's [Adding Package Dependencies to Your App]( https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app ) guide on how to add a Swift Package dependency. 2. Use `https://github.com/Adyen/adyen-ios` as the repository URL. 3. Specify the version to be at least `4.9.0`. You can add all modules or select individual modules to add to your integration. The `AdyenWeChatPay` module needs to be explicitly added to support WeChat Pay. The `AdyenTwint` module needs to be explicitly added to support Twint native flow. The `AdyenSwiftUI` module needs to be explicitly added to use the SwiftUI specific helpers. * `AdyenDropIn`: all modules except `AdyenWeChatPay`. * `AdyenSession`: handler for the simplified checkout flow. * `AdyenCard`: the card components. * `AdyenComponents`: all other payment components except WeChat Pay. * `AdyenActions`: action components. * `AdyenEncryption`: encryption. * `AdyenWeChatPay`: WeChat Pay component. * `AdyenTwint`: Twint component. * `AdyenSwiftUI`: SwiftUI apps specific module. :warning: _`AdyenWeChatPay` and `AdyenWeChatPayInternal` modules doesn't support any simulators and can only be tested on a real device._ ## Drop-in The [Drop-in](https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/dropincomponent) handles the presentation of available payment methods and the subsequent entry of a customer's payment details. It is initialized with the response of [`/sessions`][apiExplorer.sessions], and handles the entire checkout flow under the hood. ### Usage #### Setting up the Drop-in All Components need an `AdyenContext`. An instance of `AdyenContext` wraps your client key, environment, analytics configuration and so on. Please read more [here](https://docs.adyen.com/development-resources/client-side-authentication) about the client key and how to get one. Use **Environment.test** for environment. When you're ready to accept live payments, change the value to one of our [live environments](https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/environment) ```swift let apiContext = try! APIContext(environment: componentsEnvironment, clientKey: clientKey) let context = AdyenContext(apiContext: apiContext, payment: payment) let configuration = DropInComponent.Configuration() ``` Create an instance of `AdyenSession.Configuration` with the response you received from the `/sessions` call and the `AdyenContext` instance. ```swift let configuration = AdyenSession.Configuration(sessionIdentifier: response.sessionId, initialSessionData: response.sessionData, context: context) ``` Call the static `initialize` function of the `AdyenSession` by providing the configuration and the delegates, which will asynchronously create and return the session instance. ```swift AdyenSession.initialize(with: configuration, delegate: self, presentationDelegate: self) { [weak self] result in switch result { case let .success(session): // store the session object self?.session = session case let .failure(error): // handle the error } } ``` Create a configuration object for `DropInComponent`. Check specific payment method pages to confirm if you need to include additional required parameters. ```swift // Check specific payment method pages to confirm if you need to configure additional required parameters. let dropInConfiguration = DropInComponent.Configuration() ``` Some payment methods need additional configuration. For example `ApplePayComponent`. These payment method specific configuration parameters can be set in an instance of `DropInComponent.Configuration`: ```swift let summaryItems = [ PKPaymentSummaryItem(label: "Item A", amount: 75, type: .final), PKPaymentSummaryItem(label: "Item B", amount: 25, type: .final), PKPaymentSummaryItem(label: "My Company", amount: 100, type: .final) ] let applePayment = try ApplePayPayment(countryCode: "US", currencyCode: "USD", summaryItems: summaryItems) dropInConfiguration.applePay = .init(payment: applePayment, merchantIdentifier: "merchant.com.adyen.MY_MERCHANT_ID") ``` Also for voucher payment methods like Doku variants, in order for the `DokuComponent` to enable the shopper to save the voucher, access to the shopper photos is requested, so a suitable text needs to be added to the `NSPhotoLibraryAddUsageDescription` key in the application `Info.plist`. #### Presenting the Drop-in Initialize the `DropInComponent` class and set the `AdyenSession` instance as the `delegate` and `partialPaymentDelegate` (if needed) of the `DropInComponent` instance. ```swift let dropInComponent = DropInComponent(paymentMethods: session.sessionContext.paymentMethods, context: context, configuration: dropInConfiguration) // Keep the Drop-in instance to avoid it being destroyed after the function is executed. self.dropInComponent = dropInComponent // Set session as the delegate for Drop-in dropInComponent.delegate = session dropInComponent.partialPaymentDelegate = session present(dropInComponent.viewController, animated: true) ``` #### Implementing `AdyenSessionDelegate` `AdyenSession` makes the necessary calls to handle the whole flow and notifies your application through its delegate, `AdyenSessionDelegate`. To handle the results of the Drop-in, the following methods of `AdyenSessionDelegate` should be implemented: --- ```swift func didComplete(with result: AdyenSessionResult, component: Component, session: AdyenSession) ``` This method will be invoked when the component finishes without any further steps needed by the application. The application just needs to dismiss the current component, ideally after calling `finalizeIfNeeded` on the component. --- ```swift func didFail(with error: Error, from component: Component, session: AdyenSession) ``` This method is invoked when an error occurred during the use of the Drop-in or the components. You can then call the `finalizeIfNeeded` on the component, dismiss the component's view controller in the completion callback and display an error message. --- ```swift func didOpenExternalApplication(component: DropInComponent) ``` This optional method is invoked after a redirect to an external application has occurred. --- #### Handling an action Actions are handled by the Drop-in via its delegate `AdyenSession`. ##### Receiving redirect In case the customer is redirected to an external URL or App, make sure to let the `RedirectComponent` know when the user returns to your app. Do this by implementing the following in your `UIApplicationDelegate`: ```swift func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any] = [:]) -> Bool { RedirectComponent.applicationDidOpen(from: url) return true } ``` ## Components In order to have more flexibility over the checkout flow, you can use our Components to present each payment method individually. Implementation details of our Components can be found in our [Components API Reference][reference]. ### Available Components - [Card Component][reference.cardComponent] - [3D Secure 2 Component][reference.threeDS2Component] - [Apple Pay Component][reference.applePayComponent] - [BCMC Component][reference.bcmcComponent] - [SEPA Direct Debit Component][reference.sepaDirectDebitComponent] - [MOLPay Component][reference.issuerListComponent] - [Dotpay Component][reference.issuerListComponent] - [EPS Component][reference.issuerListComponent] - [Entercash Component][reference.issuerListComponent] - [Open Banking Component][reference.issuerListComponent] - [WeChat Pay Component][reference.weChatPaySDKActionComponent] - [Qiwi Wallet Component][reference.qiwiWalletComponent] - [Redirect Component][reference.redirectComponent] - [MB Way Component][reference.mbWayComponent] - [BLIK Component][reference.BLIKComponent] - [Doku Component][reference.DokuComponent] - [Boleto Component][reference.BoletoComponent] - [ACH Direct Debit Component][reference.ACHDirectDebitComponent] - [Affirm Component][reference.AffirmComponent] - [Atome Component][reference.AtomeComponent] - [BACS Direct Debit Component][reference.BACSDirectDebitComponent] - [Online Banking Czech republic Component][reference.OnlineBankingComponent] - [Online Banking Slovakia Component][reference.OnlineBankingComponent] - [Online Banking Poland Component][reference.issuerListComponent] - [UPI Component][reference.UPIComponent] - [QRCode Component][reference.QRCodeActionComponent] - [Cash App Pay Component][reference.CashAppPayComponent] - [Twint Component][reference.TwintComponent] - [PayTo Component][reference.PayToComponent] ## Customization Both the Drop-in and the Components offer a number of customization options to allow you to match the appearance of your app. For example, to change the section header titles and form field titles in the Drop-in to red, and turn the submit button's background to black with white foreground: ```swift var style = DropInComponent.Style() style.listComponent.sectionHeader.title.color = .red style.formComponent.textField.title.color = .red style.formComponent.mainButtonItem.button.backgroundColor = .black style.formComponent.mainButtonItem.button.title.color = .white let dropInComponent = DropInComponent(paymentMethods: paymentMethods, configuration: configuration, style: style) dropInComponent.delegate = self.session ``` Or, to create a black Card Component with white text: ```swift var style = FormComponentStyle() style.backgroundColor = .black style.header.title.color = .white style.textField.title.color = .white style.textField.text.color = .white style.switch.title.color = .white let component = CardComponent(paymentMethod: paymentMethod, apiContext: context.apiContext, style: style) component.delegate = self.session ``` A full list of customization options can be found in the [API Reference][reference.styles]. ## See also * [Complete Documentation](https://docs.adyen.com/online-payments/build-your-integration/?platform=iOS) * [Components API Reference][reference] * [Drop-in Integration][reference.dropInComponent] * [Advanced flow][reference.advancedFlow] * [Localization][reference.localization] ## Demo App We provide a fully working **Demo App** to explore Drop-in and Components integrations in a sandbox environment. The Demo App includes: * Sample integrations for Session Flow and Advanced Flow * UIKit and SwiftUI examples * Common payment methods (Card, Apple Pay, Instant Payments, Issuer List) > **Note:** We recommend using your own backend server. Direct API usage with `ADYEN_SERVER_API_KEY` is possible for testing only and **not** for production. For detailed setup, see the [Demo README](Demo/README.md). ## Support If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our Support Team via [Customer Area](https://ca-live.adyen.com/ca/ca/contactUs/support.shtml) or via email: [[email protected]](mailto:[email protected]) ## Contributing We strongly encourage you to join us in contributing to this repository so everyone can benefit from: * New features and functionality * Resolved bug fixes and issues * Any general improvements Read our [**contribution guidelines**](CONTRIBUTING.md) to find out how. ## License This repository is open source and available under the MIT license. For more information, see the LICENSE file. [reference]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/ [reference.dropInComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/dropin [reference.installation]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/installation [reference.styles]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/customization [reference.advancedFlow]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/threeapis [reference.cardComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/cardcomponent [reference.threeDS2Component]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/threeds2component [reference.applePayComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/applepaycomponent [reference.bcmcComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/bcmccomponent [reference.issuerListComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/issuerlistcomponent [reference.weChatPaySDKActionComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/wechatpaysdkactioncomponent [reference.qiwiWalletComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/qiwiwalletcomponent [reference.sepaDirectDebitComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/sepadirectdebitcomponent [reference.redirectComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/redirectcomponent [reference.mbWayComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/mbwaycomponent [reference.BLIKComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/blikcomponent [reference.DokuComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/dokucomponent [reference.BoletoComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/boletocomponent [reference.ACHDirectDebitComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/achdirectdebitcomponent [reference.AffirmComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/affirmcomponent [reference.BACSDirectDebitComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/bacsdirectdebitcomponent [reference.OnlineBankingComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/onlinebankingcomponent [reference.AtomeComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/atomecomponent [reference.UPIComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/upicomponent [reference.QRCodeActionComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/qrcodeactioncomponent [reference.CashAppPayComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/cashapppaycomponent [reference.TwintComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/twintcomponent [reference.PayToComponent]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/paytocomponent [reference.localization]: https://adyen.github.io/adyen-ios/5.22.2/documentation/adyen/localization [apiExplorer.sessions]: https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions

Payment & Checkout
170 Github Stars
adyen-magento2
Open Source

adyen-magento2

# Adyen Payment plugin for Adobe Commerce (Magento 2) Use Adyen's plugin for Magento 2 to offer frictionless payments online, in-app, and in-store. ## Integration The plugin integrates card component (Secured Fields) using Adyen Checkout for all card payments. For Point Of Sale (POS) payments we use Terminal API using Cloud-based communication. ### Support Vault and Instant Purchase ### Inside Adyen toggle the following settings on inside the API and Responses section (Settings -> API and Responses): * Recurring details * Card bin * Card summary * Expiry date * Variant ## Requirements This plugin is compatible with Magento version 2.4.8 only. ## Releases 1. **Major** releases are done ONLY when absolutely required. We try to not to introduce breaking changes and do major releases as rare as possible. Current average is **yearly**. 2. A minor or a patch release is scheduled but not limited to **once every 2 weeks.** **Note: This can be subject to change based on the load and dependancies of the Integration tools team.** ## Customizing Adobe Commerce Plugin You can customize your shoppers' checkout experience and add custom functionality to the plugin to meet your business needs. For example, you can apply modifications to the checkout process, or customize the style of your checkout to match your brand. For customizations, developers should extend the plugin by following Adyen’s API and [Adyen Plugin Customisation Guide](https://docs.adyen.com/plugins/adobe-commerce/customize/). If you customize inside of the default Adyen plugin, Adyen may be unable to provide plugin support, and upgrading and troubleshooting your integration will require additional effort. For more details, refer to: * [Adyen API Explorer](https://docs.adyen.com/api-explorer/Checkout/latest/overview) * [Adyen Adobe Commerce Plugin Customisation Guide](https://docs.adyen.com/plugins/adobe-commerce/customize/) * [Adyen Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) ## Support & Troubleshooting for Headfull Magento/ Adobe Commerce Plugin We provide specialized plugin support for major versions of the plugin following Adyen Adobe Commerce Support policy for 2 years, along with permanent Adyen support. Contact our [support team here](https://support.adyen.com/hc/en-us/requests/new?ticket_form_id=360000705420). When a major plugin version is no longer under Adyen Adobe Commerce plugin support, it will be treated as a custom merchant integration. It is recommended to upgrade your payments plugin every 1-2 years. * [Migration and Upgrade Guide](https://docs.adyen.com/plugins/adobe-commerce/upgrade/) * [Troubleshooting Guide](https://docs.adyen.com/plugins/adobe-commerce/troubleshooting/) * [Adobe Comerce Plugin Support Schedule](https://docs.adyen.com/plugins/adobe-commerce/#support-levels) ## Support & Troubleshooting for Headless Adobe Commerce Payments Adyen Plugin Support can help you with questions relating to the core backend functionality of the Adobe Commerce Headless Payment integration, including [API request processing](https://docs.adyen.com/plugins/adobe-commerce/headless-integration/#checkout-flow), [authentication](https://docs.adyen.com/plugins/adobe-commerce/headless-integration/#requirements), and payment lifecycle management. Contact our [support team here](https://support.adyen.com/hc/en-us/requests/new?ticket_form_id=360000705420). However, merchant-specific customizations, including frontend implementations, collection of shopper details, rendering of payment methods on custom front-end, middleware configurations e.g. placing the order, handling additional actions, checking payment status etc.; and third-party dependencies - fall outside the scope of Adyen support. We recommend leveraging Adyen’s debugging tools to troubleshoot custom Headless implementations: * [Adyen Headless troubleshooting guide](https://docs.adyen.com/plugins/adobe-commerce/headless-integration/#troubleshooting) * Troubleshoot Headless API validation: [GitPod FLOW for REST](https://www.postman.com/adyendev/adyen-flows/flow/669e40799441740032f40154), [GitPod Flow for GraphQL](https://www.postman.com/adyendev/adyen-flows/flow/66b665d5cafbb0003264bef9) ## Contributing We strongly encourage you to join us in contributing to this repository so everyone can benefit from: * New features and functionality * Resolved bug fixes and issues * Any general improvements Read our [**contribution guidelines**](CONTRIBUTING.md) to find out how. ## Installation You can install our plugin through Composer: ``` composer require adyen/module-payment bin/magento module:enable Adyen_Payment bin/magento setup:upgrade ``` For more information see our [installation section](https://docs.adyen.com/developers/plugins/magento-2/set-up-the-plugin-in-magento?redirect#step1installtheplugin). ## Documentation - [Adobe Commerce (Magento 2) Adyen Payments Documentation](https://docs.adyen.com/plugins/adobe-commerce) - [Adyen Payments V9 Migration Guide](https://docs.adyen.com/plugins/adobe-commerce/migrate-to-a-new-version) ## Setup Cron Make sure that your Magento cron is running every minute. We are using a cronjob to process the notifications (our webhook service) and to update Adyen servers' IP addresses. The cronjobs will be executed every minute. ``` <group id="adyen_payment"> <!-- Process stored Adyen webhooks/notifications --> <job name="adyen_payment_process_notification" instance="Adyen\Payment\Cron\WebhookProcessor" method="execute"> <schedule>*/1 * * * *</schedule> </job> <!-- Refresh Adyen server IP address list used for webhook validation --> <job name="adyen_payment_server_address_caching" instance="Adyen\Payment\Cron\ServerIpAddress" method="execute"> <schedule>*/1 * * * *</schedule> </job> <!-- Cancel expired/pending orders (daily) --> <job name="adyen_payment_cancel_expired_orders" instance="AdyenCancelOrders" method="execute"> <schedule>0 0 * * *</schedule> </job> <!-- Clean up persisted checkout state data (daily) --> <job name="adyen_payment_state_data_clean_up" instance="Adyen\Payment\Cron\StateDataCleanUp" method="execute"> <schedule>0 0 * * *</schedule> </job> <!-- Remove processed webhook records (runs every 5 minutes during the 00:00 hour) --> <job name="adyen_payment_remove_processed_webhooks" instance="Adyen\Payment\Cron\RemoveProcessedWebhooks" method="execute"> <schedule>*/5 0 * * *</schedule> </job> </group> ``` The notification processing service queries the records that have been received at least 2 minutes ago. This is to ensure that Magento has created the order, and all save after events are executed. A handy tool to get insight into your cronjobs is AOE scheduler. You can download this tool through Magento Marketplace or GitHub. If you need to setup your cronjob in Magento <a href="http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html" target="_blank">this is described here</a>. ## Supported Payment Methods See our [documentation](https://docs.adyen.com/plugins/adobe-commerce/supported-payment-methods/) for a full list of supported payment methods. ## Raising issues If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. ## API Library This module is using the Adyen APIs Library for PHP for all (API) connections to Adyen. <a href="https://github.com/Adyen/adyen-php-api-library" target="_blank">This library can be found here</a> ## License MIT license. For more information, see the [LICENSE](LICENSE.txt) file.

WordPress Themes & Plugins Payment & Checkout
167 Github Stars
adyen-php-api-library
Open Source

adyen-php-api-library

![php](https://user-images.githubusercontent.com/93914435/232437001-0f773227-f5ad-4495-9e5b-cad819a04fff.png) # Adyen PHP API Library This is the officially supported PHP library for using Adyen's APIs. [![Packagist version](https://img.shields.io/packagist/v/adyen/php-api-library.svg?color=blue&style=popout)](https://packagist.org/packages/adyen/php-api-library) ## Supported API versions The library supports all APIs under the following services: | API | Description | Service Name | Supported version | |------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|--------------------------| | [BIN Lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | [Binlookup](src/Adyen/Service/BinLookupApi.php) | **v54** | | [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). | [Checkout](src/Adyen/Service/Checkout) | **v71** | | [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | [BalancePlatform](src/Adyen/Service/BalancePlatform/) | **v2** | | [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | [DataProtection](src/Adyen/Service/DataProtectionApi.php) | **v1** | | [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](src/Adyen/Service/Management/) | **v3** | | [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. | [Payments](src/Adyen/Service/Payments) | **v68** | | [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. | [Recurring](src/Adyen/Service/RecurringApi.php) | **v68** | | [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | A set of API endpoints that allow you to store payout details, confirm, or decline a payout. | [Payout](src/Adyen/Service/Payout) | **v68** | | [BinLookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | Endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. Current supported version | [BinLookup](src/Adyen/Service/BinLookupApi.php) | **v54** | | [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Manage both online and point-of-sale gift cards and other stored-value cards. | [StoredValue](src/Adyen/Service/StoredValueApi.php) | **v46** | | [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | The Legal Entity Management API enables you to manage legal entities that contain information required for verification | [LegalEntityManagement](src/Adyen/Service/LegalEntityManagement) | **v3** | | [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview) | The Transfers API provides endpoints that you can use to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | [Transfers](src/Adyen/Service/Transfers) | **v4** | | [Balance Control API](https://docs.adyen.com/api-explorer/BalanceControl/1/overview) | The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. | [BalanceControl](src/Adyen/Service/BalanceControlApi.php) | **v1** | | [Hosted Onboarding API](https://docs.adyen.com/api-explorer/Hop/1/overview) | The Hosted onboarding API provides endpoints that you can use to generate links to Adyen-hosted pages, such as an onboarding page or a PCI compliance questionnaire. You can provide these links to your account holders so that they can complete their onboarding. | [HostedOnboardingPages](src/Adyen/Service/Hop.php) | **v1** | | [Account API](https://docs.adyen.com/api-explorer/Account/5/overview) | The Account API provides endpoints for managing account-related entities on your platform. These related entities include account holders, accounts, bank accounts, shareholders, and verification-related documents. The management operations include actions such as creation, retrieval, updating, and deletion of them. | [Account](src/Adyen/Service/Account.php) | **v5** | | [Fund API](https://docs.adyen.com/api-explorer/Fund/5/overview) | The Fund API provides endpoints for managing the funds in the accounts on your platform. These management operations include, for example, the transfer of funds from one account to another, the payout of funds to an account holder, and the retrieval of balances in an account. | [Fund](src/Adyen/Service/Fund.php) | **v5** | | [Terminal API (Cloud communications)](https://docs.adyen.com/point-of-sale/choose-your-architecture/cloud) | Our point-of-sale integration. | [Cloud-based Terminal API](src/Adyen/Service/PosPayment.php) | Cloud-based Terminal API | | | [Terminal API (Local communications)](https://docs.adyen.com/point-of-sale/choose-your-architecture/local) | Our point-of-sale integration. | [Local-based Terminal API](src/Adyen/Service/PosPayment.php) | Local-based Terminal API | | | [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | [Disputes](src/Adyen/Service/DisputesApi.php) | **v30** | | [POS Mobile API](https://docs.adyen.com/api-explorer/possdk/68/overview) | The POS Mobile API is used in the mutual authentication flow between an Adyen Android or iOS [POS Mobile SDK](https://docs.adyen.com/point-of-sale/ipp-mobile/) and the Adyen payments platform. The POS Mobile SDK for Android or iOS devices enables businesses to accept in-person payments using a commercial off-the-shelf (COTS) device like a phone. For example, Tap to Pay transactions, or transactions on a mobile device in combination with a card reader | [POS Mobile](src/Adyen/Service/PosMobile.php) | **v68** | | [Payments App API](https://docs.adyen.com/api-explorer/payments-app/1/overview) | The Payments App API is used to Board and manage the Adyen Payments App on your Android mobile devices. | [PaymentsAppApi](src/Adyen/Service/PaymentsApp/PaymentsAppApi.php) | **v1** | ## Supported Webhook versions The library supports all webhooks under the following model directories: | Webhooks | Description | Model Name | Supported Version | |---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|-------------------| | [Authentication Webhooks](https://docs.adyen.com/api-explorer/acs-webhook/1/overview) | Adyen sends this webhook when the process of cardholder authentication is finalized, whether it is completed successfully, fails, or expires. | [AcsWebhooks](src/Adyen/Model/AcsWebhooks) | **v1** | | [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/2/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [ConfigurationWebhooks](src/Adyen/Model/ConfigurationWebhooks) | **v2** | | [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/4/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransferWebhooks](src/Adyen/Model/TransferWebhooks) | **v4** | | [Transaction Webhooks](https://docs.adyen.com/api-explorer/transaction-webhooks/4/overview) | Adyen sends webhooks to inform your system about incoming and outgoing transfers in your platform. You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransactionWebhooks](src/Adyen/Model/TransactionWebhooks) | **v4** | | [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [ReportWebhooks](src/Adyen/Model/ReportWebhooks) | **v1** | | [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API. | [ManagementWebhooks](src/Adyen/Model/ManagementWebhooks) | **v3** | | [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation | [Notification](src/Adyen/Service/Notification.php) | **v1** | | [Tokenization Webhooks](https://docs.adyen.com/api-explorer/Tokenization-webhooks/1/overview) | Adyen sends webhooks to inform you about the creation and changes to the recurring tokens. | [TokenizationWebhooks](src/Adyen/Model/TokenizationWebhooks) | **v1** | For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/). ## Prerequisites - [Adyen test account](https://docs.adyen.com/get-started-with-adyen) - [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles). - PHP 7.3 or later - cURL with SSL support. - The PHP extensions: ctype, curl, json, mbstring and openssl. - See [composer require list](https://github.com/Adyen/adyen-php-api-library/blob/main/composer.json#L10) for the complete list of dependencies. ### Legacy version support If using PHP versions 7.2 or lower, download our library version [6.3.0](https://github.com/Adyen/adyen-php-api-library/releases/tag/6.3.0). ## Installation You can use [Composer](https://getcomposer.org/). Follow the [installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have composer installed. ~~~~ bash composer require adyen/php-api-library ~~~~ In your PHP script, make sure you include the autoloader: ~~~~ php require __DIR__ . '/vendor/autoload.php'; ~~~~ Alternatively, you can download the [release on GitHub](https://github.com/Adyen/adyen-php-api-library/releases). ## Using the library ### General use with API key Set up the client as a singleton resource; you'll use it for the API calls that you make to Adyen: ~~~~ php $client = new \Adyen\Client(); $client->setXApiKey("YOUR API KEY"); $client->setEnvironment(\Adyen\Environment::TEST); $client->setTimeout(30); $service = new \Adyen\Service\Checkout\PaymentsApi($client); // Create PaymentMethod object $paymentMethod = new \Adyen\Model\Checkout\CheckoutPaymentMethod(); $paymentMethod ->setType("scheme") ->setEncryptedBankAccountNumber("test_4111111111111111") ->setEncryptedExpiryMonth("test_03") ->setEncryptedExpiryYear("test_2030") ->setEncryptedSecurityCode("test_737"); // Creating Amount Object $amount = new \Adyen\Model\Checkout\Amount(); $amount ->setValue(1500) ->setCurrency("EUR"); // Create the actual Payments Request $paymentRequest = new \Adyen\Model\Checkout\PaymentRequest(); $paymentRequest ->setMerchantAccount("YOUR MERCHANT ACCOUNT") ->setPaymentMethod($paymentMethod) ->setAmount($amount) ->setReference("payment-test") ->setReturnUrl("https://your-company.com/..."); $result = $service->payments($paymentRequest); ~~~~ ### General use with API key for live environment ~~~~ php $client = new \Adyen\Client(); $client->setXApiKey("YOUR API KEY"); $client->setEnvironment(\Adyen\Environment::LIVE, 'Your live URL prefix'); $client->setTimeout(30); ... ~~~~ ### General use with basic auth ~~~~ php $client = new \Adyen\Client(); $client->setUsername("YOUR USERNAME"); $client->setPassword("YOUR PASSWORD"); $client->setEnvironment(\Adyen\Environment::TEST); $client->setTimeout(30); ... ~~~~ ### Instantiating the request objects through the arrayAccess implementation (for easy migration) Although the preferred approach is to instantiate strongly types objects, it is still possible to instantiate request objects using associative arrays to ease migration. ~~~~ php ... $service = new \Adyen\Service\Checkout\PaymentLinksApi($client); $params = array( 'merchantAccount' => "YourMerchantAccount", 'reference' => '12345', 'amount' => array('currency' => "BRL", 'value' => 1250), 'countryCode' => "BR", 'shopperReference' => "YourUniqueShopperId", 'shopperEmail' => "[email protected]", 'shopperLocale' => "pt_BR", 'billingAddress' => array(...), 'deliveryAddress' => array(...), ); $createPaymentLinkRequest = new \Adyen\Model\Checkout\PaymentLinkRequest($params); $result = $service->paymentLinks($createPaymentLinkRequest); $paymentLink = $result->getUrl(); // or use $result['url'] if you want to use arrayAccess ~~~~ ### Using Banking Webhooks ~~~~ php ... $jsonString = 'webhook_payload'; $isValid = $hmac->validateHMAC("YOUR_HMAC_KEY", "YOUR_HMAC_SIGN", $jsonString); if ($isValid) { $webhookParser = new \Adyen\Service\BankingWebhookParser($jsonString); $result = $webhookParser->getGenericWebhook(); } ~~~~ ### Using Management Webhooks ~~~~ php ... $jsonString = 'webhook_payload'; $isValid = $hmac->validateHMAC("YOUR_HMAC_KEY", "YOUR_HMAC_SIGN", $jsonString); if ($isValid) { $webhookParser = new \Adyen\Service\ManagementWebhookParser($jsonString); $result = $webhookParser->getGenericWebhook(); } ~~~~ ### Example integration For a closer look at how our PHP library works, clone our [Laravel example integration](https://github.com/adyen-examples/adyen-php-online-payments). This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library. ### Running the tests For the test cases you need the PCI permission enabled on your account. There are no test cases for CSE because credit card data is encrypted through our javascript library. By default the test will then be skipped. If you have these permissions fill in your account details in the config/test.ini file to let the test work. To make the automatic testing cases work for your account change the credentials in the config/test.ini file. ## Feedback We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas. ## Contributing We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our [contributing guidelines](https://github.com/Adyen/adyen-php-api-library/blob/main/CONTRIBUTING.md) to find out how to raise a pull request. ## Support If you have a feature request, or spotted a bug or a technical problem, [create an issue here](https://github.com/Adyen/adyen-php-api-library/issues/new/choose). For other questions, [contact our Support Team](https://www.adyen.help/hc/en-us/requests/new?ticket_form_id=360000705420). ## Licence This repository is available under the [MIT license](https://github.com/Adyen/adyen-php-api-library/blob/main/LICENSE). ## See also * [Example integration](https://github.com/adyen-examples/adyen-php-online-payments) * [Adyen docs](https://docs.adyen.com/) * [API Explorer](https://docs.adyen.com/api-explorer/)

Payment & Checkout
175 Github Stars
adyen-dotnet-api-library
Open Source

adyen-dotnet-api-library

![NET api](https://user-images.githubusercontent.com/16090523/211498272-75a50b61-b1cc-482e-9278-c10a267efe27.png) # Adyen .NET API Library [![nuget](https://img.shields.io/nuget/v/adyen.svg)](https://www.nuget.org/packages/adyen/) [![nuget](https://img.shields.io/nuget/dt/adyen.svg)](https://www.nuget.org/packages/adyen/) ![.NET Core 8.0](https://github.com/Adyen/adyen-dotnet-api-library/actions/workflows/build-net8.0.yml/badge.svg) This is the officially supported .NET library for the Adyen's APIs. Are you looking for examples? You can find our [.NET Integration examples on GitHub here](https://github.com/adyen-examples/adyen-dotnet-online-payments/). ## Supported API versions The library supports all APIs under the following services: | API | Description | Service Name | Supported version | |------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|-------------------| | [Adyen BinLookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | Endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. Current supported version | [BinLookup](Adyen/BinLookup) | **v54** | | [Balance Control API](https://docs.adyen.com/api-explorer/BalanceControl/1/overview) | The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. | [BalanceControl](Adyen/BalanceControl) | **v1** | | [Capital API](https://docs.adyen.com/api-explorer/capital/1/overview) | Provides endpoints for embedding Adyen Capital into your marketplace or platform. | [Capital](Adyen/Capital) | **v1** | | [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). | [Checkout](Adyen/Checkout) | **v71** | | [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | [BalancePlatform](Adyen/BalancePlatform) | **v2** | | [Data Protection API](https://docs.adyen.com/development-resources/data-protection-api) | Our Data Protection API allows you to process Subject Erasure Requests as mandated in General Data Protection Regulation (GDPR). | [DataProtection](Adyen/DataProtection) | **v1** | | [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | [Disputes](Adyen/Disputes) | **v30** | | [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/4/overview) | The Legal Entity Management API enables you to manage legal entities that contain information required for verification | [LegalEntityManagement](Adyen/LegalEntityManagement) | **v4** | | [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](Adyen/Management) | **v3** | | [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. | [Payments](Adyen/Payment) | **v68** | | [Payments App API](https://docs.adyen.com/api-explorer/payments-app/1/overview) | The Payments App API is used to Board and manage the Adyen Payments App on your Android mobile devices. | [PaymentsAppApi](Adyen/PaymentsApp) | **v1** | | [~~POS Mobile API~~](https://docs.adyen.com/api-explorer/possdk/68/overview) | ~~The POS Mobile API is used in the mutual authentication flow between an Adyen Android or iOS [POS Mobile SDK](https://docs.adyen.com/point-of-sale/ipp-mobile/) and the Adyen payments platform.~~ Use instead [SoftPOS configuration API](https://docs.adyen.com/api-explorer/softpos-configuration-api/latest/overview). | [POS Mobile](Adyen/PosMobile) | **v68** | | [~~Payouts API~~](https://docs.adyen.com/api-explorer/Payout/68/overview) | ~~A set of API endpoints that allow you to store payout details, confirm, or decline a payout.~~ Check [Payouts and Payments](https://docs.adyen.com/payouts/payout-service) guide. | [Payout](Adyen/Payout) | **v68** | | [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. | [Recurring](Adyen/Recurring) | **v68** | | [Session Authentication API](https://docs.adyen.com/api-explorer/sessionauthentication/1/overview) | Create and manage the JSON Web Tokens (JWT) required for integrating [Onboarding](https://docs.adyen.com/platforms/onboard-users/components) and [Platform Experience](https://docs.adyen.com/platforms/build-user-dashboards) components. | [SessionAuthentication](Adyen/SessionAuthentication) | **v1** | | [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Manage both online and point-of-sale gift cards and other stored-value cards. | [StoredValue](Adyen/StoredValue) | **v46** | | [Terminal API (Cloud communications)](https://docs.adyen.com/point-of-sale/choose-your-architecture/cloud) | Our point-of-sale integration. | [Cloud-based Terminal API](Adyen/TerminalApi/Services) | **v1** | | | [Terminal API (Local communications)](https://docs.adyen.com/point-of-sale/choose-your-architecture/local) | Our point-of-sale integration. | [Local-based Terminal API](Adyen/TerminalApi/Services) | **v1** | | | [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview) | The Transfers API provides endpoints that you can use to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | [Transfers](Adyen/Transfers) | **v4** | ## Supported Webhook versions The library supports all webhooks under the following model directories: | Webhooks | Description | Model Name | Supported Version | |---------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|-------------------| | [Authentication Webhooks](https://docs.adyen.com/api-explorer/Checkout/latest/overview) | You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort). | [AcsWebhooks](Adyen/AcsWebhooks/Models) | **v1** | | [Balance Webhooks](https://docs.adyen.com/api-explorer/balance-webhooks/1/overview) | Adyen sends webhooks to inform you of balance changes in your balance platform. | [BalanceWebhooks](Adyen/BalanceWebhooks/Models) | **v1** | | [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/2/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [ConfigurationWebhooks](Adyen/ConfigurationWebhooks/Models) | **v2** | | [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API. | [ManagementWebhooks](Adyen/ManagementWebhooks/Models) | **v3** | | [Negative Balance Warning Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | Adyen sends this webhook to inform you about a balance account whose balance has been negative for a given number of days. | [NegativeBalanceWarningWebhooks](Adyen/NegativeBalanceWarningWebhooks/Models) | **v1** | | [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation | [Notification](Adyen/Webhooks/Models) | **v1** | | [Relayed Authorization Webhooks](https://docs.adyen.com/api-explorer/relayed-authorisation-webhooks/4/overview) | Adyen sends webhooks to inform your system about events related to transaction authorizations. | [RelayedAuthorizationWebhooks](Adyen/RelayedAuthorizationWebhooks/Models) | **v4** | | [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [ReportWebhooks](Adyen/ReportWebhooks/Models) | **v1** | | [Tokenization Webhooks](https://docs.adyen.com/api-explorer/Tokenization-webhooks/1/overview) | Adyen sends webhooks to inform you about the creation and changes to the recurring tokens. | [TokenizationWebhooks](Adyen/TokenizationWebhooks/Models) | **v1** | | [Transaction Webhooks](https://docs.adyen.com/api-explorer/transaction-webhooks/4/overview) | Adyen sends webhooks to inform your system about incoming and outgoing transfers in your platform. You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransactionWebhooks](Adyen/TransactionWebhooks/Models) | **v4** | | [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/4/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransferWebhooks](Adyen/TransferWebhooks/Models) | **v4** | For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/). ## Prerequisites - [Adyen Test Account](https://docs.adyen.com/get-started-with-adyen) - [Adyen API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles). - Adyen .NET API Library supports .NET Standard 2.0 and .NET 8.0 ## Installation Simply download and restore nuget packages https://www.nuget.org/packages/Adyen/ or install it from package manager ``` PM> Install-Package Adyen -Version x.x.x ``` ## Using the library In order to submit http request to Adyen API you need to initialize the client. The following example makes a checkout payment request: ```csharp using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; using Adyen.Core.Extensions; using Adyen.Checkout.Extensions; using AdyenEnvironment = Adyen.Core.Model.Environment; IHost host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; options.Environment = AdyenEnvironment.Test; }); services.AddPaymentsService(); }) .Build(); var paymentsService = host.Services.GetRequiredService<IPaymentsService>(); var request = new PaymentRequest( amount: new Amount("EUR", 1999), merchantAccount: "MY_MERCHANT_ACCOUNT", reference: "reference", returnUrl: "https://adyen.com/", paymentMethod: new CheckoutPaymentMethod( new CardDetails( type: CardDetails.TypeEnum.Scheme, encryptedCardNumber: "test_4111111111111111", encryptedExpiryMonth: "test_03", encryptedExpiryYear: "test_2030", encryptedSecurityCode: "test_737", holderName: "John Smith" ) ) ); var response = await paymentsService.PaymentsAsync(request); if (response.TryDeserializeOkResponse(out var result); { Console.WriteLine(result); // result.ResultCode } ``` Use the `RequestOptions` object to pass additional headers like the IdempotencyKey or other custom request header: ```csharp var response = await paymentsService.PaymentsAsync(request, new RequestOptions().AddIdempotencyKey(Guid.NewGuid().ToString())); ``` ### Working with amounts Adyen APIs work with minor units (e.g., 1000 for 10.00 EUR). The library provides an `AmountUtil` class to help you convert decimal amounts to minor units and vice versa, according to [Adyen's specific currency rules](https://docs.adyen.com/development-resources/currency-codes). The utility uses **banker's rounding** (`MidpointRounding.ToEven`) and is robust against case-sensitivity or whitespace in currency codes. ```csharp using Adyen.Core.Utilities; // Convert decimal amount to minor units (long) long? minorUnits = AmountUtil.AmountToMinorUnits(12.34m, "EUR"); // Returns 1234 long? jpyMinorUnits = AmountUtil.AmountToMinorUnits(1234m, "jpy"); // Returns 1234 (0 decimals, case-insensitive) long? bhdMinorUnits = AmountUtil.AmountToMinorUnits(12.345m, "BHD"); // Returns 12345 (3 decimals) // Example of banker's rounding (MidpointRounding.ToEven) long? rounded = AmountUtil.AmountToMinorUnits(12.345m, "EUR"); // Returns 1234 // Convert minor units (long) to decimal amount decimal? amount = AmountUtil.MinorUnitsToAmount(1234L, "EUR"); // Returns 12.34 ``` ### Working with `byte[]` fields Some API fields (e.g. `cavv`, `xid`, `tokenAuthenticationVerificationValue` on `ThreeDSecureData`) are typed as `byte[]`. The library serializes these using a UTF-8 pass-through: bytes are written as a UTF-8 string in JSON and read back as UTF-8 bytes — **no base64 encoding/decoding is applied by the library**. Because the Adyen API expects these values as base64 strings in JSON, you must assign the **UTF-8 bytes of the base64 string** (not the raw decoded binary): ```csharp // Correct: store the UTF-8 bytes of the base64 string request.MpiData = new ThreeDSecureData { Cavv = Encoding.UTF8.GetBytes("3q2+78r+ur7erb7vyv66vv////8="), }; // Incorrect: raw binary bytes would produce garbled JSON request.MpiData = new ThreeDSecureData { Cavv = Convert.FromBase64String("3q2+78r+ur7erb7vyv66vv////8="), }; ``` The same applies to all other `byte[]` fields in the library. ### Serializing and Deserializing JSON Strings The library uses custom JSON converters for all model types, handling oneOf polymorphism, optional-field omission, enum mapping, and more. Each model carries a class-level `[JsonConverter]` attribute, so `System.Text.Json` (STJ) discovers and applies the correct converter automatically — no explicit options are required for most models. #### Deserialization with DI-provided options (recommended) Build the host and resolve the `JsonSerializerOptionsProvider` from the service container to get the fully configured options: ~~~~ csharp using Adyen.Checkout.Client; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System.Text.Json; using Adyen.Checkout.Models; IHost host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = context.Configuration["ADYEN_API_KEY"]; options.Environment = AdyenEnvironment.Test; }); }) .Build(); var jsonSerializerOptionsProvider = host.Services.GetRequiredService<JsonSerializerOptionsProvider>(); // Deserialize using the library's options var paymentRequest = JsonSerializer.Deserialize<PaymentRequest>("YOUR_JSON_STRING", jsonSerializerOptionsProvider.Options); // Serialize using the library's options var paymentResponse = new PaymentResponse(); // Replace with your actual PaymentResponse object var json = JsonSerializer.Serialize(paymentResponse, jsonSerializerOptionsProvider.Options); ~~~~ #### Bare deserialization (no DI required) You can choose to deserialize models directly without providing `JsonSerializerOptions`. Each model carries a class-level `[JsonConverter]` attribute that STJ discovers automatically: ~~~~ csharp using System.Text.Json; using Adyen.Checkout.Models; // Deserialize without options var amount = JsonSerializer.Deserialize<Amount>("{\"currency\":\"EUR\",\"value\":1000}"); // Serialize without options var json = JsonSerializer.Serialize(amount); ~~~~ ### Logging response bodies Here's an example how you can log API responses using `{{classname}}Events`. Consider logging responses **only on TEST** to prevent logging confidential data. In case of `Payments` the snippet would be: ~~~~ c# var events = new PaymentsEvents; services.AddSingleton(events); // Create a new logger events.OnPayments += (sender, eventArgs) => { ApiResponse apiResponse = eventArgs.ApiResponse; logger.LogInformation("{TotalSeconds,-9} | {Path} | {StatusCode} |", (apiResponse.DownloadedAt - apiResponse.RequestedAt).TotalSeconds, apiResponse.Path, apiResponse.StatusCode); }; ~~~~ ### Running the tests Navigate to adyen-dotnet-api-library folder and run the following commands. ``` dotnet build dotnet test ``` > [!IMPORTANT] We have split and renamed `TerminalCloudApi.cs` to: > 1. `TerminalApiAsyncService.cs` (which sends requests to `terminal-api.adyen.com/async`) and > 2. `TerminalApiSyncService.cs` (which sends requests to `terminal-api.adyen.com/sync`) > 3. `TerminalApiLocalService.cs` (which sends requests to your custom endpoint, f.e. `https://198.51.100.1:8443/nexo`) ### Using the Cloud Terminal API In order to submit POS request with Cloud Terminal API, you need to initialize the client with the **endpoints that it is closer to your region** when going **live**. The Endpoints are available as contacts in [ClientConfig](/Adyen/Constants/ClientConfig.cs). For more information, visit our [documentation](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/#live-endpoints) ```csharp // Example for EU based region using Adyen; using Adyen.Constants; var config = new Config { XApiKey = "ADYEN_API_KEY", CloudApiEndPoint = ClientConfig.CloudApiEndPointEULive }; var client = new Client(config); ``` To parse the terminal API notifications, you can use the following custom deserializer. This method will throw an exception for non-notification requests. ```csharp SaleToPoiMessageSerializer serializer = new SaleToPoiMessageSerializer(); SaleToPOIRequest saleToPoiRequest = serializer.DeserializeNotification(your_terminal_notification); ``` ### Example Cloud Terminal API integration `/sync`-endpoint ```c# using System; using Adyen.Model; using Adyen.Model.TerminalApi; using Adyen.Model.TerminalApi.Message; using Adyen.Service; using Environment = Adyen.Model.Environment; namespace Adyen.Terminal { public static class Program { private static void Main(string[] args) { var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config, Environment.Test); } // Terminal-api `/sync` - `https://terminal-api-test.adyen.com/sync` private static SyncEndpointExample(Client client) { ITerminalApiSyncService terminalApiSyncService = new TerminalApiSyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = terminalApiSyncService.Request(GetPaymentRequest()); // Use: await terminalApiSyncService.RequestAsync(GetPaymentRequest()) for asynchronous communications. PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Console.WriteLine(paymentResponse?.Response?.Result); } // Terminal-api `/async` - `https://terminal-api-test.adyen.com/async` private static AsyncEndpointExample(Client client) { ITerminalApiAsyncService terminalApiAsyncService = new TerminalApiAsyncService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); String response = terminalApiAsyncService.Request(GetPaymentRequest()); // Use: await terminalApiAsyncService.RequestAsync(GetPaymentRequest()) for asynchronous communications. Console.WriteLine(response); } private static SaleToPOIRequest GetPaymentRequest() { var serviceID = "SERVICE_ID"; // ServiceId should be unique for every request var saleID = "SALE_ID"; var POIID = "SERIAL_NUMBER"; var transactionID = "123459"; SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest() { MessageHeader = new MessageHeader() { MessageClass = MessageClassType.Service, MessageCategory = MessageCategoryType.Payment, MessageType = MessageType.Request, ServiceID = serviceID, SaleID = saleID, POIID = POIID }, MessagePayload = new PaymentRequest() { SaleData = new SaleData() { SaleTransactionID = new TransactionIdentification() { TransactionID = transactionID, TimeStamp = DateTime.Now } }, PaymentTransaction = new PaymentTransaction() { AmountsReq = new AmountsReq() { Currency = "EUR", RequestedAmount = new decimal(13.37) }, }, } }; return saleToPOIRequest; } } } ``` ### Using the Local Terminal API The request and response payloads are identical to the Cloud Terminal API, however an additional encryption details object is required to send the requests. You can retrieve these details from the Customer Area, make sure you update your terminal to the latest version if you've updated these keys. ```csharp using Adyen; using Adyen.Security; var encryptionCredentialDetails = new EncryptionCredentialDetails { KeyVersion = 1, AdyenCryptoVersion = 1, KeyIdentifier = "CryptoKeyIdentifier12345", Password = "p@ssw0rd123456" }; var config = new Config { Environment = Model.Environment.Test, LocalTerminalApiEndpoint = @"https://_terminal_:8443/nexo/" // _terminal_ example: `https://198.51.100.1:8443/nexo` (can be found in the WIFI settings of your terminal) }; var client = new Client(config); ITerminalApiLocalService terminalApiLocalService = new TerminalApiLocalService( client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer() ); // Asynchronous call (preferred) var saleToPOIResponse = await terminalApiLocalService.RequestEncryptedAsync(paymentRequest, encryptionCredentialDetails, new CancellationToken()); // Pass cancellation token or create a new one. // Synchronous (blocking) call //var saleToPOIResponse = terminalApiLocalService.RequestEncrypted(paymentRequest, encryptionCredentialDetails); ``` Alternatively one can use the local terminal API without encryption. This is only allowed in the TEST environment and in order for this to work one has to remove any encryption details from the Customer Area. When sending requests to a local (unknown) endpoint, you may run into `System.Net.Http.HttpRequestException: The SSL connection could not be established` due to certificate issues. For **local** testing purposes, developers can override the `System.Net.Http.HttpClientHandler` and always returns `true` when validating the certificate. > [!CAUTION] Follow the guide in the [Adyen documentation](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/local/#install-root-cert) to install the root certificate on TEST and on LIVE. ```csharp using Adyen; using Adyen.Security; // Override the HttpClientHandler to always return true, for LOCAL TESTING PURPOSES, NEVER run this on live. var handler = new System.Net.Http.HttpClientHandler { ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true }; var client = new Client(config, new System.Net.Http.HttpClient(handler)); ITerminalApiLocalService terminalApiLocalService = new TerminalApiLocalService(client, new SaleToPoiMessageSerializer(), new SaleToPoiMessageSecuredEncryptor(), new SaleToPoiMessageSecuredSerializer()); SaleToPOIResponse response = await terminalApiLocalService.RequestEncryptedAsync(PaymentRequest()); PaymentResponse paymentResponse = response.MessagePayload as PaymentResponse; Console.WriteLine(paymentResponse?.Response?.Result); ``` To parse the terminal API notifications, use the following custom deserializer. This method will throw an exception for non-notification requests. ```csharp var serializer = new SaleToPoiMessageSerializer(); var saleToPoiRequest = serializer.DeserializeNotification(your_terminal_notification); ``` Note that the `AdditionalResponse` field, when performing a CardAcquisition request could be either a `based64 encoded`-string or `key-value`-pair. You can use the `CardAcquisitionUtil.AdditionalResponse(...)`-function to deserialize it. ```csharp AdditionalResponse additionalResponse = CardAcquisitionUtil.AdditionalResponse(jsonString); ``` ### Parsing webhooks The library supports three categories of webhooks, each with a different handler and HMAC validation approach. #### 1. Payment webhooks Payment webhooks (classic notifications) use `IWebhooksHandler`. HMAC validation here takes a `NotificationRequestItem` object. ```csharp using Adyen.Webhooks.Models; using Adyen.Webhooks.Handlers; using Adyen.Webhooks.Extensions; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; IHost host = Host.CreateDefaultBuilder() .ConfigureWebhooks( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenHmacKey = context.Configuration["ADYEN_HMAC_KEY"]; }); services.AddWebhooksHandler(); }) .Build(); var handler = host.Services.GetRequiredService<IWebhooksHandler>(); NotificationRequest notificationRequest = handler.DeserializeNotificationRequest(json); foreach (NotificationRequestItem item in notificationRequest.NotificationItems) { if (handler.IsValidHmacSignature(item)) { // Your logic here based on the notification item } } ``` #### 2. Platform webhooks Platform webhooks (e.g. Authentication, Configuration, Balance, Transfer, Tokenization webhooks) use dedicated handlers per webhook type. HMAC validation takes the **raw JSON string** — the same bytes as received in the HTTP request body. > **Important:** Do **not** use ASP.NET Core automatic model binding (e.g. `[FromBody] MyWebhookRequest`) for these endpoints. Re-serializing a deserialized object may produce different JSON and invalidate the signature. Read the raw request body manually instead: > ```csharp > [HttpPost("api/webhooks/tokenization")] > public async Task<IActionResult> ProcessTokenizationWebhook() > { > using var reader = new StreamReader(Request.Body); > string json = await reader.ReadToEndAsync(); > > if (!_handler.IsValidHmacSignature(json, Request.Headers["HmacSignature"])) > return Unauthorized(); > > TokenizationDisabledDetailsNotificationRequest r = > _handler.DeserializeTokenizationDisabledDetailsNotificationRequest(json); > // Your logic here > } > ``` Example using Authentication webhooks (`AcsWebhooks`): ```csharp using Adyen.AcsWebhooks.Models; using Adyen.AcsWebhooks.Handlers; using Adyen.AcsWebhooks.Extensions; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; IHost host = Host.CreateDefaultBuilder() .ConfigureAcsWebhooks( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenHmacKey = context.Configuration["ADYEN_HMAC_KEY"]; }); services.AddAcsWebhooksHandler(); }) .Build(); var handler = host.Services.GetRequiredService<IAcsWebhooksHandler>(); // webhookPayload is the raw JSON string from the HTTP request body if (handler.IsValidHmacSignature(webhookPayload, "hmacSignature from header")) { AuthenticationNotificationRequest r = handler.DeserializeAuthenticationNotificationRequest(webhookPayload); // Your logic here based on the deserialized webhook } ``` #### 3. Management webhooks Management webhooks follow the same raw-JSON HMAC validation approach as platform webhooks: ```csharp using Adyen.ManagementWebhooks.Extensions; using Adyen.ManagementWebhooks.Models; using Adyen.ManagementWebhooks.Handlers; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; IHost host = Host.CreateDefaultBuilder() .ConfigureManagementWebhooks( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenHmacKey = context.Configuration["ADYEN_HMAC_KEY"]; }); services.AddManagementWebhooksHandler(); }) .Build(); var handler = host.Services.GetRequiredService<IManagementWebhooksHandler>(); // webhookPayload is the raw JSON string from the HTTP request body if (handler.IsValidHmacSignature(webhookPayload, "hmacSignature from header")) { MerchantCreatedNotificationRequest r = handler.DeserializeMerchantCreatedNotificationRequest(webhookPayload); // Your logic here based on the deserialized webhook } ``` ## Feedback We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas. ## Contributing We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our [contributing guidelines](/CONTRIBUTING.md) to find out how to raise a pull request. ## Support If you have a feature request, or spotted a bug or a technical problem, [create an issue here](https://github.com/Adyen/adyen-dotnet-api-library/issues/new/choose). For other questions, [contact our Support Team](https://www.adyen.help/hc/en-us/requests/new?ticket_form_id=360000705420). ## Licence This repository is available under the [MIT license](/LICENSE). ## See also * [Adyen .NET Integration Examples](https://github.com/adyen-examples/adyen-dotnet-online-payments/) * [Adyen Docs](https://docs.adyen.com/) * [API Explorer](https://docs.adyen.com/api-explorer/)

Payment & Checkout
123 Github Stars
adyen-salesforce-commerce-cloud
Open Source

adyen-salesforce-commerce-cloud

# Salesforce Commerce Cloud Adyen Cartridge Adyen provides a LINK cartridge to integrate with [Salesforce Commerce Cloud (SFCC)](https://docs.adyen.com/plugins/salesforce-commerce-cloud). This cartridge enables an SFCC storefront to use the Adyen payment service. ## Documentation and Support For general inquiries related to this repository, developers are welcome to leverage [![AskDeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Adyen/adyen-salesforce-commerce-cloud) AI knowledge base. Please note that while the DeepWiki can be a helpful resource, the **official [Adyen documentation](https://docs.adyen.com/plugins/salesforce-commerce-cloud/) remains the source of truth** for the cartridge. Information found in the DeepWiki should be used at your own discretion. Navigate to [Adyen Docs](https://docs.adyen.com/plugins/salesforce-commerce-cloud/) to read about how to: - [1. Install the cartridge](https://docs.adyen.com/plugins/salesforce-commerce-cloud/sfra-and-sitegenesis/install-the-cartridge-and-import-the-metadata/), - [2. How to add Adyen Settings page (src/bm_adyen) into SFCC Business Manager](https://docs.adyen.com/plugins/salesforce-commerce-cloud/sfra-and-sitegenesis/set-up-the-cartridge/?plugin=Salesforce+SFRA&integration=cartridge&version=25.3.0#set-up-the-business-manager) for easy payments set-up, - [3. Set-up Adyen Cartridge](https://docs.adyen.com/plugins/salesforce-commerce-cloud/sfra-and-sitegenesis/set-up-the-cartridge/?plugin=Salesforce+SFRA&integration=cartridge&version=), - [4. Configure Adyen Payments](https://docs.adyen.com/plugins/salesforce-commerce-cloud/sfra-and-sitegenesis/set-up-payment-methods/?plugin=Salesforce+SFRA&integration=cartridge&version=), - [5. How to Customise the cartridge, Front-end and Payment methods](https://docs.adyen.com/plugins/salesforce-commerce-cloud/sfra-and-sitegenesis/customization-guide/), - [6. See a full list of Supported Payment Methods](https://docs.adyen.com/plugins/salesforce-commerce-cloud/supported-payment-methods/), - [7. Upgrade your Adyen cartridge](https://docs.adyen.com/plugins/salesforce-commerce-cloud/upgrade), - [8. Apple Pay configuration using Adyen certificate or own certificate via Salesforce Apple Pay cartridge](https://docs.adyen.com/plugins/salesforce-commerce-cloud/set-up-payment-methods/#set-up-apple-pay-on-the-web). We recommend using Apple pay with Adyen certificate as Adyen has no insight into Salesforce Apple Pay cartridge. Adyen provides specialized cartridge support for 2 years for major versions, following the [SFCC B2C Support policy](https://docs.adyen.com/plugins/salesforce-commerce-cloud#support-levels), along with permanent Adyen support. Navigate to your Adyen Customer Area Merchant Account to raise a support case. When a major cartridge version is no longer under cartridge support, it will be treated as a custom merchant integration. ### Customization Best Practices **Best practice!** - Modularizing customizations is the recommended approach, as [outlined by Salesforce](https://developer.salesforce.com/docs/commerce/sfra/guide/b2c-customizing-sfra.html). - To customize Adyen payments, create a custom cartridge in your project directory or leverage `int_custom_cartridge`, which is already set up in our repository. - For more guidance on customization, refer to [Adyen Customization Guide](https://docs.adyen.com/plugins/salesforce-commerce-cloud/customization-guide/#add-custom-code). **Not Recommended** - We strongly discourage adding changes directly to Adyen code in /src/cartridges. - Customizations made in Adyen default code cannot be easily separated from your codebase once deployed to production, leading to a more complex and costly upgrade process and reduced Support. ## Compatibility with SFCC architectures - SFRA version 5.x.x, 6.x.x. & 7.x.x.: [Supported in all cartridge versions, see the latest](https://github.com/Adyen/adyen-salesforce-commerce-cloud/releases) - We have a [separate repository for Adyen SFCC PWA (Composable Storefront)](https://github.com/Adyen/adyen-salesforce-headless-commerce-pwa) payment integration. ## Integration This cartridge allows you to integrate with Adyen without the need for any development work from your end. - Online payments are processed on the back-end using the [Checkout API](https://docs.adyen.com/api-explorer/Checkout/latest/overview), and on the client side, Adyen’s [Web Components](https://docs.adyen.com/online-payments/components-web) are used to render payment methods. - Point of Sale (POS) payments are processed using a cloud-based [Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-fundamentals). ### Transpilation Some files in the /src directory contain modern JavaScript (ES6) that Salesforce Commerce Cloud does not natively support. If you want to make ES6 code compatible with ES5 by transpiling, compiling, and uploading the auto-generated code to the /cartridges directory, see [more in our Docs](https://docs.adyen.com/plugins/salesforce-commerce-cloud/install-the-cartridge-and-import-the-metadata/#step-3-build-the-code). ## Requirements It is required to have an Adyen TEST and, later, LIVE account to use the cartridge. You can set it up [here](https://www.adyen.com/signup) or [contact Adyen](https://www.adyen.com/contact/sales). ## Testing End-to-End tests can be found in the `adyen-salesforce-commerce-cloud/tests/e2e` directory. They are run automatically via Github Actions using the `E2E.yml` workflow. To run the tests locally use the following command: ``` `npm run test:e2e` ``` Note: Please make sure to fill in the environment variables in the `fixtures` directory before running the tests locally. As for Unit tests, they are currently only available for SFRA. Test files can be found next to the files they are testing. Mocks are kept in the `jest` directory. To run SFRA unit tests locally use the following command: ``` `npm run test` ``` ## Contributing We strongly encourage you to join us in contributing to this repository so everyone can benefit from: * New features and functionality * Resolved bug fixes and issues * Any general improvements Read our [**contribution guidelines**](CONTRIBUTING.md) to find out how. ## Platform Read more information about the [Adyen platform](https://www.adyen.com/platform). ## Licence MIT license see LICENSE.

Payment & Checkout
104 Github Stars
adyen-python-api-library
Open Source

adyen-python-api-library

![Python](https://user-images.githubusercontent.com/55943882/212274988-4e58b807-d39b-4274-b712-06008b1ef5fc.png) # Adyen APIs Library for Python [![version](https://img.shields.io/pypi/v/Adyen.svg)](https://pypi.org/project/Adyen/) This is the officially supported Python library for using Adyen's APIs. ## Supported API versions | API | Description | Service Name | Supported version | |---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|-------------------| | [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | binLookup | **v54** | | [Balance Platform API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | The Balance Platform API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | balancePlatform | **v2** | | [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | Our latest integration for accepting online payments. | checkout | **v71** | | [Capital API](https://docs.adyen.com/api-explorer/capital/1/overview) | Provides endpoints for embedding Adyen Capital into your marketplace or platform. | capital | **v1** | | [Data Protection API](https://docs.adyen.com/development-resources/data-protection-api) | Endpoint for requesting data erasure. | dataProtection | **v1** | | [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/4/overview) | The Legal Entity Management API enables you to manage legal entities that contain information required for verification. | legalEntityManagement | **v4** | | [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management | **v3** | | [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | Our classic integration for online payments. | payments | **v68** | | [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | Endpoints for sending funds to your customers. | payouts | **v68** | | [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | ~~Endpoints for managing your point-of-sale payment terminals.~~ ‼️ **Deprecated**: use instead the [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview) for the management of your terminal fleet. | ~~terminal~~ | ~~**v1**~~ | | [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | Endpoints for managing saved payment details. | recurring | **v68** | | [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Endpoints for managing gift cards. | storedValue | **v46** | | [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview) | Endpoints for managing transfers, getting information about transactions or moving fund | transfers | **v4** | | [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | disputes | **v30** | | [POS Mobile API](https://docs.adyen.com/api-explorer/possdk/68/overview) | The POS Mobile API is used in the mutual authentication flow between an Adyen Android or iOS [POS Mobile SDK](https://docs.adyen.com/point-of-sale/ipp-mobile/) and the Adyen payments platform. The POS Mobile SDK for Android or iOS devices enables businesses to accept in-person payments using a commercial off-the-shelf (COTS) device like a phone. For example, Tap to Pay transactions, or transactions on a mobile device in combination with a card reader. | posMobile | **v68** | | [Payments App API](https://docs.adyen.com/api-explorer/payments-app/1/overview) | The Payments App API is used to Board and manage the Adyen Payments App on your Android mobile devices. | paymentsApp | **v1** | | [SessionAuthentication API](https://docs.adyen.com/api-explorer/sessionauthentication/1/overview) | The Session authentication API enables you to create and manage the JSON Web Tokens (JWT) required for integrating | sessionAuthentication | **v1** | For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/). ## Prerequisites - [Adyen test account](https://docs.adyen.com/get-started-with-adyen) - [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles). - Python 3.8 or higher - Packages (optional): requests or pycurl ## Installation ### For development purpose Clone this repository and run ~~~~ bash make install ~~~~ ### For usage purpose Use pip command: ~~~~ bash pip install Adyen ~~~~ ## Using the library Every API the library supports is represented by a service object. The name of the service matching the corresponding API is listed in the [Integrations](#supported-api-versions) section of this document. This library offers two ways to initialize and use the Adyen API services. #### Using all services For simple scripts or applications that only use a single set of API credentials, you can use the main `Adyen` object. This creates a convenient "facade" that loads and provides easy access to all available APIs. Keep in mind that different API keys will have different scopes so you may still need more than one instance. ~~~~python import Adyen # Create the all-in-one client adyen = Adyen.Adyen() # Configure the client adyen.client.xapikey = "YourXapikey" adyen.client.platform = "test" # change to "live" for production adyen.client.application_name = "MyTestApp" # if applicable, set application name (for tracking purposes) # Prepare the request request = { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "amount": { "currency": "USD", "value": 1000 # value in minor units }, "reference": "Your order number", "paymentMethod": { "type": "visa", "encryptedCardNumber": "test_4111111111111111", "encryptedExpiryMonth": "test_03", "encryptedExpiryYear": "test_2030", "encryptedSecurityCode": "test_737" }, "returnUrl": "https://your-company.com/..." } # Make the API call through the long-form path result = adyen.checkout.payments_api.payments(request) ~~~~ #### Using Individual Service Clients For some web applications (e.g., using Flask or Django), multi-threaded environments, or any use case where you might need to manage multiple API credentials (for different merchant accounts, ECOM vs. POS, etc.), it is recommended to instantiate API clients directly. ~~~~python # Import the core client and the service-level API class from Adyen.client import AdyenClient from Adyen.services import AdyenCheckoutApi # Create and configure the core AdyenClient adyen_client = AdyenClient() adyen_client.xapikey = "YourXapikey" adyen_client.platform = "test" adyen_client.application_name = "MyTestApp" # if applicable, set application name (for tracking purposes) # Instantiate the AdyenCheckoutApi service checkout_service = AdyenCheckoutApi(client=adyen_client) # Make API calls using the sub-clients within the service request = {"merchantAccount": "YOUR_MERCHANT_ACCOUNT", ...} payment_result = checkout_service.payments_api.payments(request) order_result = checkout_service.orders_api.orders(request) ~~~~ Similarly you can instantiate a separate client for services that required different API keys ~~~~python adyen_lem_client = AdyenClient() adyen_lem_client.xapikey = "YourLEMXapikey" adyen_lem_client.platform = "test" adyen_lem_client.application_name = "MyTestApp" # if applicable, set application name (for tracking purposes) ~~~~ #### Force HTTP library ~~~~python import Adyen adyen = Adyen.Adyen() adyen.client.http_force = 'requests' # or 'pycurl' ~~~~ ### Using query parameters (management API only) Define a dictionary with query parameters that you want to use. ~~~~ python query_parameters = { 'pageSize': 10, 'pageNumber': 3 } ~~~~ pass the dictionary to the method as an additional argument. ~~~~ python adyen.management.account_company_level_api.get_companies(query_parameters=query_parameters) ~~~~ ### Using Header Parameters Define a dictionary containing the headers you want to include in your request. ~~~~ python headers = { "Var1": "Var2", "Var2": "Var1" } ~~~~ Pass the dictionary as an additional argument to the method where you make the API call. ~~~~ python adyen.checkout.payments_api.payments(header_parameters=headers) ~~~~ ### Customizing Base URL Instantiate the service and replace the baseUrl with your own URL ~~~~ python service = adyen.checkout.payments_api service.baseUrl = "localhost:8080" ~~~~ ### Handling exceptions Adyen service exceptions extend the AdyenError class. After you catch this exception, you can access the class arguments for the specifics around this error or use the debug method which prints all the arguments. ~~~~python try: adyen.checkout.payments_api.payments(request) except Adyen.exceptions.AdyenError as error: print(error.debug()) ~~~~ <details><summary>List of exceptions</summary> <p>AdyenInvalidRequestError</p> <p>AdyenAPIResponseError</p> <p>AdyenAPIAuthenticationError</p> <p>AdyenAPIInvalidPermission</p> <p>AdyenAPICommunicationError</p> <p>AdyenAPIValidationError</p> <p>AdyenAPIUnprocessableEntity</p> <p>AdyenAPIInvalidFormat</p> <p>AdyenEndpointInvalidFormat</p> </details> ### Example integration For a closer look at how our Python library works, clone our [example integration](https://github.com/adyen-examples/adyen-python-online-payments). This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library. ## Feedback We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas. ## Contributing We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our [contributing guidelines](CONTRIBUTING.md) to find out how to raise a pull request. ## Support If you have a feature request, or spotted a bug or a technical problem, [create an issue here](https://github.com/Adyen/adyen-web/issues/new/choose). For other questions, [contact our Support Team](https://www.adyen.help/hc/en-us/requests/new?ticket_form_id=360000705420). ## Licence This repository is available under the [MIT license](LICENSE.md). ## See also * [Example integration](https://github.com/adyen-examples/adyen-python-online-payments) * [Adyen docs](https://docs.adyen.com/) * [API Explorer](https://docs.adyen.com/api-explorer/)

Payment & Checkout API Tools
67 Github Stars
adyen-ruby-api-library
Open Source

adyen-ruby-api-library

![Ruby](https://user-images.githubusercontent.com/93914435/236416787-3da4dd32-0a7d-43f7-9aa4-8d77697c85f9.png) # Adyen API Library for Ruby [![Gem Version](https://img.shields.io/gem/v/adyen-ruby-api-library.svg)](https://rubygems.org/gems/adyen-ruby-api-library) This is the officially supported Ruby library for using Adyen's APIs. ## Supported APIs This library supports the following: | API name | API version | Description | API object | |-------------------------------------------------------------------------------------------------------------------------------|:-----------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------| | [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | v54 | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | [BinLookup](lib/adyen/services/binLookup.rb) | | [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | v71 | Our latest integration for accepting online payments. | [CheckoutAPI](lib/adyen/services/checkout.rb) | | [Capital API](https://docs.adyen.com/api-explorer/capital/1/overview) | v1 | Provides endpoints for embedding Adyen Capital into your marketplace or platform. | [Capital](lib/adyen/services/capital.rb) | | [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | v2 | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | [BalancePlatform](lib/adyen/services/balancePlatform.rb) | | [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | v1 | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | [DataProtection](lib/adyen/services/dataProtection.rb) | | [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | v4 | Manage legal entities that contain information required for verification. | [LegalEntityManagement](lib/adyen/services/legalEntityManagement.rb) | | [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | v3 | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](lib/adyen/services/management.rb) | | [OpenBanking API](https://docs.adyen.com/api-explorer/open-banking/1/overview) | v1 | Securely share financial data and services with third parties. | [OpenBanking](lib/adyen/services/openBanking.rb) | | [SessionAuthentication API](https://docs.adyen.com/api-explorer/sessionauthentication/1/overview) | v1 | The Session authentication API enables you to create and manage the JSON Web Tokens (JWT) required for integrating components. | [SessionAuthentication](lib/adyen/services/sessionAuthentication.rb) | | [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | v68 | Our classic integration for online payments. | [Classic Integration API](lib/adyen/services/payment.rb) | | [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | v68 | Endpoints for sending funds to your customers. | [Payout](lib/adyen/services/payout.rb) | | [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | ~~v1~~ | ~~Endpoints for managing your point-of-sale payment terminals.~~ ‼️ **Deprecated**: use instead the [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview) for the management of your terminal fleet. | ~~[TerminalManagement](lib/adyen/services/posTerminalManagement.rb)~~ || [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | v68 | Endpoints for managing saved payment details. | [Recurring](lib/adyen/services/recurring.rb) | | [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | v46 | Manage both online and point-of-sale gift cards and other stored-value cards. | [StoredValue](lib/adyen/services/storedValue.rb) | | [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview) | v4 | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | [Transfers](lib/adyen/services/transfers.rb) | | [Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/terminal-api-reference/) | - | Our point-of-sale integration. | [TerminalCloudAPI](lib/adyen/services/terminalCloudAPI.rb) | | [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | v30 | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | [Disputes](lib/adyen/services/disputes.rb) | | [POS Mobile API](https://docs.adyen.com/api-explorer/possdk/68/overview) | v68 | The POS Mobile API is used in the mutual authentication flow between an Adyen Android or iOS [POS Mobile SDK](https://docs.adyen.com/point-of-sale/ipp-mobile/) and the Adyen payments platform. The POS Mobile SDK for Android or iOS devices enables businesses to accept in-person payments using a commercial off-the-shelf (COTS) device like a phone. For example, Tap to Pay transactions, or transactions on a mobile device in combination with a card reader. | [POS Mobile](lib/adyen/services/posMobile.rb) | | [Payments App API](https://docs.adyen.com/api-explorer/payments-app/1/overview) | v1 | The Payments App API is used to Board and manage the Adyen Payments App on your Android mobile devices. | [paymentsApp](lib/adyen/services/paymentsApp.rb) | For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/). ## Prerequisites - [Adyen test account](https://docs.adyen.com/get-started-with-adyen) - [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles). - Ruby >= 2.7 ## Installation The sole dependency is faraday for HTTP communication. Run the following command to install faraday if you don't already have it: ~~~~bash bundle install ~~~~ To validate functionality of client and run mock API tests use ~~~~bash bundle install --with development ~~~~ and ~~~~bash rspec ~~~~ ## Documentation Follow the rest of our guides from the [documentation](https://adyen.github.io/adyen-ruby-api-library/) on how to use this library. ## Using the library ### General use with API key ~~~~bash require 'adyen-ruby-api-library' ~~~~ ~~~~ruby adyen = Adyen::Client.new adyen.api_key = 'AF5XXXXXXXXXXXXXXXXXXXX' # If applicable, set application name (for tracking purposes) # adyen.application_name = 'MyTestApp' ~~~~ - Make a Payment ~~~~ruby response = adyen.checkout.payments_api.payments({ :amount => { :currency => "EUR", :value => 1000 }, :reference => "Your order number", :paymentMethod => { :type => "scheme", :encryptedCardNumber => "test_4111111111111111", :encryptedExpiryMonth => "test_03", :encryptedExpiryYear => "test_2030", :encryptedSecurityCode => "test_737" }, :returnUrl => "https://your-company.com/checkout/", :merchantAccount => "YourMerchantAccount" }) ~~~~ ### Example integration For a closer look at how our Ruby library works, clone our [example integration](https://github.com/adyen-examples/adyen-rails-online-payments). This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library. ### Running the tests To run the tests use : ~~~~bash bundle install --with development ~~~~ ## Using the Cloud Terminal API Integration In order to submit In-Person requests with [Terminal API over Cloud](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/cloud/) you need to initialize the client in the same way as explained above for Ecommerce transactions: ``` ruby # Step 1: Require the parts of the module you want to use require 'adyen-ruby-api-library' # Step 2: Initialize the client object adyen = Adyen::Client.new(api_key: 'YOUR_API_KEY', env: :test) # Step 3: Create the request serviceID = "123456789" saleID = "POS-SystemID12345" POIID = "Your Device Name(eg V400m-123456789)" # Use a unique transaction for every transaction you perform transactionID = "TransactionID" request = { "SaleToPOIRequest": { "MessageHeader": { "MessageClass": "Service", "MessageCategory": "Payment", "MessageType": "Request", "ServiceID": serviceID, "SaleID": saleID, "POIID": POIID, "ProtocolVersion": "3.0" }, "PaymentRequest": { "SaleData": { "SaleTransactionID": { "TransactionID": transactionID, "TimeStamp": "2023-08-23T09:48:55" }, "SaleToAcquirerData": "eyJhcHBsaWNhdGlvbkluZm8iOnsiYWR5ZW5MaWJyYXJ5Ijp7Im5hbWUiOiJhZ....", "TokenRequestedType": "Transaction" }, "PaymentTransaction": { "AmountsReq": { "Currency": "EUR", "RequestedAmount": 10 } } } } } # Step 4: Make the request response = adyen.terminal_cloud_api.sync(request) ``` ### Optional: perform an abort request To perform an [abort request](https://docs.adyen.com/point-of-sale/basic-tapi-integration/cancel-a-transaction/) you can use the following example: ``` ruby abortRequest = { "MessageHeader": { "MessageClass": "Service", "MessageCategory": "Abort", "MessageType": "Request", "ServiceID": serviceID, "SaleID": saleID, "POIID": POIID, "ProtocolVersion": "3.0" }, "AbortRequest": { "AbortReason": "MerchantAbort", "MessageReference": { "MessageCategory": "Payment", "SaleID": saleID, # Service ID of the payment you're aborting "ServiceID": serviceID, "POIID": POIID } } } response = adyen.terminal_cloud_api.sync(abortRequest) ``` ### Optional: perform a status request To perform a [status request](https://docs.adyen.com/point-of-sale/basic-tapi-integration/verify-transaction-status/) you can use the following example: ``` ruby statusRequest = { "MessageHeader": { "MessageClass": "Service", "MessageCategory": "TransactionStatus", "MessageType": "Request", "ServiceID": serviceID, "SaleID": saleID, "POIID": POIID, "ProtocolVersion": "3.0" }, "TransactionStatusRequest": { "ReceiptReprintFlag": true, "DocumentQualifier": [ "CashierReceipt", "CustomerReceipt" ], "MessageReference": { "SaleID": saleID, # serviceID of the transaction you want the status update for "ServiceID": serviceID, "MessageCategory": "Payment" } } } response = adyen.terminal_cloud_api.sync(statusRequest) ``` ## OAuth usage (for Partners) If you are using our OAuth service to make API requests on your customer's behalf, and you already got your Access Token as explained in the [OAuth Integration Guide](https://docs.adyen.com/development-resources/oauth/integration/#page-introduction), you can setup your Client like in the following example: ~~~~ruby adyen = Adyen::Client.new adyen.oauth_token = "oauth_token" ~~~~ The APIs available to use through OAuth in this library depend on the [OAuth Scopes](https://docs.adyen.com/development-resources/oauth/scopes/) defined when [Registering your OAuth client](https://docs.adyen.com/development-resources/oauth/integration/#step-1-register-your-client). ## Contributing We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our [contributing guidelines](/CONTRIBUTING.md) to find out how to raise a pull request. ## Support If you have a feature request, or spotted a bug or a technical problem, [create an issue here](https://github.com/Adyen/adyen-ruby-api-library/issues/new/choose). For other questions, [contact our Support Team](https://www.adyen.help/hc/en-us/requests/new?ticket_form_id=360000705420). ## Licence This repository is available under the [MIT license](https://github.com/Adyen/adyen-ruby-api-library/blob/main/LICENSE). ## See also * [Example integration](https://github.com/adyen-examples/adyen-rails-online-payments) * [Adyen docs](https://docs.adyen.com/) * [API Explorer](https://docs.adyen.com/api-explorer/)

Payment & Checkout
53 Github Stars
adyen-sapcommercecloud
Open Source

adyen-sapcommercecloud

# Adyen SAP Commerce Cloud (Hybris) v6 plugin Latest stable version: https://github.com/Adyen/adyen-hybris/releases This plugin supports SAP Commerce (Hybris) versions 2105 The plugin is using following adyen libraries and API. - [adyen-java-api-library](https://github.com/Adyen/adyen-java-api-library) (v38.3.0) - [adyen-web](https://github.com/Adyen/adyen-web) (v6.5.0) - [Adyen Checkout API](https://docs.adyen.com/api-explorer/) (v71) ## Integration The SAP Commerce integrates Adyen Checkout for all card payments and local/redirect payment methods. ## Requirements SAP Commerce (Hybris) version 2105 or later ## Installation ### 1. Copy extension files to bin/custom directory ### 2. Add the Adyen extensions to the config/localextensions.xml file #### Checkout Required for accelerator checkout: ``` <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6core"/> <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6b2ccheckoutaddon"/> <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6backoffice"/> ``` Required for headless checkout: ``` <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6core"/> <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyencheckoutaddonapi"/> <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6backoffice"/> ``` Required for headless checkout api with example React SPA checkout: ``` <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6core"/> <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyencheckoutaddonapi"/> <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyencheckoutaddonspa"/> <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6backoffice"/> ``` #### Notifications Required for the notifications: ``` <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6notification"/> ``` Required for the event driven notifications: ``` <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6notificationv2"/> ``` #### Order management Additionally, required when using yacceleratorordermanagement (b2c_acc_oms recipe for 6.x and b2c_b2b_acc_oms recipe for 1905) : ``` <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6ordermanagement"/> ``` #### Fulfilment Additionally, required when using yacceleratorfulfilment (b2c_acc recipe for 6.x and b2c_acc_plus for 1905): ``` <extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6fulfilmentprocess"/> ``` ### 3. Modify local.properties Modify config/local.properties file: 1. append ``` ,/[^/]+(/[^?]*)+(adyen-response)$,/adyen(/[^?]*)+$ ``` to the value of ```csrf.allowed.url.patterns``` 2. add ```is3DS2allowed = true``` ### 4. Build ``` cd bin/platform . ./setantenv.sh ant addoninstall -Daddonnames="adyenv6b2ccheckoutaddon" -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront" ant clean all ``` ### 5. Add your Adyen credentials to the BaseStore via Hybris backoffice For more detailed instructions you can visit the [documentation page](https://github.com/Adyen/adyen-hybris/wiki) Please make sure your merchant has Variant true in API and responses section so that you get paymentMethod back in response. ## React fronend build 1. Go to adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout 2. Open terminal and run `npm run i` 3. For development build run `npm run build` 4. For deployment build run `npm run build-prod` ## Supported payment methods A reference of all supported payment methods is [here](https://github.com/Adyen/adyen-hybris/wiki#supported-payment-methods). ### Credit Cards Credit Card payments are supported using Checkout Components. ### Apple Pay Apple Pay is supported using Checkout Components. ### Ratepay Ratepay is supported via Adyen API. ### AfterPay AfterPay is supported via Adyen component and API. ### Boleto Boleto is supported via Adyen API. ### Pix Pix is supported via Adyen component and API. ### Other alternative payment methods Supported via Adyen Checkout. ## Usage with OCC The plugin supports the following OCC v2 compatible methods via [com.adyen.v6.facades.AdyenCheckoutFacade](adyenv6core/src/com/adyen/v6/facades/AdyenCheckoutFacade.java): 1. PaymentDetailsListWsDTO getPaymentDetails(String userId) throws IOException, ApiException; ``` OCC controller: UsersController.getPaymentInfos Endpoint: GET /{userId}/paymentdetails ``` This method that will return the stored cards associated to the shopping cart user via Adyen API. 2. PaymentDetailsWsDTO addPaymentDetails(PaymentDetailsWsDTO paymentDetails, DataMapper dataMapper); ``` OCC controller: CartsController.addPaymentDetails Endpoint: POST /{cartId}/paymentdetails ``` This method that will receive the payment method selection and rest of payment details and store them in the Cart. For Credit Card payments - it expects encrypted card holder data obtained from your frontend implementation using Secured Fields For Stored Cards payments - selected Adyen recurringReference of the card and encrypted cvc For Boleto payments - social security number 3. OrderData authorisePayment(CartData cartData) throws Exception; ``` OCC controller: OrdersController.placeOrder Endpoint: POST /users/{userId}/orders ``` This method will place the payment request using the previously stored payment method selection data. Upon successful response from Adyen API, it will register payment response in cart/order level. It returns an instance of OrderWSDTO obtained from OrderData of the placed order. For Boleto, it will contain the pdf url, the base64 encoded data, expiration date and due date. ## 3DS2 configuration By default 3DS2 is enabled (Except for OCC). If you want to disable 3DS2 in your system, please set following property in local.properties file, build your environment and restart the server. ``` is3DS2allowed = false ``` ## POS Timeout configuration POS timeout (time calculated since initiating a payment) is max time to keep terminal connection open. It is set to 130 seconds by default already. If you want to change it, please add following property in local.properties file, build your environment and restart the server. (Change 130 to your desired time, in seconds). ``` pos.totaltimeout = 130 ``` ## Credit card holder name configuration By default Credit card holder name is a mandatory field, You can disable it by setting following property in `local.properties` file. ``` isCardHolderNameRequired = false ``` ## Pending Order Timeout configuration By default, an order remains in PAYMENT_PENDING status in order management for 1 hour and it is configured in dynamic order process defintiion file. Based on which extension you are using (fulfillment or ordermanangement) timeout value can be updated in corresponding order-process.xml file. For example, following 2 files have 60 mins configuration under waitForAdyenPendingPayment process with delay value=PT60M Fulfillment extension file - resources/adyenv6fulfilmentprocess/process/order-process.xml OrderManagement extension file - resources/adyenv6ordermanagement/process/order-process.xml ``` <wait id="waitForAdyenPendingPayment" then="checkPendingOrder"> <event>AdyenPaymentResult</event> <timeout delay="PT60M" then="checkPendingOrder"/> </wait> ``` ## PayPal configuration This plugin uses Adyen's Checkout Component for PayPal payments. To use that in a live environment, a PayPal Merchant Id is required. This id has to be provided when adding your Adyen credentials to the BaseStore via the backoffice [(installation step 5)](#installation). ## SameSite Cookie Handler configuration On Google Chrome browser versions 80 or later, it might occur that an account is logged out after trying to place an order using a credit card that requires 3D Secure authentication or using other redirect payment methods. This is a consequence of how newer versions of Chrome browsers handle the [SameSite attribute](https://web.dev/samesite-cookies-explained/) on cookies, invalidating the user session after a redirect to a third-party page happened. To avoid those issues, for SAP Commerce versions 6.x or 1905, a cookie handler included in this plugin can be used. To enable it, add the following configuration to the config/local.properties file: ``` adyen.samesitecookie.handler.enabled=true ``` For SAP Commerce versions 2005 and above, check how to use [SAP's SameSite Cookie Attribute Handler](https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/2005/en-US/bde41b6a42c541a08eb2a3b1993fb097.html). ## Amazon Pay configuration To be able to complete payments in Amazon Pay, you must add your Amazon Pay private key to the following folder /adyen-hybris/adyenv6core/resources/certificates, and once done, set the correct PEM file name on /adyen-hybris/adyenv6core/src/com/adyen/v6/DefaultAdyenAmazonPayIntegratorService.java in the following line: ``` payConfiguration = new PayConfiguration() .setPublicKeyId(amazonpayPublicKey) .setRegion(Region.valueOf(amazonpayRegion.getCode())) ---> .setPrivateKey(new String(Files.readAllBytes(ResourceUtils.getFile("classpath:certificates/amazonpay/YourCertificateName.pem").toPath())).toCharArray()) ``` ## Multiple merchant configuration Introduces possibility to select merchant for given transaction based on strategy that could be extended. By default merchant account is one in adyenMerchantAccount on BaseStore. ### Example In /examples/adyenmultiplemerchantexample there is extension that introduces necessary changes to achieve selection of merchant account based on shipping address country selected during checkout process. ## Documentation https://github.com/Adyen/adyen-hybris/wiki ## Support If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our [support team](https://support.adyen.com/hc/en-us/requests/new?ticket_form_id=360000705420). ## Contributing We strongly encourage you to join us in contributing to this repository so everyone can benefit from: * New features and functionality * Resolved bug fixes and issues * Any general improvements Read our [**contribution guidelines**](CONTRIBUTING.md) to find out how. ## License MIT license. For more information, see the LICENSE file.

CMS Plugins & Extensions Payment & Checkout
30 Github Stars
adyen-shopware6
Open Source

adyen-shopware6

# Adyen Payment plugin for Shopware 6 Use Adyen's plugin for Shopware 6 to offer frictionless payments online, in-app, and in-store. ## Contributing We strongly encourage you to join us in contributing to this repository so everyone can benefit from: * New features and functionality * Resolved bug fixes and issues * Any general improvements Read our [**contribution guidelines**](https://github.com/Adyen/.github/blob/main/CONTRIBUTING.md) to find out how. ## Requirements This plugin supports Shopware >= 6.3.1.1 Please note that versions >= 3.0.0 of this plugin only support Shopware versions >= 6.4. If you are on a lower Shopware version please use version 2. For Shopware 5 support please see our Shopware 5 repository. ## Documentation Please find the relevant documentation for - [How to start with Adyen](https://www.adyen.com/get-started) - [Adyen Plugin for Shopware 6](https://docs.adyen.com/plugins/shopware-6) - [Adyen PHP API Library](https://docs.adyen.com/development-resources/libraries#php) ## Support If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our [support team](https://support.adyen.com/hc/en-us/requests/new?ticket_form_id=360000705420). # For developers ## Integration The plugin integrates card component (Secured Fields) using Adyen Checkout for all card payments. ### Supported payment methods - Credit and debit cards (non 3D secure, 3D secure 1, 3D secure 2 native) - Stored card payment methods (One click payment methods) - Express checkout (with GooglePay, ApplePay, and PayPal methods) - Affirm - AfterPay invoice - Alipay , Alipay HK - Amazon Pay - Apple Pay - Bancontact - Blik - Billie - Clearpay - Electronic Payment Service (EPS) - Gift cards - Google Pay - iDeal - Klarna Pay Later - Klarna Pay Now - Klarna Pay Over Time - Klarna Debit Risk - MB Way - MobilePay - Multibanco - Oney (3x, 4x, 6x, 10x, 12x) - PayBright - PayPal - PaySafeCard - RatePay, RatePay Direct Debit - SEPA Direct Debit - Swish - Trustly - Twint - Vipps - WeChat Pay - Open Banking / Pay by Bank - Online Banking Finland - Online Banking Poland ### Webhook Setup For users with sales channels that have a storefront, webhooks should be configured following the standard process outlined in the [Adyen documentation](https://docs.adyen.com/plugins/shopware-6/#set-up-webhooks). If a user has **only** headless sales channels (i.e., channels without a storefront), webhook support is also available. In this case, the webhook URL should be structured as follows: Sales channel domain URL followed by `/store-api/adyen/notification/{salesChannelId}`. The `salesChannelId` parameter must be a valid sales channel ID of an active sales channel. ## API Library This module is using the Adyen APIs Library for PHP for all (API) connections to Adyen. <a href="https://github.com/Adyen/adyen-php-api-library" target="_blank">This library can be found here</a> ## License MIT license. For more information, see the [LICENSE file](LICENSE).

Developer Tools CMS Plugins & Extensions Payment & Checkout
25 Github Stars
adyen-prestashop
Open Source

adyen-prestashop

# Adyen Payment plugin for PrestaShop Use Adyen's plugin for PrestaShop to offer frictionless payments online, in-app, and in-store. ## Contributing We strongly encourage you to join us in contributing to this repository so everyone can benefit from: * New features and functionality * Resolved bug fixes and issues * Any general improvements Read our [**contribution guidelines**](CONTRIBUTING.md) to find out how. ## Requirements This plugin supports PrestaShop versions 1.7.5.0 to 9.1.1. ## Documentation Please find the relevant documentation for - [How to start with Adyen](https://www.adyen.com/get-started) - [Plugin documentation](https://github.com/Adyen/adyen-prestashop/wiki) for installation and configuration guidance. ## Support If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our [support team](https://support.adyen.com/hc/en-us/requests/new?ticket_form_id=360000705420). Note: if you are still using an **older version** of the Adyen Prestashop integration (**below v5.0**) please refer to [this documentation](https://github.com/Adyen/adyen-prestashop/wiki/Home/ab7b1ee3c889c2b1fc3395cf21f55fcfcdfac1b2). #### Important information #### Support deprecation plan for old plugins Prestashop (below major release v5.0): 1. Only critical functionality and security updates until June 2024. 2. Only critical security updates from June 2024 until June 2025. 3. Support will be fully suspended for old Prestashop plugins from June 2025 onwards. ### Disclaimer We only support the plugin with no customizations. Please make sure before you raise an issue that you revisit it on a newly installed "vanilla" PrestaShop environment. With this practise you can make sure that the issue is not created by a customization or a third party plugin. # For developers ## Integration The plugin integrates card component (Secured Fields) using Adyen Checkout for all card payments. Currently, the following versions of Web components and Checkout API are utilized in the code: * **Checkout API version:** v71 * **Checkout Web Component version:** 5.65.0 ## License MIT license. For more information, see the LICENSE file.

CMS Plugins & Extensions Payment & Checkout
15 Github Stars