Skip to content

Commit

Permalink
Merge pull request #36 from Adyen/develop
Browse files Browse the repository at this point in the history
Package Version 3.0.1.1
  • Loading branch information
ShubhamVijaivargiya authored Feb 23, 2024
2 parents 684a6b7 + 077bec4 commit 2bcb353
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 58 deletions.
51 changes: 27 additions & 24 deletions force-app/main/default/classes/AdyenConstants.cls
Original file line number Diff line number Diff line change
@@ -1,67 +1,70 @@
@namespaceAccessible
@NamespaceAccessible
public with sharing class AdyenConstants {

@namespaceAccessible
@NamespaceAccessible
public static final String DEFAULT_ADAPTER_NAME = 'AdyenDefault';

@namespaceAccessible
@NamespaceAccessible
public static final String NOTIFICATION_REQUEST_TYPE_CANCEL = 'cancellation';

@namespaceAccessible
@NamespaceAccessible
public static final String NOTIFICATION_REQUEST_TYPE_AUTHORISE = 'authorization';

@namespaceAccessible
@NamespaceAccessible
public static final String NOTIFICATION_REQUEST_TYPE_CAPTURE_FAILED = 'capture-failed';

@namespaceAccessible
@NamespaceAccessible
public static final String NOTIFICATION_REQUEST_TYPE_CAPTURE = 'capture';

@namespaceAccessible
@NamespaceAccessible
public static final String NOTIFICATION_REQUEST_TYPE_REFUND = 'refund';

@namespaceAccessible
@NamespaceAccessible
public static final String NOTIFICATION_REQUEST_TYPE_RECURRING_CONTRACT = 'recurring_contract';

@NamespaceAccessible
public static final String NOTIFICATION_ACCEPTED_RESPONSE = '[accepted]';

@namespaceAccessible
@NamespaceAccessible
public static final String NOTIFICATION_RECEIVED_CHECKOUT = 'received';

@namespaceAccessible
@NamespaceAccessible
public static final String TEST_MERCHANT_ACCOUNT = 'TEST_MERCHANT_ACCOUNT';

@namespaceAccessible
@NamespaceAccessible
public static final String TEST_REFERENCE = 'TEST_REFERENCE';

@namespaceAccessible
@NamespaceAccessible
public static final String TEST_STATUS = 'TEST_STATUS';

@namespaceAccessible
@NamespaceAccessible
public static final String TEST_PSP_REFERENCE = 'TEST_PSP_REFERENCE';

@namespaceAccessible
@NamespaceAccessible
public static final String TEST_PAYMENT_PSP_REFERENCE = 'TEST_PAYMENT_PSP_REFERENCE';

@namespaceAccessible
@NamespaceAccessible
public static final CommercePayments.SalesforceResultCodeInfo SUCCESS_SALESFORCE_RESULT_CODE_INFO =
new CommercePayments.SalesforceResultCodeInfo(CommercePayments.SalesforceResultCode.Success);

@namespaceAccessible
@NamespaceAccessible
public static final CommercePayments.SalesforceResultCodeInfo DECLINE_SALESFORCE_RESULT_CODE_INFO =
new CommercePayments.SalesforceResultCodeInfo(CommercePayments.SalesforceResultCode.Decline);

@namespaceAccessible
@NamespaceAccessible
public static final CommercePayments.SalesforceResultCodeInfo SYSTEM_ERROR_SALESFORCE_RESULT_CODE_INFO =
new CommercePayments.SalesforceResultCodeInfo(CommercePayments.SalesforceResultCode.SystemError);

@namespaceAccessible
@NamespaceAccessible
public static final CommercePayments.SalesforceResultCodeInfo VALIDATION_ERROR_SALESFORCE_RESULT_CODE_INFO =
new CommercePayments.SalesforceResultCodeInfo(CommercePayments.SalesforceResultCode.ValidationError);

@namespaceAccessible
public static final Integer HTTP_SUCCESS_CODE = 200;
@NamespaceAccessible
public static final Integer HTTP_SUCCESS_CODE = 200;

@namespaceAccessible
public static final Integer HTTP_ERROR_CODE = 400;
@NamespaceAccessible
public static final Integer HTTP_ERROR_CODE = 400;

@namespaceAccessible
public final static String HTTP_SERVER_ERROR_CODE = '500';
@NamespaceAccessible
public final static String HTTP_SERVER_ERROR_CODE = '500';
}
17 changes: 17 additions & 0 deletions force-app/main/default/classes/CheckoutCaptureRequest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ public with sharing class CheckoutCaptureRequest implements CheckoutModification
this.lineItems = lineItems;
}

