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

cordova-plugin-stripe-wechatpay

v1.0.2

Published

Stripe alipay!

Downloads

3

Readme

1.Install plugin

cordova plugin add cordova-plugin-stripe-wechatpay

2.Alipay on iOS

2.1.Mannual config: AppDelegate.MD

Add code on AppDelegate.m

/**
 This method is implemented to route returnURLs back to the Stripe SDK.
 
 @see https://stripe.com/docs/mobile/ios/authentication#return-url
 */
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    BOOL stripeHandled = [Stripe handleStripeURLCallbackWithURL:url];
    if (stripeHandled) {
        return YES;
    } else {
        // This was not a stripe url – do whatever url handling your app
        // normally does, if any.
    }
    return NO;
}

2.2 Mannual config: set key && scheme

On CDVStripeAlipay.m,add your own key!

[Stripe setDefaultPublishableKey:@"pk_live_YOUR_OWN_KEY_XXXXXXX"];

Modify scheme

#define DEFAULT_SCHEME       @"cuteapp://safepay/"

2.3 Mannual config: Add Scheme

Project => Target => Info => URL Types => Click + => URL Schemes: cuteapp
URLSchemes should the same as 【DEFAULT_SCHEME】 prefix

2.4 _config reference

https://github.com/stripe/stripe-ios/blob/771f778fcbad58f771583ebe6fe499a2a4bc6ae8/Example/Non-Card%20Payment%20Examples/AlipayExampleViewController.swift
https://stripe.com/docs/sources/alipay/ios

2.Test stripe alipay

2.1.Test alipay with default source

Called in javascript, spend least money.

window.StripeAlipay.alipayTest(
    result => {
        alert("succeed:" + JSON.stringify(result));
    },
    err => {
        alert("err:" + JSON.stringify(err));
    }
);

2.2.Test alipay with source json

Called in javascript

let source = `{"amount":50, "currency":"jpy","extraParams":{},"owner":{"email":"[email protected]","name":"Mr. Sample"},"returnUrl":"mycompany://alipay","type":"alipay","typeRaw":"alipay"}`;
window.StripeAlipay.alipayBySourceJson(
    source,
    result => {
        alert("succeed:" + JSON.stringify(result));
    },
    err => {
        alert("err:" + JSON.stringify(err));
    }
);

3.QA

3.1.Use test key maybe get some error

test key like pk_test_ABACDF2hitYZV1hsqU00jfHaLuse maybe get some unknown error!

Suggest sue pk_live_XXX key.

pk_test_ABACDF2hitYZV1hsqU00jfHaLuse

Map<String, Object> alipayParams = source.getSourceTypeData();
final String dataString = (String) alipayParams.get("data_string");

get data_string all return "null",

3.2.Error:Invalid currency

com.stripe.android.exception.InvalidRequestException: Invalid currency: cny. The payment method `alipay` only supports the following currencies: aud, cad, eur, gbp, hkd, jpy, nzd, sgd, usd.

The currency you use should the same as your company region. not the customer's region.

your company region: 'japan', maybe you should use 'jpy'
your company region: 'America', maybe you should use 'usd'
your company region: 'china', maybe you should use 'cny' or 'hkd'(i don't know,because my company is not in china's mainland, somebody who use it may tell me the result)

3.3.Too little money to test

com.stripe.android.exception.InvalidRequestException: Amount must convert to at least 400 cents. ¥50 converts to approximately \$3.58.

Too little money to test, add it.

version log

1.0.2

Fix plugin js name error bug

1.0.1

Add stripe ios wechat pay