Riassunto AI
Descrizione
The wpforms_paypal_standard_process_complete action fires when PayPal returns the status of the payment processed from the form.
Parametri
- $fields
- (array) Valori/proprietà dei campi dell'invio sanificati.
- $form_data
- (array) Impostazioni/dati del modulo elaborati, preparati per l'uso successivo.
- $payment_id
- (int) PayPal Payment ID.
- $data
- (array) PayPal Web Accept Data.
Origine
wpforms-paypal-standard/class-paypal-standard.php
Maggiori Informazioni
The action will process when PayPal notifies the site of the payment status.
Esempi
/**
* Fires when PayPal payment status notifies the site.
*
* @link https://wpforms.com/developers/wpforms_paypal_standard_process_complete/
*
* @param array $fields Sanitized entry field values/properties.
* @param array $form_data Form data and settings.
* @param int $payment_id PayPal Payment ID.
* @param array $data PayPal Web Accept Data.
*/
function wpf_paypal_standard_process_complete( $fields, $form_data, $payment_id, $data ) {
if ( empty( $data[ 'payment_status' ] ) || strtolower( $data[ 'payment_status' ] ) !== 'completed' ) {
return;
}
// Run code...
}
add_action( 'wpforms_paypal_standard_process_complete', 'wpf_paypal_standard_process_complete', 10, 4 );
Correlati
Tutorial Reference: How to Approve a User After a PayPal Payment