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

react-native-chargebee

v0.3.3

Published

Package for chargebee checkout

Downloads

9

Readme

react-native-chargebee

Package for chargebee checkout

Installation

yarn add react-native-chargebee

Dependencies

To successfully use this package, you need react native webview with version >= 8.1.1 yarn add "react-native-webview"

Usage

The package comes with type definition whic you can use to see the list of allowed props.

import CheckoutCart from "react-native-chargebee";

// ...

<CheckoutCart
  success={(hostedPageId: string) => successfulPurchase(hostedPageId)}
  step={(stepName: string) => handleStep(stepName)}
  site={site}
  planName={planName}
  couponIds={couponIds}
  addons={addons}
  customer={customer}
  subscription={subscription}
  billingAddress={billingAddress}
/>

Example

The base repository includes a sample application that shows the props accepted by the component.

The example app showcases the various options that can be passed.

To install the base dependencies, run yarn bootstrap in the root directory:

yarn bootstrap

To start the packager:

yarn example start

To run the example app on Android:

yarn example android

To run the example app on iOS:

yarn example ios

Properties

The properties that can be passed to the CheckoutCart component are:

| Prop | Required | Type | Description | | :------------ |:---------------:| :---------------:| :-----| | site | Yes | String | Name of the chargebee hosted site | |planName | Yes | String | Name of the plan user is purchasing | | addons | No | Addon[] | Parameters for addons. Multiple addons can be passed. Fields are listed below| | couponIds | No | String[] | Identifier of the coupon as a List. Coupon Codes can also be passed| | customer | No | Customer | Details about the customer that needs to be prefilled in checkout. Fields are listed below | | subscription | No | Subscription | Details about the subscription. Fields listed below | | billingAddress | No | Address | Billing address of the customer. Fields listed below | | shippingAddress | No | Address | Shipping address of the customer. Fields listed below |

Addon

| Prop | Required | Type | Description | | :------------ |:---------------:| :---------------:| :-----| | id | Yes | string | Identifier of the addon | | quantity | No | integer, default=1, min=1 | Addon quantity. Applicable only for the quantity based addons |

Customer

| Prop | Required | Type | Description | | :------------ |:---------------:| :---------------:| :-----| | email | No | string max chars=70 | Email of the customer. Configured email notifications will be sent to this email.| | firstName | No | string max chars=150 | First name of the customer. If not provided it will be got from contact information entered in the hosted page .| | lastName | No | string max chars=150 | Last name of the customer. If not provided it will be got from contact information entered in the hosted page .| | company | No | string max chars=250 | Company name of the customer.| | locale | No | String max chars=50 | Determines which region-specific language Chargebee uses to communicate with the customer. In the absence of the locale attribute, Chargebee will use your site's default language for customer communication. | | phone | No | String max chars=50 | Phone number of the customer. | | vat_number | No | String max chars=20 | VAT/ Tax registration number of the customer. Learn more. |

Subscription

| Prop | Required | Type | Description | | :------------ |:---------------:| :---------------:| :-----| | planQuantity | No | integer default=1, min=1| Plan quantity for this subscription.| | startDate | No | integer timestamp(UTC) in seconds | Allows you to specify a future date or a past date on which the subscription starts.Past dates can be entered in case the subscription has already started. Any past date entered must be within the current billing cycle/plan term. The subscription will start immediately if this parameter is not passed. |

Address

| Prop | Required | Type | Description | | :------------ |:---------------:| :---------------:| :-----| | firstName | No | String max chars=150 | First name. | | lastName | No | String max chars=150 | Last name. | | email | No | String max chars=70 | Email. | | company | No | String max chars=250 | Company name. | | phone | No | String max chars=50 | Phone number. | | line1 | No | String max chars=150 | Address line 1. | | line2 | No | String max chars=150 | Address line 2. | | line3 | No | String max chars=150 | Address line 3. | | city | No | String max chars=50 | City. | | stateCode | No | String max chars=50 | The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona ( USA), set the stateCode as AZ (not US-AZ). or, for Tamil Nadu (India), set the stateCode as TN (not IN-TN). or, for British Columbia (Canada), set the stateCode as BC (not CA-BC). Note: If the 'stateCode' is specified, the 'state' attribute should not be provided as Chargebee will set the value automatically (for US, Canada, India). | | state | No | String max chars=50 | The state/province name. Use this to pass the state/province information for cases where 'stateCode' is not supported or cannot be passed. | | zip | No | String max chars=20| Zip or Postal code. | | country | No | String max chars=50| 2-letter ISO 3166 alpha-2 country code. |

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT