• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Payments Plugin for Stripe

Stripe payment plugins for your WordPress site

  • Home
  • Documentation
  • Addons
  • Login
    • Sign In
    • Edit Profile
    • Terms & Conditions
    • My Downloads
    • License Key
  • Support
    • Support Forum
    • Forum Search
    • Forum Login
    • Forum Registration
    • Email Support for Customers
  • Contact Us
  • Show Search
Hide Search
You are here: Home / Topics / Action Hook not working.

[Resolved] Action Hook not working.

· ·

Home › Forums › Stripe Payments Plugin › Action Hook not working.

  • This topic has 6 replies, 3 voices, and was last updated 3 years ago by Admin.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • April 16, 2018 at 5:37 pm #654
    Pablo
    Participant

    Hi guys, I been trying to find a way to use the hook action after a transaction has been made, but I couldn’t get it to work. It mention that a paramaeter is missing.

    Following the error direction, it says that the argument is missing in the plugin’s file “process_ipn.php” in the line do_action( 'asp_stripe_payment_completed', $post_data, $charge );

    Is there any way you can help me pointing me in the right direction?

    Thank you in advance for your help!

    April 16, 2018 at 5:55 pm #655
    Admin
    Keymaster

    That action hooks passes 2 arguments to the callback function. So make sure to catch it like the following example:

    
    add_action ('asp_stripe_payment_completed', 'execute_my_custom_code', 10, 2);
    
    function execute_my_custom_code ($post_data, $charge) {
        //Do stuff here
    }
    
    April 20, 2018 at 5:22 pm #666
    Pablo
    Participant

    This worked perfect!! Thank you

    January 17, 2019 at 11:45 am #1786
    kaparis
    Participant

    Where did you locate the add_action code?

    January 21, 2019 at 11:55 pm #1791
    Admin
    Keymaster

    The “add_action” code goes in your custom plugin/script.

    May 18, 2022 at 9:07 pm #4552
    bkahler
    Participant

    Where exactly is the custom plugin/script located/named?
    Is this a file I need to create in includes of the stripe-payments plugin?

    May 19, 2022 at 5:19 am #4555
    Admin
    Keymaster

    Custom plugin is simply another WordPress plugin that contains your custom code. If you are not a WordPress developer, you won’t be able to create a custom plugin/script.

    The alternative option that you could try is to add the custom code to your theme’s functions.php file.

    If you really want to create a small plugin, you can check the following articles that has some very basic info on how to create a plugin:

    How to Begin Creating a WordPress Plugin

    How to Create a WordPress plugin

    It really requires some WordPress development knowledge, otherwise it may seem confusing to you.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Log In

Primary Sidebar

Featured Addons and Extensions

  • Subscription Payments Addon
  • Additional Custom Fields
  • Secure Downloads Addon
  • Apple Pay, Google Pay, Afterpay

Addon Bundle

Stripe Payments Addon Bundle

A Simple & Lightweight Plugin

Our Philosophy with the Plugin

Support Links

  • Support Forum
  • Support Contact

Search

Copyright © 2025 | Stripe Plugins | A member of the Tips and Tricks HQ family.