Achtung!

Dieser Artikel enthält PHP-Code und richtet sich an Entwickler. Wir stellen diesen Code als Service zur Verfügung, bieten jedoch keine Unterstützung für Codeanpassungen oder die Entwicklung durch Dritte.

Für zusätzliche Hilfe siehe das Tutorial von WPBeginner zum Hinzufügen von benutzerdefiniertem Code.

Schließen

Beschreibung

The wpforms_paypal_standard_process_complete action fires when PayPal returns the status of the payment processed from the form.

Parameter

$fields
(array) Bereinigte Feldwerte/Eigenschaften des Eintrags.
$form_data
(array) Verarbeitete Formulareinstellungen/Daten, die zur späteren Verwendung vorbereitet sind.
$payment_id
(int) PayPal Payment ID.
$data
(array) PayPal Web Accept Data.

Quelle

wpforms-paypal-standard/class-paypal-standard.php

Weitere Informationen

The action will process when PayPal notifies the site of the payment status.

Beispiele

/**
 * 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 );

Tutorial Reference: How to Approve a User After a PayPal Payment