@vineela95 Please try with the below code and verify.
public class KPPaymentTransactionInvExt : PXGraphExtension<ARPaymentEntryImportTransaction, ARPaymentEntryPaymentTransaction, ARPaymentEntry>
{
public static bool IsActive() => true;
public delegate IEnumerable CaptureCCPaymentDelegate(PXAdapter adapter);
PXOverride]
public virtual IEnumerable CaptureCCPayment(PXAdapter adapter, CaptureCCPaymentDelegate baseMethod)
{
var invokeBaseMethod = baseMethod(adapter);
//Custom logic here
return invokeBaseMethod;
}
}
Hi Vineela,
In Acumatica most of credit card processing logic is defined in the abstract generic Graph Extensions, that could not be overridden. However you can create a second level graph extension to the specific implementation of the generic graph extension that is used in specific scope. For the AR Payment Entry screen the target implementation to override would be ARPaymentEntryPaymentTransaction
. Please also note that there is a difference in the feature switches introduced in 2023 R1, that could and should be used if the business logic you’d wish to apply is relevant to the custom ICCPlugin.
Following code should be sufficient:
public class CCOverride : PXGraphExtension<ARPaymentEntryPaymentTransaction, ARPaymentEntry>
{
//public static bool IsActive() => PXAccess.FeatureInstalled<PX.Objects.CS.FeaturesSet.customCCIntegration>(); //for 2023R1 and further
public static bool IsActive() => PXAccess.FeatureInstalled<PX.Objects.CS.FeaturesSet.integratedCardProcessing>(); //for 2022R2 and prior
public delegate IEnumerable CaptureCCPaymentDelegate(PXAdapter adapter);
PXOverride]
public virtual IEnumerable CaptureCCPayment(PXAdapter adapter, CaptureCCPaymentDelegate baseDelegate) {
var ret = baseDelegate?.Invoke(adapter);
Base.Document.Ask("Capture", MessageButtons.OK);
return ret;
}
}
Thank you very much @Evgeny Afanasiev !