Hook Request
Posted: Wed Aug 21, 2019 11:11 am
Hi,
I need to have 3 modifications made to version 18.0 and newer.
I need to add 2 Hooks.
1) The first hook is in the method listPayType_Click
private void listPayType_Click(object sender,EventArgs e) {
*********************** begin new hook **************************************
if (Plugins.HookMethod(this, "FormPayment.PayType",listPayType.SelectedItem))
{
return;
}
*********************** end new hook **************************************
2) The second hook is in the SavePaymentToDb method. It needs to be inserted right before the line - if (_isCCDeclined) {
*********************** begin new hook **************************************
object[] ResText = { textAmount.Text, listPayType.SelectedItem, 0, 0 };
Plugins.HookAddCode(this, "FormPayment.Payment", ResText);
if ((bool)ResText[2]) //The transaction was processed
{
textNote.Text = textNote.Text + ResText[1].ToString();
textAmount.Text = ResText[0].ToString();
if (!(bool)ResText[3])
{
_isCCDeclined = true;
}
}
*********************** end new hook **************************************
if (_isCCDeclined) {
3) I will also need to have the SavePaymentToDb method changed from Private to Public so that we can call it from our plugin.
Let me know if you need more information or if you are Ok with these three changes.
Thanks,
Dave
I need to have 3 modifications made to version 18.0 and newer.
I need to add 2 Hooks.
1) The first hook is in the method listPayType_Click
private void listPayType_Click(object sender,EventArgs e) {
*********************** begin new hook **************************************
if (Plugins.HookMethod(this, "FormPayment.PayType",listPayType.SelectedItem))
{
return;
}
*********************** end new hook **************************************
2) The second hook is in the SavePaymentToDb method. It needs to be inserted right before the line - if (_isCCDeclined) {
*********************** begin new hook **************************************
object[] ResText = { textAmount.Text, listPayType.SelectedItem, 0, 0 };
Plugins.HookAddCode(this, "FormPayment.Payment", ResText);
if ((bool)ResText[2]) //The transaction was processed
{
textNote.Text = textNote.Text + ResText[1].ToString();
textAmount.Text = ResText[0].ToString();
if (!(bool)ResText[3])
{
_isCCDeclined = true;
}
}
*********************** end new hook **************************************
if (_isCCDeclined) {
3) I will also need to have the SavePaymentToDb method changed from Private to Public so that we can call it from our plugin.
Let me know if you need more information or if you are Ok with these three changes.
Thanks,
Dave