2co-react 中文文档教程

发布于 6年前 浏览 49 项目主页 更新于 3年前

2Checkout payment gateway and react

连接到 2CO api 并生成客户端令牌的带有或不带信用形式的有状态组件反应

Getting Started

2Checkout 支付网关需要一个令牌来创建和收取订单。 该软件包将为您创建一个令牌。

使用此令牌,您需要将您的订单和客户信息发送到 2Checkout 以进行收费。

这可以通过 2Checkout API2Checkout-Node

我建议将 2Checkout-Node 与此包一起使用来生成令牌并将其发送到 2Checkout-Node 创建费用。

Installing & Usage

一系列示例逐步说明如何获取令牌:

Install:

npm i 2co-react

yarn add 2co-react

Usage:

导入:

import TCO from '2co-react';

这是您需要添加的唯一组件:

        <TCO
          sellerId="xxxxx"
          publishableKey="xxxxx"
          sandbox
          showForm
          showModal
          showLoading
          returnToken={this.returnToken}
        />
    

Props Options:

TCO PropVALUEEffect
sellerIdselled id from 2checkout account-
publishableKeypublishable key from 2checkout account-
sandboxtrue or falsegenerate a sandbox or production token
showFormtrue or falseshow cedit card form
showModaltrue or falseshow credit card form on modal or on page
showLoadingtrue or falseshow loading bar while waiting for response back
returnTokenfunctionfunction that will recive one argument as the token string

Authors

License

该项目已获得 MIT License 许可

2Checkout payment gateway and react

React stateful component with or without credit form that connect to 2CO api and generate client token

Getting Started

2Checkout payment gateway need a token to create and charge orders. This package will create a token for you.

Using this token, you will need to send your order and customer info to 2Checkout to make the charge.

This can be done by 2Checkout API or by 2Checkout-Node.

I recommend using 2Checkout-Node along with this package to generate token and send it to 2Checkout-Node to create the charge.

Installing & Usage

A step by step series of examples that tell you how to get a token:

Install:

npm i 2co-react

or

yarn add 2co-react

Usage:

Importing:

import TCO from '2co-react';

This is the only component you need to add:

        <TCO
          sellerId="xxxxx"
          publishableKey="xxxxx"
          sandbox
          showForm
          showModal
          showLoading
          returnToken={this.returnToken}
        />
    

Props Options:

TCO PropVALUEEffect
sellerIdselled id from 2checkout account-
publishableKeypublishable key from 2checkout account-
sandboxtrue or falsegenerate a sandbox or production token
showFormtrue or falseshow cedit card form
showModaltrue or falseshow credit card form on modal or on page
showLoadingtrue or falseshow loading bar while waiting for response back
returnTokenfunctionfunction that will recive one argument as the token string

Authors

License

This project is licensed under the MIT License

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文