Page 1 of 1

Creating Payments

Posted: Wed Feb 19, 2020 1:32 pm
by dcrider
We have a promotional tool that I built that calculates some discounts from various parameters. I'm looking for a way to create a payment based on the information generated by this tool. I can't seem to find an easy way to do this.

Some payments will be attached to payment plans and some will not; some will charge a credit card and some will not.

Do you have any recommendations on a way to create a payment (both on and not on a payment plan and both on and not on a credit card) without any further user input?

Re: Creating Payments

Posted: Wed Feb 19, 2020 4:12 pm
by cmcgehee
It sounds like the best way to accomplish this would be to create a plugin. You can then call our methods to create payments.
https://opendental.com/manual/plugins.html

Re: Creating Payments

Posted: Thu Feb 20, 2020 8:24 am
by dcrider
I'm already using a plugin. However, the methods that I think I want to use, are private and do not have hooks. I want to know if there is a recommended method/hook for creating payments, or if I need to request hooks to be added.

Re: Creating Payments

Posted: Thu Feb 20, 2020 10:22 am
by cmcgehee
There isn't one particular method for creating a payment because each place in our program that makes a payment does something unique. You'll want to call OpenDentBusiness.Payments.Insert at the very least. For an example on what to pass to this method, you could look at OpenDentBusiness.RecurringChargerator.CreatePayment. You'll also need to insert at least one PaySplit.

Re: Creating Payments

Posted: Thu Feb 20, 2020 10:46 am
by dcrider
I'll look into that, thank you.