BEIJING — One of the first things I learned on my current trip to Beijing is that foreigners are marooned if they don’t have a Chinese bank account.

That’s because China, a global leader in e-commerce, has become a nearly cashless society. Everyone from school kids to grandmas pays for everything with a personal barcode on their cellphone. I mean everything, including bottles of water, rides with DiDi (the Chinese Uber), takeout dinners and haircuts.

International credit cards are rarely accepted except at major hotels or high-end shops. And many vendors, including taxis, reject cash and wait for you to flash your barcode. But you can’t get a barcode without a Chinese bank account, from which those phone payments are drawn. And a visiting foreigner can’t open an account.

This Catch-22 lays bare the contradictions that define today’s China. The country’s astonishing 40-year leap into modernization created the illusion (until recently) that this ancient civilization was becoming more Western. But Beijing ‘s indifference to the impact of its cashless society on foreigners reminds us that a rising China is determined to do things its own way.

We are learning that the Chinese dream is very different than what many observers expected just a few years ago.

On the one hand, Beijing is a sophisticated international capital where Chinese artists, art lovers and expats gathered Sunday at a fundraising gala at the Ullens Center for Contemporary Art, a venue that recently hosted a major Picasso exhibition.

It is also home to elite universities where students and young people I met were mostly optimistic about their future. Fiddling with cell phones, this e-commerce generation orders up virtually their whole life from mega apps like WeChat. Or lifestyle apps like Meituan Dianping, the national meal delivery app that delivers fresh groceries anywhere in 30 minutes and just marked a high of 30 million orders in one day.

But on the other hand, in private conversations with intellectuals and academics, I’ve heard more unease than at any time since I’ve been traveling to China. Contacts who once spoke freely now refuse to be quoted.

Fears about student spies limit classroom discussion and Chinese President Xi Jinping’s tightening of Communist Party control is felt sharply at top universities, where professors now spend several hours weekly at study sessions on Xi Jinping’s thoughts.

The Chinese press, which once had freedom to investigate the economy, is now much more tightly controlled. Censorship of books has sharpened. Google, Facebook and most U.S. newspapers and major websites are still blocked. There are 170 million CCTV surveillance cameras are everywhere with electronic billboards outing bad drivers in real time (although many ordinary Chinese applaud the cameras as enhancing safety). And China’s facial recognition technology is staggering.

The dominant party role, with party cells reactivated in government offices and private companies seems reminiscent of the old Soviet Union, where party cells reigned in every enterprise and office.

On this trip, I’ve heard Beijingers question whether a new Chinese cultural revolution against the “elite” was in the offing.

But China is not the Soviet Union, which was a dismal economic failure. Nor is it Mao’s China. China’s astonishing economic rise is tied to the global economy; Beijing is investing and loaning huge amounts of capital to build infrastructure on nearly every continent in order to facilitate its trade. It can’t afford to gut its elite, or cut itself off from the world, not can it keep its youth from global exposure.

And, despite the heightened trade and tech competition with the United States, no one I’ve met here believes the two giants can completely divorce.

So what is the future Chinese model? Academics here are debating that question with the same intensity Americans are debating where our country is headed. A main question: Whether China’s success was built by socialism or capitalism.

Public uncertainty is fueled by the secrecy with which Xi operates and concern over an erratic President Trump’s. As one Chinese academic told me: “China and the U.S. are very similar. No one knows what their leader will do next.”

But one thing is certain: While China is connected to the world, the world will have little say in shaping its future system.

And foreign visitors will have to figure out how to navigate in a cashless society where their credit cards don’t work.

Trudy Rubin is writing from China for the month of November.