The PHP Script plugin allows you to execute custom PHP code at specific points in the payment process. This powerful developer tool enables advanced customization, integration with external systems, custom business logic, and workflows that aren't available through standard plugin functionality. This plugin provides maximum flexibility for developers to extend Payment Form capabilities without modifying core files.
Warning: This plugin requires PHP programming knowledge and should only be used by experienced developers. Errors in custom scripts can prevent payment processing or cause system issues.
Go to System -> Plugins, find and enable plugin Payment Form - PHP Script if you want to use this feature. Now, when you add/edit a form, you will see PHP Script Settings allows you to execute the script you want for each form.

onAfterStorePayment eventonAfterPaymentSuccess event.Both scripts have access to:
$row - Payment record object with all payment data$row->form_id - ID of the form$row->id - Payment record ID$row->payment_amount - Payment amount$row->user_id - User ID (if logged in)