Skip to content

Commit

Permalink
Merge pull request #1 from Adyen/develop
Browse files Browse the repository at this point in the history
Adyen Payments for B2B Commerce Lightning - Release Version 1.1.0.0
  • Loading branch information
ShubhamVijaivargiya authored Nov 25, 2022
2 parents 404373f + 4fa888a commit 65eca8e
Show file tree
Hide file tree
Showing 40 changed files with 1,812 additions and 12 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# adyen-salesforce-b2b-lightning
Adyen payments package to work with Salesforce B2B Commerce Lightning product.

Adyen payments package to work with Salesforce B2B Commerce Lightning product.
28 changes: 28 additions & 0 deletions adyen-appexchange/Manifest/Package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>adyensompackage__AdyenAsyncAdapter</members>
<members>adyensompackage__AdyenAsyncAdapterTest</members>
<members>adyensompackage__AdyenPaymentHelper</members>
<members>adyensompackage__AdyenService</members>
<members>adyensompackage__AdyenPaymentUtility</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>CustomMetadata</name>
</types>
<types>
<members>adyensompackage__Adyen_Adapter_mdt</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>CustomSite</name>
</types>
<types>
<members>*</members>
<name>NamedCredential</name>
</types>
<version>52.0</version>
</Package>
9 changes: 9 additions & 0 deletions adyen-appexchange/adyen-appexchange.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
27 changes: 27 additions & 0 deletions adyen-appexchange/config/project-scratch-def.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"orgName": "Adyen",
"edition": "Developer",
"features": ["MultiCurrency","Communities", "B2BCommerce", "EnableSetPasswordInApi"],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"experienceBundleSettings": {
"enableExperienceBundleMetadata": true
},
"communitiesSettings": {
"enableNetworksEnabled": true
},
"orderSettings": {
"enableOrders": true,
"enableEnhancedCommerceOrders": true,
"enableOptionalPricebook": true
},
"commerceSettings": {
"commerceEnabled": true
},
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* This adapter is called by the Payment Gateway.
* The http calls are delegated to the AdyenPaymentHelper Class.
*
* This will process a CAPTURE and a REFUND Request as well as the corresponding Async callbacks.
*
* @see AdyenPaymentHelper
* @see AdyenService
* @see https://quip.com/z6RVAJzUKYaf
*/
global with sharing class AdyenAsyncAdapter implements CommercePayments.PaymentGatewayAdapter,
CommercePayments.PaymentGatewayAsyncAdapter {


global AdyenAsyncAdapter() {}

/**
* The entry point for processing payment requests. Returns the response from the payment gateway.
* Accepts the gateway context request and handover the operation to AdyenPaymentHelper to call the appropriate capture or refund operation.
*
* @param paymentGatewayContext
* @return CommercePayments.GatewayResponse
*
* @implNotes
* [CAPTURE] is called after setting Fulfillment.Status to 'Fulfilled' which in turns fires processes
* and flows to create invoices which ultimately fires this.
*
* [REFUND] is called by using the action on the order summary page (left hand side).
*
*/
global CommercePayments.GatewayResponse processRequest(CommercePayments.paymentGatewayContext paymentGatewayContext) {
return AdyenPaymentHelper.handleFulfillmentOrderStatusChange(paymentGatewayContext);
}

/**
* Listens to the incoming async notification callback from Adyen and handover to AdyenPaymentHelper for processing
*
* @param gatewayNotificationContext
* @return CommercePayments.GatewayNotificationResponse
*/
public CommercePayments.GatewayNotificationResponse processNotification(CommercePayments.PaymentGatewayNotificationContext gatewayNotificationContext) {
String apexName = String.valueOf(this).substring(0, String.valueOf(this).indexOf(':'));
return AdyenWebhookNotificationHelper.handleAsyncNotificationCallback(gatewayNotificationContext, apexName);
}

public class GatewayException extends Exception {}
}
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>51.0</apiVersion>
<status>Active</status>
</ApexClass>
Loading

0 comments on commit 65eca8e

Please sign in to comment.