• 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 / asp_stripe_payment_completed hook for individual products

[Resolved] asp_stripe_payment_completed hook for individual products

· ·

Home › Forums › Stripe Payments Plugin › asp_stripe_payment_completed hook for individual products

Tagged: action_hook

  • This topic has 3 replies, 2 voices, and was last updated 6 years, 7 months ago by Benjamin.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • October 18, 2018 at 7:50 pm #1579
    Benjamin
    Participant

    Is there a way to target specific product completed transactions within the action hook. (Example: Product A would trigger a unique action hook with a function that creates a user account. Product B would trigger a different action hook with a function that updates current fields.

    Basically, I’m seeing if there is a way for us to get an extension to the current action hook to be tied into the Product IDs…

    Example:
    add_action(‘asp_stripe_payment_completed_7’, ‘functionA’, 10, 2);
    add_action(‘asp_stripe_payment_completed_23′, functionB’, 10, 2);

    (With 7 & 23 being the different ID numbers of products.)

    October 18, 2018 at 8:03 pm #1581
    Benjamin
    Participant

    And one additional question, does the asp_stripe_payment_completed hook fire after only a “product” is transacted successfully or does it also fire after a custom shortcode [accept_stripe_payment] is successfully transacted?

    October 19, 2018 at 12:25 am #1585
    Admin
    Keymaster

    The following action hook gets triggered for every transaction:

    asp_stripe_payment_completed

    Within the function (that you will create to handle the hook), you can check the data to see the product ID and other details. Then do things if it is for your product ID.

    October 19, 2018 at 6:14 pm #1594
    Benjamin
    Participant

    Just thought I would put this here for anyone else who needs a solution like this:

    Inside your function (that hooks to the asp_stripe_payment_completed hook) you can use the conditional tag:

    if ($post_data['item_name'] == 'NAME HERE'){ //do this }

    where the NAME HERE matches the name='NAME HERE' parameter in the [accept_stript_payment] shortcode.

    This can be useful for all those “non-product” based stripe buttons you may need to create dynamically.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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.