sllbakkbone
(Scott @ BAKKBONE Australia)
April 26, 2023, 7:45am
1
Hi all
I’m bouncing around the docs and honestly having trouble understanding the way some of it is written
I’m working on an add-on that processes direct debit (non-US equivalent of ACH) payments. Intended flow is this:
Payment submitted, defaults to add_pending_payment
Add-on schedules an action to check with the bank nightly on the status of the debit
When transaction is no longer pending, status is changed to either complete_payment
or fail_payment
I’m struggling with what hooks to get my scheduled action to call, to change the status of the payment after the fact ???
Could someone please point me to the right hook to use?
Thanks
chrishajer
(Chris (Gravity Forms))
April 26, 2023, 8:52pm
2
Take a look at GFAPI::update_entry_property
:
The GFAPI::update_entry(), GFAPI::update_entries(), GFAPI::update_entry_property(), and GFAPI::update_entry_field() methods are used to update entries in the database.
Est. reading time: 2 minutes
You would call that function whenever you want to update the payment status.
1 Like
sllbakkbone
(Scott @ BAKKBONE Australia)
April 28, 2023, 4:16pm
3
Perfect, thanks! The only other thing along this line I’m struggling with is in my authorize()
function, rendering the payment as pending rather than complete.
Currently, for a pending payment I’m returning this array:
$result = array(
'is_authorized' => true,
'error_message' => $responseMessage,
'transaction_id' => $transactionID,
'captured_payment' => array(
'is_success' => true,
'error_message' => $responseMessage,
'transaction_id' => $transactionID,
'amount' => $transactionAmount
);
);
But it seems that if is_authorized
or is_success
are false
, the payment is marked as failed, and there’s no in between…?
Whereas if i mark them as true
then change the payment status, I’m going to trigger both the payment complete and payment pending notification actions… I think?
I hope I’m making sense
system
(system)
Closed
May 28, 2023, 4:17pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.