How to use the chargebee.hosted_page function in chargebee

To help you get started, we’ve selected a few chargebee examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WorldBrain / Memex / functions / src / index.ts View on Github external
async (data: any, context: CallableContext) => {
        if (context.auth == null) {
            return notAuthenticatedResponse
        }

        // todo: move this up to the global import runtime context if the tests are okay with it
        chargebee.configure(getChargebeeOptions())

        const checkoutOptions = {
            subscription: { plan_id: data.planId },
            customer: getUser(context),
        }

        return chargebee.hosted_page
            .checkout_new(checkoutOptions)
            .request(resultFormatter(hostedPage))
    },
)
github rrecuero / fstack-ethdapp-template / backend / subscriptions / subscriptionsManager.js View on Github external
createHostedPageSubscription(planId, user, cb) {
    const hostedPage = chargebee.hosted_page;
    const checkoutFunc = user.subscriptionId
      ? hostedPage.checkout_existing : hostedPage.checkout_new;
    const params = ({
      subscription: {
        plan_id: planId
      },
      customer: {
        id: user && user._id.toString(),
        email: user && user.email,
        first_name: user.name && user.name.split(' ')[0],
        last_name: ''
      },
      reactivate: true,
      redirect_url: configChargebee.redirect_url,
      cancel_url: configChargebee.cancel_url,
      embed: true,

chargebee

A library for integrating with ChargeBee.

MIT
Latest version published 2 days ago

Package Health Score

71 / 100
Full package analysis