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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-dmg-pingpp

v0.1.7

Published

PingPP for React-Native

Downloads

3

Readme

react-native-dmg-pingpp

官方

官方版react-native组件已经发布 查看官方版,官方包中ios存在问题

0.1.7

  • 删除android/libs 改用 maven 管理pingpp依赖包

安装

npm i -S react-native-dmg-pingpp

react-native link react-native-dmg-pingpp

npm run configureDmgPingpp <yourURLScheme>

//例如:
npm run configureDmgPingpp smartAlipay

配置

iOS

  • xcode打开iOS项目,使用pod安装Pingpp iOS SDK并进行相关配置。

  • 配置文档详见https://www.pingxx.com/docs/client/sdk/ios

    注意: 1.配置文档中"接收并处理交易结果"部分的代码,已在npm run configureDmgPingpp时自动添加到AppDelegate.m文件中)。 2.npm run configureDmgPingpp 中的yourURLScheme,就是配置文档中URL Types下添加的URL Schemes。

可能遇到的问题

  • RNDMGPingPP.m中Pingpp.h文件找不到。 处理办法: 在TARGETS - Bulid Settings - Hearder Search Paths中添加$(SRCROOT)/../../../ios/Pods/Pingpp/lib。 Hearder Search Paths添加的值取决于Pingpp.h存放的路径,如果报错,请根据本地路径修改。

Android

在 ./android/app/src/main/AndroidManifest.xml 中加入


<!-- Ping++ SDK -->
<activity
    android:name="com.pingplusplus.android.PaymentActivity"
    android:configChanges="orientation|screenSize"
    android:launchMode="singleTop"
    android:theme="@android:style/Theme.Translucent.NoTitleBar" >
    
    <!--使用QQ钱包时,需要填写-->
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>

        <category android:name="android.intent.category.BROWSABLE"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <!-- 填写规则:qwallet + APP_ID -->
        <data android:scheme="qwalletXXXXXXXX"/>
    </intent-filter>

</activity>

<!-- 微信支付 sdk ,也是 Ping++ sdk 调用入口 -->
<activity-alias
    android:name=".wxapi.WXPayEntryActivity"
    android:exported="true"
    android:targetActivity="com.pingplusplus.android.PaymentActivity" />
<!-- 支付宝 sdk -->
<activity
    android:name="com.alipay.sdk.app.H5PayActivity"
    android:configChanges="orientation|keyboardHidden|navigation"
    android:exported="false"
    android:screenOrientation="behind" >
</activity>
<activity
    android:name="com.alipay.sdk.auth.AuthActivity"
    android:configChanges="orientation|keyboardHidden|navigation"
    android:exported="false"
    android:screenOrientation="behind" >
</activity>

<!-- 银联支付 sdk -->
<activity
    android:name="com.unionpay.uppay.PayActivity"
    android:configChanges="orientation|keyboardHidden|navigation|screenSize" />

使用

    import { pay } from 'react-native-dmg-pingpp';

    function payment( charge ) {
        // 调用支付方法
        pay( charge )
        .then(( response ) => {  // 支付成功或用户取消
          if ( response == 'cancel' ) {
            console.log('用户中途取消' );
          }

          // 此处根据返回结果,进行相应处理
          console.log('response', response );
        })
        .catch( ( error ) => {  // 支付出错
          console.log('error', error.errMsg );
        })
    }