npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gizwits/react-native-wechat-lib-harmony

v0.1.0

Published

HarmonyOS payment implementation for react-native-wechat-lib (RNOH 0.82)

Readme

@gizwits/react-native-wechat-lib-harmony

Payment-only HarmonyOS companion for react-native-wechat-lib. Version 0.1.0 targets RN 0.82 / RNOH 0.82.30 and HarmonyOS API 13+. Uses the pinned official @tencent/[email protected] OHPM dependency.

Integration

Install this package alongside the original npm dependency. Keep createHarmonyMetroConfig enabled; harmony.alias redirects the original import only on HarmonyOS. Do not replace the Android/iOS dependency or add a global Metro alias.

import * as WeChat from 'react-native-wechat-lib';
await WeChat.registerApp(appId, universalLink);
const installed = await WeChat.isWXAppInstalled();
const response = await WeChat.pay(serverPaymentParameters);
// response.errCode === 0 is an SDK hint, NOT proof that the server credited an order.

Run RNOH autolinking and ohpm install. Both ArkTS and C++ registrations are provided. Add weixin and wxopensdk to the entry module's querySchemes (retain https). Forward both EntryAbility.onCreate and onNewWant to WechatBridge.handleWant(want) after calling their super implementations:

import { WechatBridge } from '@gizwits/react-native-wechat-lib-harmony';
// Inside BOTH lifecycle methods:
WechatBridge.handleWant(want);

The callback ability must be exported and match pay({ callbackAbility }), default EntryAbility. Configure the mobile AppID's Harmony bundle name and app Identifier on WeChat Open Platform; Android package/signature configuration is not a substitute. universalLink is accepted for compatibility but unused on HarmonyOS.

Contract and limitations

  • Implemented: registerApp, isWXAppInstalled, pay, WechatError.
  • Payment accepts camelCase and legacy lowercase keys, including paySign; timestamp becomes a string and package defaults to Sign=WXPay.
  • pay resolves only for SDK errCode: 0; otherwise rejects WechatError with numeric .code (including -2 cancellation). Plugin errors use string codes such as E_BUSY, E_TIMEOUT, E_NOT_INSTALLED, E_APP_ID_MISMATCH.
  • timeout is seconds, 1–600, default 120. After timeout, the native session stays busy until the old SDK callback arrives. If no callback ever arrives, check the server order and restart the app before another payment. This avoids assigning a late result to a newer payment.
  • Matching callback transaction/prepay IDs are checked when supplied. Callbacks without a live request are not reported as successful payments. After process death, reconcile the order with the backend; a JS Promise cannot survive process death.
  • Sharing, login, mini programs and event-listener APIs are not implemented in 0.1.0. They explicitly report E_UNSUPPORTED; this is not a full API parity release.
  • No merchant private keys or signing logic belong in this package. Require consent/privacy disclosure before SDK use; include the vendor SDK's privacy requirements in the host app.

Development and packaging

npm run build:har packages a source HAR: the consuming app compiles ArkTS and C++. It is not a precompiled native binary. Vendor SDKs are downloaded by OHPM, not republished in this npm package. npm pack runs the same build automatically. This repository uses yarn payments:sync to refresh the two local file: dependencies after edits, followed by ohpm install in harmony.

The package has not been published. UNLICENSED is intentional pending the owner's release/license decision. Confirm namespace rights, license and real-device acceptance before publishing.

Sources: official SDK package, WeChat APP SDK integration, APP payment.