-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from Adyen/release/3.1.1
Release/3.1.1
- Loading branch information
Showing
9 changed files
with
171 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Salesforce CI/CD | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
PBO_AUTH_URL: ${{ secrets.PBO_AUTH_URL }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install Salesforce CLI | ||
run: npm install @salesforce/cli --global | ||
|
||
- name: Create authentication file from secret | ||
run: echo ${PBO_AUTH_URL} > secret.json | ||
|
||
- name: Authenticate to Dev Hub | ||
run: sf org login sfdx-url -f secret.json --set-default-dev-hub | ||
|
||
- name: Create Scratch Org | ||
run: sf org create scratch -f config/project-scratch-def.json --set-default --alias ScratchOrg --no-namespace -y 1 | ||
|
||
- name: Push source to Scratch Org | ||
run: sf project deploy start --target-org ScratchOrg | ||
|
||
- name: Run Apex tests | ||
run: sf apex run test --target-org ScratchOrg --code-coverage -w 5 | ||
|
||
- name: Delete Scratch Org | ||
if: always() | ||
run: sf org delete scratch --target-org ScratchOrg --no-prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,120 @@ | ||
/* | ||
* Adyen Checkout API | ||
* 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). | ||
* This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/checkout).\n\n## Authentication\nEach request to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/user-management/how-to-get-the-api-key). Then set this key to the `X-API-Key` header value, for example:\n\n```\ncurl\n-H "Content-Type: application/json" \\n-H "X-API-Key: Your_Checkout_API_key" \\n...\n```\nNote that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints).\n\n## Versioning\nCheckout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: "vXX", where XX is the version number.\n\nFor example:\n```\nhttps://checkout-test.adyen.com/v64/payments\n``` | ||
* | ||
* Contact: support@adyen.com | ||
@NamespaceAccessible | ||
public with sharing class ACHDetails implements PaymentMethodDetails { | ||
/** | ||
* The bank account number (without separators). | ||
*/ | ||
@NamespaceAccessible | ||
public String bankAccountNumber; | ||
|
||
* Do not edit the class manually. | ||
*/ | ||
/** | ||
* The bank account type (checking, savings...) | ||
*/ | ||
@NamespaceAccessible | ||
public String bankAccountType; | ||
|
||
@namespaceAccessible | ||
public with sharing class ACHDetails implements PaymentMethodDetails { | ||
/** | ||
* Get encryptedBankAccountNumber | ||
* @return encryptedBankAccountNumber | ||
* The bank routing number of the account. The field value is nil in most cases | ||
*/ | ||
@namespaceAccessible | ||
public String encryptedBankAccountNumber { get; set; } | ||
@NamespaceAccessible | ||
public String bankLocationId; | ||
|
||
/** | ||
* Get encryptedBankLocationId | ||
* @return encryptedBankLocationId | ||
* The checkout attempt identifier | ||
*/ | ||
@namespaceAccessible | ||
public String encryptedBankLocationId { get; set; } | ||
@NamespaceAccessible | ||
public String checkoutAttemptId; | ||
|
||
/** | ||
* Get ownerName | ||
* @return ownerName | ||
* Encrypted bank account number. The bank account number (without separators) | ||
*/ | ||
@namespaceAccessible | ||
public String ownerName { get; set; } | ||
@NamespaceAccessible | ||
public String encryptedBankAccountNumber; | ||
|
||
/** | ||
* **scheme** | ||
* @return type | ||
* Encrypted location id. The bank routing number of the account. The field value is nil in most cases | ||
*/ | ||
@namespaceAccessible | ||
public String type { get; set; } | ||
@NamespaceAccessible | ||
public String encryptedBankLocationId; | ||
|
||
@namespaceAccessible | ||
public ACHDetails() { | ||
type = 'ach'; | ||
} | ||
/** | ||
* The name of the bank account holder | ||
* If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations | ||
*/ | ||
@NamespaceAccessible | ||
public String ownerName; | ||
|
||
@namespaceAccessible | ||
public String getType() { | ||
return type; | ||
} | ||
/** | ||
* This is the recurringDetailReference returned in the response when you created the token | ||
*/ | ||
@NamespaceAccessible | ||
public String storedPaymentMethodId; | ||
|
||
@namespaceAccessible | ||
public void setType(String type) { | ||
this.type = type; | ||
/** | ||
* ach | ||
*/ | ||
@NamespaceAccessible | ||
public String type; | ||
|
||
@NamespaceAccessible | ||
public ACHDetails() { | ||
type = 'ach'; | ||
} | ||
|
||
@namespaceAccessible | ||
@NamespaceAccessible | ||
public static ACHDetails getExample() { | ||
ACHDetails achDetails = new ACHDetails(); | ||
achDetails.encryptedBankAccountNumber = ''; | ||
achDetails.encryptedBankLocationId = ''; | ||
achDetails.ownerName = ''; | ||
achDetails.type = ''; | ||
achDetails.bankAccountNumber = '123456789'; | ||
achDetails.bankAccountType = 'checking'; | ||
achDetails.bankLocationId = null; | ||
achDetails.checkoutAttemptId = 'abc123'; | ||
achDetails.encryptedBankAccountNumber = 'adyenjs_0_1_25$GTE/ytzAupIEbFEybScAA/T3W8+Xj3...'; | ||
achDetails.encryptedBankLocationId = 'adyenjs_0_1_25$UbyYyi7693Ya9e3cZNYOJj//l7...'; | ||
achDetails.ownerName = 'John Smith'; | ||
achDetails.storedPaymentMethodId = null; | ||
achDetails.type = 'ach'; | ||
return achDetails; | ||
} | ||
|
||
@namespaceAccessible | ||
@NamespaceAccessible | ||
public Boolean equals(Object obj) { | ||
if (obj instanceof ACHDetails) { | ||
ACHDetails achDetails = (ACHDetails) obj; | ||
return this.encryptedBankAccountNumber == achDetails.encryptedBankAccountNumber | ||
&& this.encryptedBankLocationId == achDetails.encryptedBankLocationId | ||
&& this.ownerName == achDetails.ownerName | ||
&& this.type == achDetails.type; | ||
ACHDetails otherACHDetails = (ACHDetails) obj; | ||
return this.bankAccountNumber == otherACHDetails.bankAccountNumber | ||
&& this.bankAccountType == otherACHDetails.bankAccountType | ||
&& this.bankLocationId == otherACHDetails.bankLocationId | ||
&& this.checkoutAttemptId == otherACHDetails.checkoutAttemptId | ||
&& this.encryptedBankAccountNumber == otherACHDetails.encryptedBankAccountNumber | ||
&& this.encryptedBankLocationId == otherACHDetails.encryptedBankLocationId | ||
&& this.ownerName == otherACHDetails.ownerName | ||
&& this.storedPaymentMethodId == otherACHDetails.storedPaymentMethodId | ||
&& this.type == otherACHDetails.type | ||
; | ||
} | ||
return false; | ||
} | ||
|
||
@namespaceAccessible | ||
@NamespaceAccessible | ||
public Integer hashCode() { | ||
Integer hashCode = 43; | ||
hashCode = (17 * hashCode) + (encryptedBankAccountNumber == null ? 0 : System.hashCode(encryptedBankAccountNumber)); | ||
hashCode = (17 * hashCode) + (encryptedBankLocationId == null ? 0 : System.hashCode(encryptedBankLocationId)); | ||
hashCode = (17 * hashCode) + (ownerName == null ? 0 : System.hashCode(ownerName)); | ||
hashCode = (17 * hashCode) + (type == null ? 0 : System.hashCode(type)); | ||
hashCode = (17 * hashCode) + (bankAccountNumber == null ? 0 : bankAccountNumber.hashCode()); | ||
hashCode = (17 * hashCode) + (bankAccountType == null ? 0 : bankAccountType.hashCode()); | ||
hashCode = (17 * hashCode) + (bankLocationId == null ? 0 : bankLocationId.hashCode()); | ||
hashCode = (17 * hashCode) + (checkoutAttemptId == null ? 0 : checkoutAttemptId.hashCode()); | ||
hashCode = (17 * hashCode) + (encryptedBankAccountNumber == null ? 0 : encryptedBankAccountNumber.hashCode()); | ||
hashCode = (17 * hashCode) + (encryptedBankLocationId == null ? 0 : encryptedBankLocationId.hashCode()); | ||
hashCode = (17 * hashCode) + (ownerName == null ? 0 : ownerName.hashCode()); | ||
hashCode = (17 * hashCode) + (storedPaymentMethodId == null ? 0 : storedPaymentMethodId.hashCode()); | ||
hashCode = (17 * hashCode) + (type == null ? 0 : type.hashCode()); | ||
return hashCode; | ||
} | ||
|
||
@NamespaceAccessible | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
@NamespaceAccessible | ||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>52.0</apiVersion> | ||
<apiVersion>60.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,16 @@ | ||
@isTest | ||
@IsTest | ||
public class ACHDetailsTest { | ||
/** | ||
* Test method to enhance code coverage for Apex Models; This ain't validating any specific business use cases. | ||
* Enhances code coverage for ACHDetails apex class | ||
*/ | ||
@isTest | ||
private static void testAllMethodsFromACHDetails(){ | ||
ACHDetails achTestInstance0 = ACHDetails.getExample(); | ||
System.assertEquals(achTestInstance0.encryptedBankAccountNumber,''); | ||
|
||
ACHDetails achTestInstance1 = new ACHDetails(); | ||
achTestInstance1.setType('TestString'); | ||
String retStringVal = achTestInstance1.getType(); | ||
System.debug('retStringVal : ' + retStringVal); | ||
Boolean retBooleanVal1 = achTestInstance1.equals(achTestInstance1); | ||
Integer retIntValue = achTestInstance1.hashCode(); | ||
System.assertEquals(retBooleanVal1,true); | ||
|
||
ACHDetails achTestInstance2 = new ACHDetails(); | ||
Boolean retBooleanVal2 = achTestInstance2.equals('Test'); | ||
System.assertEquals(retBooleanVal2,false); | ||
|
||
@IsTest | ||
private static void achDetailsEqualityTest() { | ||
// given | ||
ACHDetails achTest1 = ACHDetails.getExample(); | ||
ACHDetails achTest2 = ACHDetails.getExample(); | ||
ACHDetails achTest3 = ACHDetails.getExample(); | ||
achTest3.setType('another type'); | ||
// then | ||
Assert.areEqual(achTest1, achTest2); | ||
Assert.areEqual(achTest1.hashCode(), achTest2.hashCode()); | ||
Assert.areNotEqual(achTest1, achTest3); | ||
Assert.areNotEqual(achTest1.hashCode(), achTest3.hashCode()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>52.0</apiVersion> | ||
<apiVersion>60.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.