Upgrade your Adyen Salesforce Order Management System (OMS) package from a First-Generation Managed Package to a Second-Generation Managed package.
Step 1: Install the packages
Install:
- The latest
API Library Apex Adyen
package with the installation key Payments@Adyen. - The Adyen Payments for Salesforce Order Management (SOM) app with the installation key Payments@Adyen.
- Add the contents of the Adyen Salesforce OMS folder on GitHub to your sandbox. You must be logged in to GitHub to access this folder.
Step 2: Run the migration script
- In your Developer Console, go to Debug> Open Execute Anonymous Window.
-
Enter the following code in the Enter Apex Code window and execute:
Id batchprocessid = Database.executeBatch(new BatchAdyenOMSMigration());
This will execute the
BatchAdyenOMSMigration.cls
migration script. This script copies your package's custom attribute values from your existing OMS version to the new version.
You will receive an email when the batch process is completed.
Step 3: Configure your Salesforce site
- In your Developer Console, go to Query Editor and execute the following query:
SELECT Id FROM ApexClass WHERE Name = 'AdyenAsyncAdapter' AND NamespacePrefix = 'adyen_payment'
- From the response to the query, save the
Id
of the Apex class. - In your Developer Console, go to Query Editor and execute the following query:
SELECT ApexAdapterId, DeveloperName FROM PaymentGatewayProvider WHERE DeveloperName = 'Adyen'
- In the record queried, change the
ApexAdapterId
field to the one you saved in the previous step. - Click Save Rows.
- Go to Setup > Sites and select the existing site name.
- Go to Public Access Settings > Enabled Apex Class Access > Edit and move
adyen_payment.AdyenAsyncAdapter
to Enabled Apex Classes. - Save your changes.
- Go to Public Access Settings > Enabled Custom Metadata Type Access > Edit and move
adyen_payment.AdyenAdapter
to Enabled Custom Metadata Types. - Save your changes.
Step 4: Verify your API credentials
In some cases, the upgrade can cause your existing API Credential configuration to be overwritten. Skip this step if you verify that your API credentials are correct.
If you see that your configuration was overwritten, go to Setup > Named Credential > Adyen > Update and fill the following:
Field | Value |
---|---|
Username | The name of your Adyen API credential, for example ws@Company.[YourAdyenCompanyAccount]. |
Password | The basic authentication password for your Adyen API credential. |