/**
* Application info
* @return applicationInfo
*/
@namespaceAccessible
public ApplicationInfo applicationInfo { get; set; }

@namespaceAccessible
public ApplicationInfo getApplicationInfo() {
return applicationInfo;
}

@namespaceAccessible
public void setApplicationInfo(ApplicationInfo applicationInfo) {
this.applicationInfo = applicationInfo;
}

@NamespaceAccessible
public CheckoutCaptureRequest(){}
}
5 changes: 5 additions & 0 deletions force-app/main/default/classes/CheckoutCaptureRequestTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@ public class CheckoutCaptureRequestTest {

testCaptureRequest.setLineItems(new List<LineItem>{new LineItem()});
System.assertEquals(1, testCaptureRequest.getLineItems().size());

testCaptureRequest.setApplicationInfo(ApplicationInfo.getExample());
System.assertEquals(testCaptureRequest.getApplicationInfo().adyenLibrary.name, '');


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ public interface CheckoutModificationRequest {

List<LineItem> getLineItems();
void setLineItems(List<LineItem> lineItems);

ApplicationInfo getApplicationInfo();
void setApplicationInfo(ApplicationInfo applicationInfo);

}
17 changes: 17 additions & 0 deletions force-app/main/default/classes/CheckoutRefundRequest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ public with sharing class CheckoutRefundRequest implements CheckoutModificationR
this.lineItems = lineItems;
}

/**
* Application info
* @return applicationInfo
*/
@namespaceAccessible
public ApplicationInfo applicationInfo { get; set; }

@namespaceAccessible
public ApplicationInfo getApplicationInfo() {
return applicationInfo;
}

@namespaceAccessible
public void setApplicationInfo(ApplicationInfo applicationInfo) {
this.applicationInfo = applicationInfo;
}

@NamespaceAccessible
public CheckoutRefundRequest(){}

Expand Down
4 changes: 4 additions & 0 deletions force-app/main/default/classes/CheckoutRefundRequestTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ public class CheckoutRefundRequestTest {

testRefundRequest.setLineItems(new List<LineItem>{new LineItem()});
System.assertEquals(1, testRefundRequest.getLineItems().size());

testRefundRequest.setApplicationInfo(ApplicationInfo.getExample());
System.assertEquals(testRefundRequest.getApplicationInfo().adyenLibrary.name, '');

}
}
26 changes: 15 additions & 11 deletions force-app/main/default/classes/NotificationRequestItem.cls
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
/*
* Represents an Adyen Webhook Notification Request Item
*/
@namespaceAccessible

