Skip to main content
Answer

About Implement a Plug-In for Processing Credit Card by Acuamtica Payments

  • May 22, 2025
  • 6 replies
  • 104 views

Forum|alt.badge.img

I can successfully implement Implement a Plug-In for Processing Credit Card Payments, but there is a tricky problem.
Suppose after DOTransaction, I need to add a simple LineItem (such as a surcharge, which is actually known after DOTransaction) to the Line Item of the Sales Order based on the payment amount.
Acuamtica does not seem to allow me to add such an item. In which interface should I implement such an addition action?

Best answer by Dmitrii Naumov

@AndrewZ Looks good. 

I’d recommend overriding RunAuthorizeActions and other similar methods instead of PersistData, but overall that’s the way.

6 replies

Forum|alt.badge.img
  • Author
  • Freshman I
  • May 22, 2025

Because when I add a LineItem, it will change the amount of the current SalesOrder, and it will prompt an error during Processing Payment. Acuamtica has too many internal amount checks and validations.


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • May 22, 2025

@AndrewZ I’d not recommend to modify the actual payment amount. Instead insert a ‘Charge’ line in the payment. 

Adding a line to the order/invoice is not a correct approach, since the surcharge is not a property of the invoice, it’s a property of the payment. 

You can override the code in the ARPaymentAfterProcessingManager to do that. 


Forum|alt.badge.img
  • Author
  • Freshman I
  • May 29, 2025

@Dmitrii Naumov 

So, some bank or transaction fees are recorded in the Finance Charge instead of the Payment Amount, right?

This ARInvoice total is $100,total pay $101, $1 of it is for Gateway fees

 


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • May 29, 2025

@AndrewZ something like that, yes. 


Forum|alt.badge.img
  • Author
  • Freshman I
  • May 30, 2025

@Dmitrii Naumov 

This is my test code, which overrides ARPaymentAfterProcessingManager. Is this correct? Do you have any better suggestions?

 

---UsrARPaymentEntryPaymentTransaction_Ext.class

 public class UsrARPaymentEntryPaymentTransaction_Ext : PXGraphExtension<ARPaymentEntryPaymentTransaction, ARPaymentEntry>

 {

     public static bool IsActive() => PXAccess.FeatureInstalled<PX.Objects.CS.FeaturesSet.integratedCardProcessing>();

 

     public delegate AfterProcessingManager GetAfterProcessingManagerDelegate();

     [PXOverride]

     public virtual AfterProcessingManager GetAfterProcessingManager(GetAfterProcessingManagerDelegate baseMethod)

     {

         return new UsrARPaymentAfterProcessingManager();

     }

 }

 ---UsrARPaymentAfterProcessingManager.class

public class UsrARPaymentAfterProcessingManager : ARPaymentAfterProcessingManager

 {

     [PXOverride]

     public override void PersistData()

     {

        //add data to CHARGE TAB

        base.PersistData();

     }

 }


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • June 6, 2025

@AndrewZ Looks good. 

I’d recommend overriding RunAuthorizeActions and other similar methods instead of PersistData, but overall that’s the way.