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