WC_Gateway_Paypal_IPN_Handler::validate_transaction_type()protectedWC 1.0

Check for a valid transaction type.

Метод класса: WC_Gateway_Paypal_IPN_Handler{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->validate_transaction_type( $txn_type );
$txn_type(строка) (обязательный)
Transaction type.

Код WC_Gateway_Paypal_IPN_Handler::validate_transaction_type() WC 8.7.0

protected function validate_transaction_type( $txn_type ) {
	$accepted_types = array( 'cart', 'instant', 'express_checkout', 'web_accept', 'masspay', 'send_money', 'paypal_here' );

	if ( ! in_array( strtolower( $txn_type ), $accepted_types, true ) ) {
		WC_Gateway_Paypal::log( 'Aborting, Invalid type:' . $txn_type );
		exit;
	}
}