[SOLVED] PayPal Plugin - Conditional Code for Form Edits

Status
Not open for further replies.

degarrin

Member
Hello! I have a PayPal Form Plugin set up on one of my forms. Currently, it is set to only run on new form submissions. This has been tested and works fine. Unfortunately, I need to account for those instances where someone doesn't go through with the payment, for whatever reason (they close the screen, their computer has problems, etc), which means setting it to run on form edits as well. But I don't want to run the plugin all the time, as this would obviously cause problems with completed transactions.

So here is what I'm thinking so far...
I need to include conditional PHP in the Payment tab of the PayPal Form Plugin. It needs to be set in such a manner that it is basing its decision on the whether or not the PayPal Transaction Status field (fab_affirmations___paypal_transaction_status) has a status or is empty.

That's all I've got. I have done other conditional eval, but really basic ones linked to checkboxes, etc. I'm not sure how to write the code, does anyone have any suggestions? Or a different way altogether? I've looked through the forums, but didn't see anything I could borrow :)

Thank You
Angela
 
Something like ...

Code:
$myTxnId = $formModel->getElementData('fab_affirmations___paypal_transaction_status', true, '');
return empty($myTxnId);

... or even just ...

Code:
return empty('{fab_affirmations___paypal_transaction_status}');

-- hugh
 
Thanks Hugh, both options work! Or they do once I remembered to change the setting to allow the plugin to also work on form edits :oops: . Time to call it a night.

Angela
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top