Skip to main content

Integrating Adyen using an AWS lambda

Deprecated
This feature is now deprecated since February 1, 2021.

As of February 2021, all new integrations must be configured in the platform as the AWS lambda has been deprecated and NewStore will stop supporting it soon.

Setting up the adapter​

The template.yaml contains default values that you can change to configure the adapter for the retailer:

  • bucket_timeout: Timeout value for AWS S3 operations in seconds.
  • endpoint: Adyen's service base URL.
  • event_code_mapping: Events received by Adyen, corresponding to webhooks in NewStore Omnichannel Cloud.
  • event_code_forwarding: Decides which Adyen specific event codes (ex: AUTHORISATION, CAPTURE) are formatted to NewStore async.
  • immediate_capture: Set to the same value as the setting in the retailer's merchant account in Adyen. If set to true, authorization and capture transactions are sent back to NewStore Omnichannel Cloud when the Create financial instrument webhook is called. Sends only the authorization transaction if this is false.
  • merchant_account: The Adyen merchant account for the retailer. This is a fallback mechanism as the merchant account is sent as metadata in the hooks.
  • newstore_api_endpoint: The NewStore host (ex: retailer.v.newstore.net).
  • newstore_api_password: The password of the NewStore API user.
  • newstore_api_user: The user eligible to access the NewStore API.
  • newstore_requests_folder: The folder in the S3 bucket to save hook requests from NewStore
  • notification_folder: The folder in the S3 bucket to save notifications from Adyen.
  • notification_password: The notification password set for the retailer in Adyen. This is used to build the authorization header from async messages (credentials).
  • notification_user: The notification username set for the retailer in Adyen.
  • process_request_sync_mapping: The mapping of Adyen's async methods that are processed synchronously.
  • provider_name: The provider name set for the external_providers key. The current value can be verified with the Payment configuration API.
  • reason_code_mapping: The NewStore Omnichannel Cloud transaction reason corresponding to the webhooks in NewStore Omnichannel Cloud.
  • resource_mapping: Resources in Adyen corresponding to the webhooks in NewStore Omnichannel Cloud.
  • s3_bucket: NewStore's Amazon S3 bucket for the retailer.
  • timeout: The request timeout for the http client in milliseconds.
  • timeout_offset: The offset in milliseconds which will be deducted from the remaining run time before the lambda timeout to construct a response to the platform.
  • ws_password: The web service password for the retailer in Adyen. This is used to build the authorization header (credentials).
  • ws_user: The web service username for the retailer in Adyen. This is used to build the authorization header (credentials).

Deploying the adapter​

  1. Create an AWS session for the deployment profile (develop, sandbox, staging etc.)
  2. Set the following environment variables to deploy the AWS Lambda:
VariableDescription
TENANT_NAME_IN_PREFIXIf set, creates a stack like tenant-adyen_dev. Otherwise, creates adyen_dev.
NEWSTORE_TENANTThe retailer.
NEWSTORE_STAGEThe deployment environment.
MERCHANT_ACCOUNTThe retailer's merchant account in Adyen.
WS_USERThe retailer's web_service_user_name set in Adyen.
WS_PASSWORDThe retailer's web_service_password set in Adyen.
NOTIFICATION_USERThe retailer's notification_user_name, set in Adyen.
NOTIFICATION_PASSWORDThe retailer's notification_password set in Adyen.

This creates a stack and function with the tenant name in prefix and stage as suffix. For example, retailer-adyen_dev.

  • To deploy or update the settings, use make create-cf-stack.
  • To update only the function code, use make update-cf-function-code.
  • To delete the stack, make delete-cf-stack.

Ensure that:

  • The published API gateway endpoint is accurate, since this configures Adyen on NewStore Omnichannel Cloud.
  • The Standard Notifications URL in Adyen is accurate.