- This topic has 6 replies, 3 voices, and was last updated 2 years, 6 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
Stripe payment plugins for your WordPress site
· ·
Home › Forums › Stripe Payments Plugin › Action Hook not working.
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!
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
}
This worked perfect!! Thank you
Where did you locate the add_action code?
The “add_action” code goes in your custom plugin/script.
Where exactly is the custom plugin/script located/named?
Is this a file I need to create in includes of the stripe-payments plugin?
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:
It really requires some WordPress development knowledge, otherwise it may seem confusing to you.