import stripe using node js + typescript

You can refer to the repo on GitHub: https://github.com/stripe/stripe-node import Stripe from ‘stripe’; const stripe = new Stripe(‘sk_test_…’, { apiVersion: ‘2020-08-27’, }); const createCustomer = async () => { const params: Stripe.CustomerCreateParams = { description: ‘test customer’, }; const customer: Stripe.Customer = await stripe.customers.create(params); console.log(customer.id); }; createCustomer();

Meteor: Proper use of Meteor.wrapAsync on server

From the Meteor.wrapAsync http://docs.meteor.com/#meteor_wrapasync you can see that you need to pass it a function and optionally a context, whereas on your two attempts you are passing the RESULT of calling the async version of Stripe.customers.create. Meteor.methods({ stripeCreateUser: function(options) { // get a sync version of our API async func var stripeCustomersCreateSync=Meteor.wrapAsync(Stripe.customers.create,Stripe.customers); // call the … Read more

Stripe Payment: Getting Error as Customer cus_***** does not have a linked card with ID tok_*****

There are three different ways to create a charge: with the source parameter only. In this case, source needs to be a token or source ID (created by Checkout or Stripe.js), i.e. a string that starts with tok_ or src_. with the customer parameter only. In this case, customer needs to be a customer ID, … Read more

Top-level ‘await’ expressions are only allowed when the ‘module’ option is set to ‘esnext’

You can wrap your code for const account inside an async function as your target option doesn’t support top level await. const account = async () => { await stripe.accounts.create({ type: “express”, }); }; It depends on your code whether you want to return something or you want to perform some other tasks after await. … Read more

Do not collect Zip code with Stripe

Thankfully, this should be a pretty simple fix! hidePostalCode: true should be a top level property in your options, rather than nested under style here. https://stripe.com/docs/stripe.js#element-options var card = elements.create(‘card’, { hidePostalCode: true, style: { base: { iconColor: ‘#666EE8’, color: ‘#31325F’, lineHeight: ’40px’, fontWeight: 300, fontFamily: ‘”Helvetica Neue”, Helvetica, sans-serif’, fontSize: ’15px’, ‘::placeholder’: { color: … Read more

ReferenceError getValuesOfAutofillInputs, Can’t find variable: PaymentAutofillConfig

As you have already searched for getValuesOfAutofillInputs and PaymentAutofillConfig without any results, it is possible that this issue might be related to how Facebook’s webview handles autofill features for payment information. Try this steps: – Replicate the issue: Try to reproduce the issue on multiple iOS devices and different versions of the Facebook and Instagram … Read more

Stripe: downgrade a user at “period end”

Most of the solutions presented here look like hacks after stripe’s release of subscription schedules, which is probably the most elegant solution. In fact, stripe documentation has an example illustrating exactly the same scenario here. Step 1: Get current_period_end value from the existing subscription that you wish to downgrade. Step 2: Create a new subscription … Read more