It is an international practice not to set a password. Foreign credit cards do not have a password, which is more convenient to use. Nowadays, some bank credit cards allow you to use passwords for domestic transactions, but overseas transactions still do not require a password to be successful. This can be regarded as a compromise to China's national conditions. The Western restaurant you go to may use a foreign credit card system, so you can swipe it without a password.