Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name = Faker::Name.name
- email = UUID.generate.gsub("-", "")[0..10] + "@venntro.com"
- customer = Stripe::Customer.create({
- name: name.to_s,
- email: email.to_s
- })
- payment_method = Stripe::PaymentMethod.attach(
- 'pm_card_authenticationRequiredOnSetup',
- { customer: customer.id }
- )
- customer = Stripe::Customer.retrieve(customer.id)
- subscription = Stripe::Subscription.create({
- customer: customer.id.to_s,
- off_session: true,
- payment_behavior: "allow_incomplete",
- items: [ { plan: PAYMENT_BAND_ITEM_ID.to_s } ],
- expand: ['latest_invoice.payment_intent']
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement