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 🙏

© 2019 – Ryan Hefner

react-native-wx-ali-pay

v1.0.0

Published

react-native: 支付宝,微信支付

Downloads

20

Readme

npm npm GitHub issues

PRs Welcome npm

react-native-wx-ali-pay

react-native版 微信支付,支付宝 插件

Install

npm install react-native-wx-ali-pay -S

react-native link react-native-wx-ali-pay

Useage

import Pay from 'react-native-wx-ali-pay'

const wxObj = {
  appid: 'appid',
  partnerid: 'partnerid',
  noncestr: 'noncestr',
  timestamp: 'timestamp',
  prepayid: 'prepayid',
  package: 'package',
  sign: 'sign',
}

const aliObj = {
  orderString: 'orderString'
}

Pay.onWxPay(wxObj).then(e => console.info(e)).catch(err => alert(err))

Pay.onAliPay(aliObj).then(e => console.info(e)).catch(err => alert(err))

StepUp in Java && OC

Android

Step1

android/app/src/main/java/com/xx/下创建wxapi文件夹

Step2

新建文件 WXPayEntryActivity.java

package com.xxx.wxapi;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.timson.react_native_wx_ali_pay.wxpay.WXPay;

public class WXPayEntryActivity extends Activity{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        WXPay.handlerIntent(getIntent());
        finish();
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        setIntent(intent);
        WXPay.handlerIntent(intent);
    }
}

Step3

AndroidManifest.xml 加上

<activity
	android:name=".MainActivity"
....
</activity>
<activity
	android:name=".wxapi.WXPayEntryActivity"
	android:exported="true"
	android:launchMode="singleTop" />

iOS

Step1

在工程target的General -> Link Frameworks and Libraries -> 加入libsqlite3.tbd, libc++.tbd, libz.tbd

Step2

在工程target的General -> Link Frameworks and Libraries -> 加入AlipaySDK.framework,CoreMotion.framework(注意: 加入的AlipaySDK.framework需要是插件支付宝文件里的AlipaySDK.framework)

Step3

在工程target的Build Settings-> Frameworks Search Paths -> 加入"$(SRCROOT)/../node_modules/react-native-wx-ali-pay/ios/PaySdk/支付宝"

Step4

在工程target的Build Settings-> Header Search Paths -> 加入"$(SRCROOT)/../node_modules/react-native-wx-ali-pay/ios/PaySdk",并将状态修改为recursive

Step5

在工程target的Info-> URL Types -> 点左下角'+'新增一项并将URL Schemes"修改为WXPay

AppDegelate.m

添加文件添加内容 --- 下面的减函数

#import <WXApi.h>
#import <WXApiManager.h>
#import <AlipaySDK/AlipaySDK.h>

// 支持所有iOS系统
// 支持所有iOS系统
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
  if ([url.host isEqualToString:@"safepay"]) {
    //支付宝回调 ...
    //添加回调方法
    [[AlipaySDK defaultService]processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) {
      [[NSNotificationCenter defaultCenter]postNotificationName:@"aliPayReslut" object:nil userInfo:resultDic];
    }];
      return YES;
  } else {
    //微信回调
    return [WXApi handleOpenURL:url delegate:[WXApiManager sharedManager]];
  }
}

Contributer

OYWeijian

lekenny