Skip to content

bold-commerce/bigcommerce-create-subscription

Repository files navigation

Description

This sample app demonstrates how to Programmatically Create Subscriptions with the Bold Commerce Subscriptions API.

This project uses a custom checkout frontend based on the BigCommerce OS Checkout.

Dependencies/Prerequisites

  • Custom BigCommerce Checkout to add Bold Subscription meta data into checkout.
  • A Payment Gateway Account and API credentials [Braintre, Stripe, Authorize.net]
  • A BigCommerce account and API credentials.
  • A BoldCommerce account and API credentials.
  • Node.js, version 14 or later.
  • NPM, version 6 or later.

Installation

Use the following steps to install this repo (containing the Bold Subscriptions logic) and run the demo store locally:

  1. Clone this repository:

    git clone [email protected]:bold-commerce/bigcommerce-create-subscription.git
    cd bigcommerce-create-subscription
  2. Create a .env file from the sample file:

     cp sample-env .env
    
  3. Install the required dependencies:

    npm install
  4. Test the local environment:

    npm run dev
  5. Add and start ngrok. Note: use port 8000 to match your Express server.

    npm install ngrok
    ngrok http 8000
  6. Register a webhook with BigCommerce using the ngrok domain in your destination and webhook header using your BigCommerce Auth Token for security.

    1. After the initial order is placed, a BigCommerce Webhook is used to capture the order contents, filter the payments API, and create a Bold Subscription.

Testing

Use the following steps to ensure that the project is set up correctly:

  1. Add a BigCommerce Order Id in your .env file.

  2. Run the following command:

    npm run test

Next Steps

  • This example is using the Braintree Sandbox environment, which can be updated to production within the .env file.
    • Please see the sample-env file for more details.

Additional Documentation:

Demo store

Bold provides a demo store that allows you to see this example in action before getting started. Use the following steps to observe the functionality that this example enables:

  1. Visit the store.
  2. Visit a product page, and select Subscribe to this product today! Configure the order frequency, and add the product to your cart.
  3. Click Proceed to checkout.
  4. Since you have a subscription item in cart, the store prompts you to create an account. Create an account with sample customer and shipping information.
  5. Use 4111 1111 1111 1111 for the credit card number. Use any name, CVV, and expiration date (in the future).
  6. After you place the order, navigate to the Manage Subscriptions page to view your subscription.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published