add safety type check for payment_status transformation