@NamespaceAccessible
public with sharing class NotificationRequestItem {

@namespaceAccessible
@NamespaceAccessible
public Amount amount {get;set;}

@namespaceAccessible
@NamespaceAccessible
public String eventCode {get;set;}

@namespaceAccessible
@NamespaceAccessible
public String eventDate {get;set;}

@namespaceAccessible
@NamespaceAccessible
public String merchantAccountCode {get;set;}

@namespaceAccessible
@NamespaceAccessible
public String paymentMethod {get;set;}

@namespaceAccessible
@NamespaceAccessible
public String originalReference {get;set;}

@namespaceAccessible
@NamespaceAccessible
public String paymentPspReference {get;set;}

@namespaceAccessible
@NamespaceAccessible
public String pspReference {get;set;}

@namespaceAccessible
@NamespaceAccessible
public String reason {get;set;}

@namespaceAccessible
@NamespaceAccessible
public String success {get;set;}

@NamespaceAccessible
public Map<String,String> additionalData {get;set;}

}
13 changes: 11 additions & 2 deletions force-app/main/default/classes/PaymentMethodsRequest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public with sharing class PaymentMethodsRequest {
@namespaceAccessible
public String shopperReference { get; set; }

/**
* List of payments methods to be not presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods).\n\nExample: `"blockedPaymentMethods":["ideal","giropay"]`
* @return blockedPaymentMethods
*/
@namespaceAccessible
public List<String> blockedPaymentMethods {get;set;}

@namespaceAccessible
public PaymentMethodsRequest() {
allowedPaymentMethods = new List<String>();
Expand All @@ -68,6 +75,7 @@ public with sharing class PaymentMethodsRequest {
paymentMethodsRequest.merchantAccount = '';
paymentMethodsRequest.shopperLocale = '';
paymentMethodsRequest.shopperReference = '';
paymentMethodsRequest.blockedPaymentMethods = new List<String>{''};
return paymentMethodsRequest;
}

Expand All @@ -80,7 +88,8 @@ public with sharing class PaymentMethodsRequest {
&& this.countryCode == paymentMethodsRequest.countryCode
&& this.merchantAccount == paymentMethodsRequest.merchantAccount
&& this.shopperLocale == paymentMethodsRequest.shopperLocale
&& this.shopperReference == paymentMethodsRequest.shopperReference;
&& this.shopperReference == paymentMethodsRequest.shopperReference
&& this.blockedPaymentMethods == paymentMethodsRequest.blockedPaymentMethods;
}
return false;
}
Expand All @@ -96,4 +105,4 @@ public with sharing class PaymentMethodsRequest {
hashCode = (17 * hashCode) + (shopperReference == null ? 0 : System.hashCode(shopperReference));
return hashCode;
}
}
}
43 changes: 22 additions & 21 deletions sfdx-project.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
"package": "API Library Apex Adyen",
"versionName": "ver 0.1",
"versionNumber": "0.1.0.NEXT",
"ancestorVersion": "HIGHEST"
}
],
"name": "adyen-apex-api-lib-2GP",
"namespace": "adyen_payment",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "53.0",
"packageAliases": {
"API Library Apex Adyen": "0Ho4T0000000043SAA",
"API Library Apex Adyen@0.1.0-1": "04t4T000001VvbqQAC",
"API Library Apex Adyen@1.0.0-0": "04t4T000001VvfJQAS",
"API Library Apex Adyen@2.0.0-0": "04t4T000001HohPQAS",
"API Library Apex Adyen@3.0.0-0": "04t4T000001y7BWQAY"
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
"package": "API Library Apex Adyen",
"versionName": "ver 3.0",
"versionNumber": "3.0.1.NEXT",
"ancestorVersion": "HIGHEST"
}
],
"name": "adyen-apex-api-lib-2GP",
"namespace": "adyen_payment",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "59.0",
"packageAliases": {
"API Library Apex Adyen": "0Ho4T0000000043SAA",
"API Library Apex Adyen@0.1.0-1": "04t4T000001VvbqQAC",
"API Library Apex Adyen@1.0.0-0": "04t4T000001VvfJQAS",
"API Library Apex Adyen@2.0.0-0": "04t4T000001HohPQAS",
"API Library Apex Adyen@3.0.0-0": "04t4T000001y7BWQAY",
"API Library Apex Adyen@3.0.1-1": "04tRP0000000A5pYAE"
}
}

0 comments on commit 2bcb353

Please sign in to comment.