How to use gform_mollie_payment_retreived ?
-
Hi Petra,
I’ve been trying to get the following steps working with an external Invoicing API (Wefact).
—
- Step 1: User submits form and My script does an API call to create an invoice with status=concept.
- Step 2: User goes through the mollie payment proces.
- Step 3: My script attempts to do an API call to set the Invoice status=paid
—
I’ve tried several Gravity Form actions (gform_post_payment_callback, gform_post_payment_complete) which ended up not running my API call after the payment is finished.
After updating the GF Mollie plugin to 1.11.1 I noticed a new action in the code.
gform_mollie_payment_retreivedLooking at my logfiles I also noticed the following:
objectMollie_API_Object_Payment Object ( [resource] => payment [id] => tr_dCCPaxGuaQ [mode] => live [amount] => 0.01 [amountRefunded] => 0.00 [amountRemaining] => 25.01 [description] => Inschrijving Weetabix Drijver Goalie Clinic 2020 [method] => ideal [status] => paid ...
With that information I assumed I assumed I could check for the status.
I’ve added the following add_action();function invoice_payment_completed($entry, $payment) { // Make sure I get the newest verion of the $entry; $new_entry = GFAPI::get_entry( $entry['id'] ); // Finish the invoice (set to paid) if payment = paid. if ($payment->status == 'paid') { $new_entry['payment_status'] = 'Paid'; // Finish the invoice after_submission_invoice_finish($new_entry); } else { return false; } } add_action( 'gform_mollie_payment_retreived', 'invoice_payment_completed', 10, 2 );
But the above isn’t run after payment. Even if I removed the surrounding If statement it would not run the after_submission_invoice_finish function.
So my question would now be, how can I go ahead as to use the action gform_mollie_payment_retreived correctly? And is this action intended for user after payment?
The page I need help with: [log in to see the link]
- The topic ‘How to use gform_mollie_payment_retreived ?’ is closed to new replies.