• 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 / Stripe Payments Plugin – Action Hooks Reference

Stripe Payments Plugin – Action Hooks Reference

Below is a list of action hooks that are available in the Stripe Payments Plugin.

Table of Contents

  • Payment Process
    • asp_stripe_payment_completed
  • Subscription Addon Related
    • asp_subscription_invoice_paid
    • asp_subscription_ended
    • asp_subscription_canceled
  • Payment Popup Window Related
    • asp_ng_pp_output_before_closing_head
  • Miscellaneous

Payment Process

asp_ng_before_payment_processing 

Fired before payment processing has begun. 

Parameters:

$post_data (array)
Has combined payment info data from $_POST array.

asp_stripe_payment_completed

This hook executes after a transaction is completed. This can be used to do some additional tasks after a transaction takes place.

Parameters:

$data (array)
Payment info data array.

$charge (array)
Charge object from Stripe.

Below is an example of how to use this hook:

add_action('asp_stripe_payment_completed', 'asp_after_txn_callback', 10 ,2);
function asp_after_txn_callback ($post_data, $charge)
{
    //Do stuff
    //$charge is the Stripe charge object.
    //print_r($post_data);//Lets see what info is in this array.
}

Subscription Addon Related

The hooks described in this section are from the Stripe Subscriptions Addon.

asp_subscription_invoice_paid

This hook is triggered after a subscription payment is charged.

add_action ('asp_subscription_invoice_paid', 'my_sub_paid', 10, 2);
function my_sub_paid($sub_post_id, $data) {
   ASP_Debug_Logger::log(json_encode($data));
}

$sub_post_id is the post ID of the subscription.
$data is event data received from Stripe’s hook.

This code dumps the event data into plugin’s debug log (if it’s enabled). This way you would be able to test and see what kind of data is available.

asp_subscription_ended

This hook is triggered after a subscription has ended.

add_action ('asp_subscription_ended', 'my_sub_ended_handler', 10, 2);
function my_sub_ended_handler($sub_id, $event_data) {
   ASP_Debug_Logger::log(json_encode($event_data));
}

$sub_id is Stripe’s subscription ID.
$event_data is event data received from Stripe’s hook.

asp_subscription_canceled

This hook is triggered after a subscription is cancelled.

add_action ('asp_subscription_canceled', 'my_sub_cancel_handler', 10, 2);
function my_sub_cancel_handler($sub_id, $event_data) {
   ASP_Debug_Logger::log(json_encode($event_data));
}

$sub_id is Stripe’s subscription ID.
$event_data is event data received from Stripe’s hook.

This code dumps the event data into plugin’s debug log (if it’s enabled). This way you would be able to test and see what kind of data is available.

Payment Popup Window Related

asp_ng_pp_output_before_closing_head

This action hook allows you to insert custom HTML, JavaScript, or CSS code directly into the <head> element of the payment popup window.

Example code below:

add_action('asp_ng_pp_output_before_closing_head', 'output_on_payment_popup_head');

function output_on_payment_popup_head() {
echo '<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Quicksand">';
}

Miscellaneous

asp_clear_external_caches

This hook executes when plugin needs external caching plugins to clear page cache. Currently only fired after plugin settings update.

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.