Refinery Payouts exposes a set of WordPress action and filter hooks for customizing behavior. Use them to add custom logging, integrate with other systems, or change how transfers are calculated.
Actions
refinery_payouts_before_process_order
Fires before the plugin starts processing an order’s line items.
do_action( 'refinery_payouts_before_process_order', int $order_id );
refinery_payouts_transfer_created
Fires after a Stripe Transfer is successfully created and logged.
do_action(
'refinery_payouts_transfer_created',
array $log_entry, // saved log row
StripeTransfer $transfer,
int $order_id
);
refinery_payouts_transfer_failed
Fires when a Stripe Transfer attempt fails.
do_action(
'refinery_payouts_transfer_failed',
array $log_entry,
Exception $exception,
int $order_id
);
refinery_payouts_after_process_order
Fires after all line items in an order have been processed.
do_action( 'refinery_payouts_after_process_order', int $order_id );
refinery_payouts_reversal_created
Fires after a transfer reversal is successfully created.
do_action(
'refinery_payouts_reversal_created',
array $log_entry,
StripeReversal $reversal,
int $refund_id
);
Filters
refinery_payouts_calculated_amount
Modify the calculated transfer amount before the Stripe Transfer is created.
apply_filters(
'refinery_payouts_calculated_amount',
int $amount_in_cents,
array $context // rule, line_item, order
);
refinery_payouts_should_process_line_item
Skip processing for specific line items. Return false to skip.
apply_filters(
'refinery_payouts_should_process_line_item',
bool $should_process,
WC_Order_Item $line_item,
WC_Order $order
);
refinery_payouts_transfer_args
Modify the array of arguments sent to StripeTransfer::create.
apply_filters(
'refinery_payouts_transfer_args',
array $args,
array $context
);
refinery_payouts_log_entry
Modify the data persisted to the wp_refinery_payouts_logs table.
apply_filters(
'refinery_payouts_log_entry',
array $entry,
array $context
);
refinery_payouts_register_abilities
Return false to prevent the WordPress Abilities API integration from registering anything.
add_filter( 'refinery_payouts_register_abilities', '__return_false' );
Constants
Override secret credentials by defining these in wp-config.php (see Stripe Connect setup for details):
REFINERY_PAYOUTS_STRIPE_LIVE_SECRET_KEYREFINERY_PAYOUTS_STRIPE_LIVE_PUBLISHABLE_KEYREFINERY_PAYOUTS_STRIPE_TEST_SECRET_KEYREFINERY_PAYOUTS_STRIPE_TEST_PUBLISHABLE_KEYREFINERY_PAYOUTS_STRIPE_CLIENT_ID