1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Paypal - non-payment action

Discussion in 'Community' started by mlines, Dec 3, 2019 at 2:48 PM.

  1. mlines

    mlines New Member

    Level: Community
    I have a form with a Paypal payment.

    On submission of the form it take the user to Paypal for payment.

    If the user pays, everything is fine.

    If the user doesnt pay, either by clicking away from within Paypal or by payment failing then I dont get an IPN back which is fine. However, Fabrik has created a record with all the customers submitted details. I only want a Fabrik record formed on successful payment, what is the best way to do this?
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    You can run a custom php file (select in IPN PHP file).
    I assume there you can handle failing payments.
    If the user is just clicking away I assume you can only clean up manually resp. with a scheduled task deleting all records with some status, missing IPN or whatever.
     
  3. mlines

    mlines New Member

    Level: Community
    Thanks, I can certainly manually clean up, its just that I was looking for a way to avoid creating the record in the first place.

    I will have to look into the PHP.
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    There's no way to avoid creating the record in the first place, simply because of the way PayPal IPN works. It's a callback. Which doesn't happen in "real time". So the form submits, we do the redirect to PayPal, after validating and storing the record. At some point in the future - anything from several seconds to several hours, we get a "callback" from PayPal, ie. they call a specific URL on your server, with the result. Or not, if the person clicked away from PayPal.

    We can provide PayPal with a small amount of "custom" data, in our case the list id, form id and row id of the submitted form, which they reflect back to us in the callback. So we can use that data to identify the submitted row this callback relates to, and update the IPN fields in it with the status, amount, etc.

    So there's no way to defer writing out the record until after an IPN callback. The form data would just get lost. The size of the custom data PayPal accept for the reflection isn't enough to store the entire submitted form data.

    -- hugh
     
  5. mlines

    mlines New Member

    Level: Community
    Hugh,

    Many thanks, that makes complete sense. I will also not create cron delete tasks etc. as I clearly need to wait for delayed payments. Very useful information.

    Martin
     

Share This Page