{"id":32374691,"url":"https://github.com/erolleddev/stpre","last_synced_at":"2025-10-24T22:42:06.120Z","repository":{"id":320332255,"uuid":"1081660729","full_name":"ErolledDev/stpre","owner":"ErolledDev","description":"da","archived":false,"fork":false,"pushed_at":"2025-10-23T06:18:37.000Z","size":717,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T08:28:05.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ErolledDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-23T05:26:09.000Z","updated_at":"2025-10-23T06:18:40.000Z","dependencies_parsed_at":"2025-10-23T08:29:31.411Z","dependency_job_id":"601e0d26-81cd-4a95-8220-5e5941072d4d","html_url":"https://github.com/ErolledDev/stpre","commit_stats":null,"previous_names":["erolleddev/stpre"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ErolledDev/stpre","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErolledDev%2Fstpre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErolledDev%2Fstpre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErolledDev%2Fstpre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErolledDev%2Fstpre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErolledDev","download_url":"https://codeload.github.com/ErolledDev/stpre/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErolledDev%2Fstpre/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280878345,"owners_count":26406642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-24T22:41:59.485Z","updated_at":"2025-10-24T22:42:06.114Z","avatar_url":"https://github.com/ErolledDev.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Checkout for subscriptions\n\n[Checkout](https://stripe.com/docs/payments/checkout) is a pre-built payment page that lets you accept cards and Apple Pay. [Billing](https://stripe.com/docs/billing) is a suite of APIs that lets you model complex subscription plans. You can combine the two products to get a subscription payment page up and running without the need of a server.\n\nWhen your customer is ready to pay, use [Stripe.js](https://stripe.com/docs/js) with the ID of your [Checkout Session](https://stripe.com/docs/api/checkout/sessions/object) to redirect them to your Checkout page.\n\n\u003cimg src=\"./checkout-demo.gif\" alt=\"A gif of the Checkout payment page rendering\" align=\"center\"\u003e\n\n**Demo**\n\nSee the sample of the integration [live](https://u5n7k.sse.codesandbox.io/) or [fork](https://codesandbox.io/s/github/stripe-samples/checkout-single-subscription/tree/codesandbox) the Node implementation on CodeSandbox.\n\nThe demo is running in test mode -- use `4242424242424242` as a test card number with any CVC + future expiration date.\n\nUse the `4000002500003155` test card number to trigger a 3D Secure challenge flow.\n\nRead more about testing on Stripe at https://stripe.com/docs/testing.\n\n**Features:**\n\n- Localization in over 25 different languages 🌍\n- Built-in Apple Pay support 🍎\n- Built-in dynamic 3D Secure (ready for SCA) 🔔\n\nFor more features see the [Checkout documentation](https://stripe.com/docs/payments/checkout/subscriptions).\n\nThe integration uses the [Checkout Sessions API](https://stripe.com/docs/api/checkout/sessions) for additional functionality.\n\n\u003c!-- prettier-ignore --\u003e\n|      | main |\n| :--- | :---: |\n| 🔨 **Prebuilt checkout page.** Create a payment page that is customizable with your business' name and logo.   | ✅ |\n| 🖥️ **Define prices in Dashboard or via API.** Create a price with either the Stripe Dashboard or API.   | ✅ |\n| 🔢 **Start subscription for an existing Customer.** Use [Customers](https://stripe.com/docs/api/customers) to keep track of additional customer data.   | ✅ |\n\n## How to run locally\n\nThis sample includes 8 server implementations in Node, Ruby, Python, Java, PHP, PHP with Slim, Go and .NET.\n\nFollow the steps below to run locally.\n\n**1. Clone and configure the sample**\n\nThe Stripe CLI is the fastest way to clone and configure a sample to run locally.\n\n***Cloning using the Stripe CLI***\n\n\u003e If you haven't already installed the CLI, follow the [installation steps](https://stripe.com/docs/stripe-cli#install) in the project README. The CLI is useful for cloning samples and locally testing webhooks and Stripe integrations.\n\u003e \n\u003e In your terminal shell, run the Stripe CLI command to clone the sample:\n\u003e \n\u003e ```sh\n\u003e ./stripe samples create checkout-single-subscription\n\u003e ```\n\u003e \n\u003e The CLI will walk you through picking your server and client languages and configuring your `.env` config file with your Stripe API keys.\n\n***Cloning manually***\n\n\u003e If you do not want to use the Stripe CLI, you can manually clone and configure the sample yourself:\n\u003e \n\u003e ```sh\n\u003e git clone https://github.com/stripe-samples/checkout-single-subscription\n\u003e ```\n\u003e \n\u003e Copy the `.env.example` file into a file named `.env` in the folder of the server you want to use. For example:\n\u003e \n\u003e ```sh\n\u003e cp .env.example server/node/.env\n\u003e ```\n\u003e \n\u003e You will need a Stripe account in order to run the demo. Once you set up your account, go to the Stripe [developer dashboard](https://stripe.com/docs/development/quickstart#api-keys) to find your API keys.\n\u003e \n\u003e ```sh\n\u003e STRIPE_PUBLISHABLE_KEY=\u003creplace-with-your-publishable-key\u003e\n\u003e STRIPE_SECRET_KEY=\u003creplace-with-your-secret-key\u003e\n\u003e ```\n\n**2. Create Products and Prices on Stripe**\n\nThis sample requires two [Price](https://stripe.com/docs/api/prices/object) IDs to create the Checkout page. Products and Prices are objects on Stripe that let you model a subscription.\n\n**Using the Stripe CLI**\n\nCreate basic product\n```sh\n./stripe products create --name=\"Basic\" --description=\"Basic plan\"\n```\n\nCreate premium product\n```sh\n./stripe products create --name=\"Premium\" --description=\"Premium plan\"\n```\n\nTake note of the id value for the products you just created as you will need this to create prices. For example:\n```json\n{\n  \"id\": \"prod_RANDOM_ID_VALUE\"\n}\n```\n\nCreate price for Basic product, substituting `ID_OF_BASIC_PRODUCT` with the appropriate product Id:\n```sh\n./stripe prices create \\\n  -d \"product=ID_OF_BASIC_PRODUCT\" \\\n  -d \"unit_amount=1800\" \\\n  -d \"currency=usd\" \\\n  -d \"recurring[interval]=month\"\n```\n\nCreate price for Premium product, substituting `ID_OF_BASIC_PRODUCT` with the appropriate product Id:\n```sh\n./stripe prices create \\\n  -d \"product=ID_OF_PREMIUM_PRODUCT\" \\\n  -d \"unit_amount=1800\" \\\n  -d \"currency=usd\" \\\n  -d \"recurring[interval]=month\"\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eWith Stripe Tax\u003c/summary\u003e\n  Stripe Tax lets you calculate and collect sales tax, VAT and GST with one line of code.\n\n  Before creating a price, make sure you have Stripe Tax set up in the dashboard: [Docs - Set up Stripe Tax](https://stripe.com/docs/tax/set-up).\n\n  Stripe needs to know what kind of product you are selling to calculate the taxes. For this example we will submit a tax code describing what kind of product is used: `txcd_10000000` which is 'General - Electronically Supplied Services'. You can find a list of all tax codes here: [Available tax codes](https://stripe.com/docs/tax/tax-codes). If you leave the tax code empty, Stripe will use the default one from your [Tax settings](https://dashboard.stripe.com/test/settings/tax).\n\n  ```sh\n  ./stripe products create \\\n    -d \"name=Premium\" \\\n    -d \"description=Premium plan\" \\\n    -d \"tax_code=txcd_10000000\"\n  ```\n\n  From the response, copy the `id` and create a price. The tax behavior can be either `inclusive` or `exclusive`. For our example, we are using `exclusive`.\n\n  ```sh\n  ./stripe prices create \\\n    -d \"unit_amount=1800\" \\\n    -d \"currency=usd\" \\\n    -d \"tax_behavior=exclusive\" \\\n    -d \"recurring[interval]=month\" \\\n    -d \"product=\u003cINSERT_ID, like prod_ABC123\u003e\"\n  ```\n\n  More Information: [Docs - Update your Products and Prices](https://stripe.com/docs/tax/checkout#product-and-price-setup)\n\u003c/details\u003e\n\n**Using the Dashboard**\n\nYou can create Products and Prices [in the dashboard](https://dashboard.stripe.com/products). Create two recurring Prices to run this sample.\n\n**Update BASIC_PRICE_ID and PRO_PRICE_ID in your .env file**\n\nRepeat these steps for to create a second product and price.\n\nNext, open `.env` in the folder of the server you want to use, and update the values for `BASIC_PRICE_ID` and  `PRO_PRICE_ID` with the price IDs of the two prices you added.\n\n**3. Confirm that you have set the account name**\n\nIn order to use Checkout, you must set an account or business name at https://dashboard.stripe.com/account\n\n**4. Follow the server instructions on how to run:**\n\nPick the server language you want and follow the instructions in the server folder README on how to run.\n\nFor example, if you want to run the Node server:\n\n```sh\ncd server/node\n# There's a README in this folder with instructions to run the server and how to enable Stripe Tax.\nnpm install\nnpm start\n```\n\n**[Optional] Customize your branding**\n\nTo customize your icon, logo and colors for Checkout and the Customer Portal, go to [Branding settings](https://dashboard.stripe.com/account/branding) in the Dashboard.\n\n**[Optional] Run a webhook locally:**\n\nYou can use the Stripe CLI to easily spin up a local webhook.\n\nFirst [install the CLI](https://stripe.com/docs/stripe-cli) and [link your Stripe account](https://stripe.com/docs/stripe-cli#link-account).\n\n```sh\n./stripe listen --forward-to \"localhost:4242/webhook\"\n```\n\nThe CLI will print a webhook secret key to the console. Set `STRIPE_WEBHOOK_SECRET` to this value in your `.env` file.\n\nYou should see events logged in the console where the CLI is running.\n\nWhen you are ready to create a live webhook endpoint, follow our guide in the docs on [configuring a webhook endpoint in the dashboard](https://stripe.com/docs/webhooks/setup#configure-webhook-settings).\n\n**[Optional] Adjust other environment variables**\n\nThe other environment variables are configurable:\n\n`STATIC_DIR` tells the server where to the client files are located and does not need to be modified unless you move the server files.\n\n`DOMAIN` is the domain of your website, where Checkout will redirect back to after the customer completes the payment on the Checkout page.\n\n## FAQ\n\nQ: Why did you pick these frameworks?\n \n\u003e We chose the most minimal framework to convey the key Stripe calls and concepts you need to understand. These demos are meant as an educational tool that helps you roadmap how to integrate Stripe within your own system independent of the framework.\n \nQ: What happened to Plans and SKUs?\n\n\u003e Plans and SKUs were old ways to model recurring and one-off prices. We created the Prices API to unify the two concepts and make it easier to reason about your pricing catalog. You can still pass old Plan and SKU IDs to Checkout -- to learn more read [our docs](https://stripe.com/docs/payments/checkout/migrating-prices) but know that you do not need to migrate any of your existing SKUs and Plans.\n\n## Get support\nIf you found a bug or want to suggest a new [feature/use case/sample], please [file an issue](../../issues).\n\nIf you have questions, comments, or need help with code, we're here to help:\n- on [Discord](https://stripe.com/go/developer-chat)\n- on Twitter at [@StripeDev](https://twitter.com/StripeDev)\n- on Stack Overflow at the [stripe-payments](https://stackoverflow.com/tags/stripe-payments/info) tag\n- by [email](mailto:support+github@stripe.com)\n\nSign up to [stay updated with developer news](https://go.stripe.global/dev-digest).\n\n## Author(s)\n\n[@adreyfus-stripe](https://twitter.com/adrind)\n[@cjavilla-stripe](https://twitter.com/cjav_dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferolleddev%2Fstpre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferolleddev%2Fstpre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferolleddev%2Fstpre/lists"}