Home / Developers
Developers
Build on PingPaid
Hooks and ready-to-use code snippets for PingPaid Premium. React when an order is confirmed, connect your own tools, and adjust what customers see, without editing the plugin.
Overview
PingPaid confirms WooCommerce orders when an Interac e-Transfer arrives. Everything on this page runs on your own WordPress site, uses standard WordPress hooks, and keeps working when you update PingPaid.
Adding custom code
We recommend the free Code Snippets plugin. It keeps your code separate from your theme, survives theme updates, and lets you switch a snippet off with one click.
- In WordPress, go to Plugins → Add New Plugin, search for Code Snippets, then install and activate it.
- Go to Snippets → Add New and paste the code.
- Choose Run snippet everywhere, then click Save Changes and Activate.
Actions
Use add_action() to run code when something happens in PingPaid. Actions only notify you; they don’t change how payments are matched.
| Hook | Runs when |
|---|---|
pingpaid_order_paid$order, $payment, $how | An order is marked paid. $how is auto or manual (confirmed from the review queue). |
pingpaid_order_partially_paid$order, $payment, $received, $total | An e-Transfer covers only part of an order. Amounts are in cents. |
pingpaid_payment_needs_review$payment | An e-Transfer couldn’t be matched safely and is waiting in Review. |
pingpaid_claim_unmatched$order, $iref | A customer entered an Interac reference number, and no matching e-Transfer arrived within 10 minutes. |
pingpaid_cancelled_with_money$order, $received | A cancelled order already had e-Transfers applied to it. $received is in cents. |
Filters
Use add_filter() and return false to switch something off. Each email filter receives the same order and payment details as the actions above.
| Hook | Controls |
|---|---|
pingpaid_send_review_email$send, $payment | The email to the store when a payment needs review. |
pingpaid_send_partial_email$send, $order, $payment | The email to the store when an order is partly paid. |
pingpaid_send_customer_balance_email$send, $order, $payment | The email to the customer showing what’s still due. |
pingpaid_send_claim_unmatched_email$send, $order, $iref | The email asking the customer to check the reference number they entered. |
pingpaid_box_alignwide$wide, $order | Whether the payment box uses the wide layout on block themes. |
Code snippets
Ready-to-use examples. Change the values marked in the comments, and nothing else.
Post to Slack when a payment needs review
Get a message in your team’s Slack channel whenever an e-Transfer is waiting in Review, with the amount, sender and a link to it.
/** * PingPaid: post to Slack when an e-Transfer needs review. */ add_action( 'pingpaid_payment_needs_review', function ( $payment ) { // Paste your Slack incoming webhook URL here. $webhook = 'https://hooks.slack.com/services/XXXX/XXXX/XXXX'; $amount = number_format( (int) $payment['amount_cents'] / 100, 2 ); $from = ! empty( $payment['payer_name'] ) ? $payment['payer_name'] : 'Unknown sender'; $link = admin_url( 'admin.php?page=pingpaid&tab=payments&status=review' ); wp_remote_post( $webhook, array( 'headers' => array( 'Content-Type' => 'application/json' ), 'body' => wp_json_encode( array( 'text' => "e-Transfer of \${$amount} from {$from} needs review: {$link}", ) ), 'timeout' => 5, 'blocking' => false, // Don't slow down your site. ) ); } );
- In Slack, create an incoming webhook for the channel you want and copy its URL.
- Paste the URL in place of
https://hooks.slack.com/services/XXXX/XXXX/XXXX. - Activate the snippet. The next payment that needs review posts to that channel.
Support policy
We want custom code to be safe and predictable for your store.
- PingPaid itself, and the hooks listed on this page
- The snippets here, with the version they were tested on
- Questions about which hook fits what you want to do
- Custom code you write or change
- Other plugins and themes your code relies on
- Testing changes before they go live on your store
Hooks not listed on this page are internal and may change without notice. Need something that isn’t here? Email us at support@pingpaid.ca.