1.0.8 • Published 1 year ago

@paynicorn/jssdk v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Paynicorn jssdk

Endow H5 application with paynicorn payment functions

Installation

yarn add @paynicorn/jssdk
// or 
npm i @paynicorn/jssdk

API

startPayment

Bring up the paynicorn app and open the payment page. txnId is required.

import { startPayment } from '@paynicorn/jsddk'

startPayment('32212070000002217')

topUp

Bring up the paynicorn app and open the topup page currency and amount are required.

import { topUp } from '@paynicorn/jsddk'

topUp('AHA', '100')

getAuthCode

import { getAuthCode } from '@paynicorn/jsddk'

getAuthCode('your sdkkey', 'https://your-redirect-url.com')

After the authorization is successful, you can get the authcode from the redirect url , like below

https://your-redirect-url.com?authcode=awsxoik89sfw

Then, you can use authcode to get the accessToken from the server api

If you are using these apis in an android webview, you should add below code to avoid your webview do not known the paynicorn:// schema

webView.setWebViewClient(new WebViewClient(){
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if (url.startsWith("paynicorn")) {
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
            startActivity(intent);
            return true;
        }
        return false;
    }
}); 
1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago