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

ep-open-tool-h5

v1.1.8

Published

[蚂蚁因公付对外-移动端 H5 SDK](#蚂蚁因公付对外-移动端-h5-sdk)

Downloads

16

Readme

ep-open-tool-h5

蚂蚁因公付对外-移动端 H5 SDK

蚂蚁通用场景钱包对外-移动端 H5 SDK

蚂蚁网商场景钱包对外-移动端 H5 SDK

二方支卡通-移动端 H5 SDK


Badges

TNPM version TNPM downloads node >=14.0.0


Usage

依赖安装

npm i ep-open-tool-h5 --save

蚂蚁因公付对外-移动端 H5 SDK

因公付-员工侧支付宝端内签约

仅获取签约地址

import { EntPay } from 'ep-open-tool-h5';

const signUrl = EntPay.Staff.getSignUrl({
  bizSceneCode: '接入时约定的bizSceneCode',
  accountId: '企业的id',
});

方法参数说明

| signParam 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :------------- | :------------------------------------- | :----- | :----- | :------- | | bizSceneCode | 接入时约定的 bizSceneCode | string | 无 | 是 | | accountId | 企业的 id | string | 无 | 是 | | returnUrl | 签约完成之后的回跳地址 | string | 无 | 否 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |

自动跳转到支付端内签约页面

// 跳转员工端签约页面
EntPay.Staff.goToSign({
  bizSceneCode: '接入时约定的bizSceneCode',
  accountId: '企业的id',
});

完整使用:EntPay.Staff.goToSign( signParams, options)

| signParam 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :------------- | :------------------------------------- | :----- | :----- | :------- | | bizSceneCode | 接入时约定的 bizSceneCode | string | 无 | 是 | | accountId | 企业的 id | string | 无 | 是 | | returnUrl | 签约完成之后的回跳地址 | string | 无 | 否 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |

| options 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :----------- | :------------------------------- | :------ | :----- | :------- | | outAlipay | 是否在支付端 app 端外,默认 true | boolean | true | 否 | | openNewPage | 是否打开一个新页面,默认 true | boolean | true | 否 |

跳转到支付宝端内扫一扫

// 跳转到支付宝端内扫一扫
EntPay.Staff.goToScanPage({
  accountId: '企业的id',
});

// 如果只是要获取支付宝扫一扫的链接,可以直接调用getScanPageUrl方法获取
const scanPageUrl = EntPay.Staff.getScanPageUrl({
  accountId: '企业的id',
});

完整使用:EntPay.Staff.goToScanPage( accountInfo, options)

| accountInfo 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :--------------- | :------------------------------------- | :----- | :----- | :------- | | accountId | 企业的 id | string | 无 | 是 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |

| options 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :----------- | :------------------------------- | :------ | :----- | :------- | | outAlipay | 是否在支付端 app 端外,默认 true | boolean | true | 否 | | openNewPage | 是否打开一个新页面,默认 true | boolean | true | 否 |

跳转到支付宝端内付款码

// 跳转到支付宝端内扫一扫
EntPay.Staff.goToPayCodePage({
  accountId: '企业的id',
});

// 如果只是要获取支付宝付款码的链接,可以直接调用getPayCodePageUrl方法获取
const scanPageUrl = EntPay.Staff.getPayCodePageUrl({
  accountId: '企业的id',
});

完整使用:EntPay.Staff.goToPayCodePage( accountInfo, options)

| accountInfo 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :--------------- | :------------------------------------- | :----- | :----- | :------- | | accountId | 企业的 id | string | 无 | 是 | | payCodeSceneCode | 跳转收银台场景码,需要分配才能获取 | string | 无 | 是 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |

| options 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :----------- | :------------------------------- | :------ | :----- | :------- | | outAlipay | 是否在支付端 app 端外,默认 true | boolean | true | 否 | | openNewPage | 是否打开一个新页面,默认 true | boolean | true | 否 |



蚂蚁通用场景钱包对外-移动端 H5 SDK

场景钱包-支付宝端内签约

自动跳转到支付端内签约页面(推荐)

import { SceneWallet } from 'ep-open-tool-h5';

// 跳转场景钱包端签约页面
SceneWallet.goToSign({
  bizScene: '接入时约定的bizScene',
  bindToken: '绑定凭证',
});

完整使用:SceneWallet.goToSign( signParams, options)

| signParam 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :------------- | :------------------------------------- | :----- | :----- | :------- | | bizScene | 接入时约定的 bizScene | string | 无 | 是 | | bindToken | 绑定凭证 | string | 无 | 是 | | returnUrl | 回跳链接 | string | 无 | 否 | | skipResult | 跳过结果页 | N | Y | 无 | 否 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |

| options 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :----------- | :------------------------------- | :------ | :----- | :------- | | outAlipay | 是否在支付端 app 端外,默认 true | boolean | true | 否 | | openNewPage | 是否打开一个新页面,默认 true | boolean | true | 否 |

仅获取签约地址

import { SceneWallet } from 'ep-open-tool-h5';

const signUrl = SceneWallet.getSignUrl({
  bizScene: '接入时约定的bizScene',
  bindToken: '绑定凭证',
});

方法参数说明

| signParam 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :------------- | :------------------------------------- | :----- | :----- | :------- | | bizScene | 接入时约定的 bizScene | string | 无 | 是 | | bindToken | 绑定凭证 | string | 无 | 是 | | returnUrl | 回跳链接 | string | 无 | 否 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |



蚂蚁网商场景钱包对外-移动端 H5 SDK

网商场景钱包-支付宝端内签约

自动跳转到支付端内签约页面(推荐)

import { MYBankSceneWallet } from 'ep-open-tool-h5';

// 跳转网商场景钱包端签约页面
MYBankSceneWallet.goToSign({
  bizScene: '接入时约定的bizScene',
  bindToken: '绑定凭证',
});

完整使用:MYBankSceneWallet.goToSign( signParams, options)

| signParam 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :------------- | :------------------------------------- | :----- | :----- | :------- | | bizScene | 接入时约定的 bizScene | string | 无 | 是 | | bindToken | 绑定凭证 | string | 无 | 是 | | returnUrl | 回跳链接 | string | 无 | 否 | | skipResult | 跳过结果页 | Y | N | 无 | 否 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |

| options 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :----------- | :------------------------------- | :------ | :----- | :------- | | outAlipay | 是否在支付端 app 端外,默认 true | boolean | true | 否 | | openNewPage | 是否打开一个新页面,默认 true | boolean | true | 否 |

仅获取签约地址

import { MYBankSceneWallet } from 'ep-open-tool-h5';

const signUrl = MYBankSceneWallet.getSignUrl({
  bizScene: '接入时约定的bizScene',
  bindToken: '绑定凭证',
});

方法参数说明

| signParam 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :------------- | :------------------------------------- | :----- | :----- | :------- | | bizScene | 接入时约定的 bizScene | string | 无 | 是 | | bindToken | 绑定凭证 | string | 无 | 是 | | returnUrl | 回跳链接 | string | 无 | 否 | | skipResult | 跳过结果页 | Y | N | 无 | 否 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |



二方支卡通-移动端 H5 SDK

支卡通V1-支付宝端内签约(后续接入请采用支卡通V2版本)

自动跳转到支付端内签约页面(推荐)

import { Zcard } from 'ep-open-tool-h5';

// 跳转支卡通签约页面
ZCard.goToSign({
  bizScene: '接入时约定的bizScene',
  bindToken: '绑定时的token值',
});

完整使用:ZCard.goToSign( signParams, options)

| signParam 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :------------- | :------------------------------------- | :----- | :----- | :------- | | bizScene | 接入时约定的 bizScene | string | 无 | 是 | | bindToken | 绑定凭证 | string | 无 | 是 | | returnUrl | 回跳链接 | string | 无 | 否 | | showResultPage |是否展示结果页 | Y | N | 无 | 否 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |

| options 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :----------- | :------------------------------- | :------ | :----- | :------- | | outAlipay | 是否在支付端 app 端外,默认 true | boolean | true | 否 | | openNewPage | 是否打开一个新页面,默认 true | boolean | true | 否 |

仅获取签约地址

import { Zcard } from 'ep-open-tool-h5';

const signUrl = Zcard.getSignUrl({
  bizScene: '接入时约定的bizScene',
  bindToken: '绑定凭证',
});

方法参数说明

| signParam 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :------------- | :------------------------------------- | :----- | :----- | :------- | | bizScene | 接入时约定的 bizScene | string | 无 | 是 | | bindToken | 绑定凭证 | string | 无 | 是 | | returnUrl | 回跳链接 | string | 无 | 否 | | showResultPage | 是否展示结果页页 | Y | N | 无 | 否 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |


支卡通V2-支付宝端内签约

自动跳转到支付端内签约页面(推荐)

import { Zcard } from 'ep-open-tool-h5';

// 跳转支卡通V2签约页面
ZCard.goToSignV2({
  bizProductCode:'接入时约定的bizProductCode',
  bizSceneCode: '接入时约定的bizSceneCode',
  subBizSceneCode: '接入时约定的subBizSceneCode'
  applyToken: '绑定时的applyToken值',
});

完整使用:ZCard.goToSign( signParams, options)

| signParam 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :------------- | :------------------------------------- | :----- | :----- | :------- | | bizProductCode | 接入时约定的 bizProductCode | string | 无 | 是 | | bizSceneCode | 接入时约定的 bizSceneCode | string | 无 | 是 | | subBizSceneCode | 接入时约定的 subBizSceneCode | string | 无 | 是 | | applyToken | 绑定凭证 | string | 无 | 是 | | returnUrl | 回跳链接 | string | 无 | 否 | | showResultPage |是否展示结果页 | Y | N | 无 | 否 | | specificId | 跳转支付宝时,需要指定支付宝账户时传入 | string | 无 | 否 |

| options 内容 | 字段说明 | 类型 | 默认值 | 是否必填 | | :----------- | :------------------------------- | :------ | :----- | :------- | | outAlipay | 是否在支付端 app 端外,默认 true | boolean | true | 否 | | openNewPage | 是否打开一个新页面,默认 true | boolean | true | 否 |

仅获取签约地址

import { Zcard } from 'ep-open-tool-h5';

const signUrl = Zcard.getSignUrlV2({
  bizProductCode:'接入时约定的bizProductCode'
  bizSceneCode: '接入时约定的bizSceneCode',
  applyToken: '绑定凭证',
});


常见问题 FAQ

1.returnUrl 支持那些类型?

当前支持的跳转链接需要满足下面的格式之一: 1.需要是 https://开头域名链接地址; 2.需要是 alipays://开头的支付宝小程序链接

需要保证传入的 returnUrl 链接能够有效访问,可以通过草料二维码转换成二维码,支付宝扫码验证是否能打开;

2.returnUrl 无法正常跳转

⚠️⚠️⚠️ 注意事项 1.整体 returnUrl 不需要额外的 encode,SDK 内部已经处理过了;

2.如果是跳转地址的链接需要 url 中有页面参数,则需要自己 encode 拼接好;比如跳转小程序的 pages/index/index 页面想带参数,则需要:'alipays://platformapi/startapp?appId=2021003126648243&page='+ encodeURIComponent('pages/index/index?参数 key=参数 value')