This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <!-- Add two inputs for "phoneNumber" and "code" --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var createError = require("http-errors"); | |
| var express = require("express"); | |
| var path = require("path"); | |
| var cookieParser = require("cookie-parser"); | |
| var logger = require("morgan"); | |
| var indexRouter = require("./routes/index"); | |
| var usersRouter = require("./routes/users"); | |
| const hbs = require("express-handlebars"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var router = express.Router(); | |
| /* GET home page. */ | |
| router.get('/', function(req, res, next) { | |
| res.render('index', { title: 'Express', someVariable: 'example' }); | |
| }); | |
| module.exports = router; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const createProduct = async () => { | |
| const PRODUCT_NAME = "Monthly Subscription"; | |
| const PRODUCT_TYPE = 'service' | |
| const product = await stripe.products.create({ | |
| name: PRODUCT_NAME, | |
| type: PRODUCT_TYPE, | |
| }); | |
| console.log(product); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const createPlan = async productId => { | |
| const PLAN_NICKNAME = "Monthly Subscription Plan"; | |
| const PLAN_INTERVAL = "month"; | |
| const CURRENCY = "usd"; | |
| const PLAN_PRICE = 200; | |
| const plan = await stripe.plans.create({ | |
| product: productId, | |
| nickname: PLAN_NICKNAME, | |
| currency: CURRENCY, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const createCustomer = async () => { | |
| const CUSTOMER_EMAIl = "[email protected]"; | |
| const CUSTOMER_SOURCE = 'tok_mastercard'; | |
| const customer = await stripe.customers.create({ | |
| email: CUSTOMER_EMAIl, | |
| source: CUSTOMER_SOURCE, | |
| }); | |
| console.log(customer); | |
| return customer.id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const subscribeCustomerToPlan = async (customerId, planId) => { | |
| const subscription = await stripe.subscriptions.create({ | |
| customer: customerId, | |
| items: [{plan: planId}], | |
| }); | |
| console.log(subscription); | |
| return subscription; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const stripe = require("stripe")("sk_test_SXIuQ6FMks5aBKEOZCvEJn2k"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| server_name _; | |
| #ONE FOR EACH NEXTJS APP AND SUBDOMAIN | |
| #BIKES - PORT 3001 |