This file contains 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")(process.env.STRIPE_SECRET_KEY) | |
async function main(){ | |
for await (const customer of stripe.customers.list({limit: 100})) { | |
const paymentMethods = (await stripe.customers.listPaymentMethods( | |
customer.id, | |
{type: 'card'} | |
)).data; | |
// if customer has PM and no default, set it | |
if(paymentMethods.length > 0 !customer.invoice_settings.default_payment_method){ |
This file contains 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
import Head from 'next/head'; | |
import React from "react"; | |
export default class Pricing extends React.Component { | |
componentDidMount(){ | |
window.servicebotSettings = { | |
servicebot_id: 'E0OQN0P0Dort', | |
email: | |
'//REPLACE WITH THE EMAIL OF YOUR STRIPE CUSTOMER WHO IS SUBSCRIBED TO THIS SERVICE', | |
service: 'Flat Subscription', |