-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: capturePspReference attribute for paypal auth flow
- Loading branch information
Showing
6 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
force-app/main/default/classes/AdyenPaymentUtility.cls-meta.xml
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>61.0</apiVersion> | ||
<apiVersion>62.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
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>60.0</apiVersion> | ||
<apiVersion>62.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@IsTest | ||
private class AdyenRefundHelperTest { | ||
@IsTest | ||
static void createPaypalAuthRefundRequestTest() { | ||
// Given | ||
Account acct = TestDataFactory.createAccount(); | ||
insert acct; | ||
CardPaymentMethod cardPayMeth = TestDataFactory.createCardPaymentMethod(); | ||
insert cardPayMeth; | ||
PaymentAuthorization payAuth = TestDataFactory.createPaymentAuthorization(acct.Id, cardPayMeth.Id, null, null, TestDataFactory.TEST_PSP_REFERENCE); | ||
payAuth.Adyen_Payment_Method_Variant__c = 'paypal'; | ||
insert payAuth; | ||
Payment payment = TestDataFactory.createPayment(acct.Id, cardPayMeth.Id, null, payAuth.Id, null); | ||
payment.GatewayRefDetails = 'FO_007'; | ||
insert payment; | ||
payment.PaymentAuthorization = [SELECT Adyen_Payment_Method_Variant__c FROM PaymentAuthorization WHERE Id = :payAuth.Id]; | ||
CommercePayments.ReferencedRefundRequest refundRequest = new CommercePayments.ReferencedRefundRequest(TestDataFactory.TEST_PRICE_AMOUNT, payment.Id); | ||
|
||
// Then | ||
CheckoutRefundRequest modificationRequest = AdyenRefundHelper.createRefundRequest(refundRequest, payment, AdyenPaymentUtility.chooseAdapterWithFallBack(null)); | ||
|
||
// When | ||
Assert.isNotNull(modificationRequest.capturePspReference); | ||
Assert.areEqual(TestDataFactory.TEST_PSP_REFERENCE, modificationRequest.capturePspReference); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
force-app/main/default/classes/AdyenRefundHelperTest.cls-meta.xml
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,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>62.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