• Resolved drwells123

    (@drwells123)


    Hello,

    Apologies in advance if this is a double post; think my previous one got eaten due to a cookie error.

    I’m writing a custom payment gateway based on the excellent instructions here.

    I have to process the payment info offsite, so I’m writing a script to handle the redirect from the payment processor. In that script, I want to call edd_update_payment_status with the EDD payment ID (which I send to the payment processor as metadata and is then sent back to my redirect handler). Normally, I would expect to do this:

    include '/home/<username>/public_html/wp/wp-content/plugins/easy-digital-downloads/includes/payments/functions.php';
    
    // Get $payment_id from HTTP GET data.
    
    edd_update_payment_status($payment_id, 'complete');

    However, it looks like I can’t simply include functions.php. I assume the problem is that it expects to be included in easy-digital-downloads.php, so it can refer to the contents of other files that are included before it.

    So my question is: how should I tell EDD that a payment has completed after being redirected back from an offsite payment processor?

    Please let me know if I can provide any additional information. Thank you!

    https://wordpress.org/plugins/easy-digital-downloads/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Pippin Williamson

    (@mordauk)

    The easiest way to do this is to include your processing script directly in your plugin and then handle the processing in a function that is tied to the “init” action with add_action().

    Let me know if that helps!

    Thread Starter drwells123

    (@drwells123)

    Hi Pippin,

    That looks like it does indeed fix my problem. Thank you very much for the quick reply!

    Plugin Contributor Pippin Williamson

    (@mordauk)

    Glad to hear it!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to report payment completed after offsite redirect?’ is closed to new replies.