Skip to content

Getting started with Payway and Adyen

Target audience: Developers, Stakeholders

Getting started checklist

  1. Contact Adyen or use their portal to set up credentials.
  2. Contact Adeprimo to enable the feature.
  3. Establish communication between Payway and Adyen by doing the initial setup.
  4. Follow the desired implementation guide, depending on your integrational needs.
  5. Test the implementation with Adeprimo and Adyen in a testing environment. See testing protocol.

Adyen Credentials

  • For test/staging environment you'll probably only need one set of credentials.
  • For production depending on how you want to split your orders/economy, you may want to separate credentials for each Payway title. This is done by setting up sub-merchants in your Adyen merchant portal.

Implementation

1. The basic implementation

In order to place your first Adyen order with Payway, the following parameters are required:

Parameter Description Example Value
payment_method The payment method provided by the Adyen widget adyen_scheme
product_code The easiest way is to navigate to PAP -> Packages & Campaigns, and locate the product that you wish to sell.
Once located, you will find the product code both in the table view as well as in the edit view.
If you wish to go via our API, you can read more here.
adeprimo_digital
period_id You can find the associated period ids for a given product code using our API here. 5c6291d537c2ed78a11518b7
origin The URL that the purchase has originated from https://adeprimo.se/my-article
browser_info Object containing information about the customer's browser
browser_ip
IP address of the customer
e.g. "127.0.0.1"
127.0.0.1
browser_language
Language-code of the customer
e.g. "sv-FI"
sv-FI
browser_user_agent
User agent of the customer
e.g. "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
Mozilla/5.0 (Windows NT 10.0; Win64; x64)
referer
e.g. "https://adeprimo.se" https://adeprimo.se
accept_header
e.g. "text/html,application/xhtml+xml" text/html,application/xhtml+xml
color_depth
e.g. 24 24
screen_height
e.g. 723 723
screen_width
e.g. 1536 1536
time_zone_offset
e.g. 0 0
java_enabled
Whether java is enabled on the customers browser (true/false) true

While more parameters can be defined, this is all you need to know for now.

After having defined these parameters, you will want to perform the following HTTP request, including the payload above:

curl --request POST \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/adyen/place_order \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
            "payment_method": "",
            "product_code": "",
            "period_id": "",
            "origin": "",
            "browser_info": {
              "browser_ip": "",
              "browser_language": "",
              "browser_user_agent": "",
              "referer": "",
              "accept_header": "",
              "color_depth": "",
              "screen_height": "",
              "screen_width": "",
              "time_zone_offset": "",
              "java_enabled": ""
            }
          }'

Note that most use cases will require additional authentication. You can read more about these cases here.

And that's it! Granted you got a 200 OK response, and you have now successfully placed your first Adyen order with Payway.

2. Using payment profiles

Using account payment profiles when placing Adyen orders is a slightly more advanced way of doing things, but comes with a higher conversion rate and a much easier experience for your customers.

This will allow your existing customers to simply select their existing/previous payment method from a list, and perform the purchase without for example having to go fetch their credit card.

In order to place your first Adyen order with Payway using account payment profiles, the following parameters are required:

Parameter Description Example value
account_id OR email You can fetch the Account ID based on a customer's credentials by using our API here.
or
You will find the customer's contact email in the PAP customer overview.
If you wish to use our API, you can read more here.
adeprimo@servicedesk.com
product_code The product code that should be sold adeprimo_digital
period_id The period id that should be sold 5c6291d537c2ed78a11518b7
receipt_url The receipt url that the customer should be redirected to upon completed purchase https://adeprimo.se/receipt
account_payment_profile_id You can fetch available account payment profiles for an account using our API here. 5c1341d537c2ed78a1151375

While more parameters can be defined, this is all you need for now.

After having defined these parameters, you will want to perform the following HTTP request, including the payload above:

curl --request POST \
  --url https://payway-api.stage.adeprimo.se/external/api/v2/accounts/create_order \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
            "account_id": "",
            "product_code": "",
            "period_id": "",
            "receipt_url": "",
            "account_payment_profile_id": ""
          }'

And that's it! Granted you got a 200 OK response, you have now successfully placed your first Adyen order with Payway, using account payment profiles!

Go live checklist

  1. Contact Adyen for production credentials.
  2. Contact Adeprimo to enable the feature in production.
  3. If possible, do a soft release to ease verification and potential blowback.
  4. Test the implementation with Adeprimo and Adyen in a testing environment. See testing protocol.
Required for all implementations
Required for redirect implementations

Use cases

I'm going to use the Payway purchase flow(PPF)
I want to implement a checkout solution on my site
I want to perform a redirect to the Payway Adyen Redirect Provider(PARP)