WC_Gateway_Paypal_IPN_Handler::validate_transaction_type()protectedWC 1.0

Check for a valid transaction type.

Method of the class: WC_Gateway_Paypal_IPN_Handler{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->validate_transaction_type( $txn_type );
$txn_type(string) (required)
Transaction type.

WC_Gateway_Paypal_IPN_Handler::validate_transaction_type() code 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;
	}
}