#Anil

1 messages · Page 1 of 1 (latest)

vivid wraithBOT
glacial bridge
#

Could you elaborate which step you are stucking on?

final ridge
#

Yes, i want to test whether the payment is automatically deducting or not

#

Can you suggest me what to do?

glacial bridge
#

Ah I see, you can use the Test clock to simulate times for a Subscription

#

Create test clock with a Customer, then create the Checkout Session with that Customer Id

final ridge
#

Okay so i have ro create a customer in stripe dashboards?

glacial bridge
#

or via API

final ridge
#

Okay let me test with dashboard first.

final ridge
#

I am trying to add payment method here but this field is unclickable

#

And when i hover it shows off-sessions card payments are not supported

glacial bridge
#

That's on Customer page?

#

Me looks a bit different and it works

final ridge
#

No it's in create a test subscription

glacial bridge
#

You will need to create card on the Customer first

#

I do think using API would be faster and less error-proned

#

Purely illustrative but here is Ruby code

prod =Stripe::Product.create({
  name: "Product1"
})
price = Stripe::Price.create({
  unit_amount: 3000,
  currency: 'usd',
  recurring: {interval: 'month'},
  product: prod.id,
})

clock = Stripe::TestHelpers::TestClock.create(
  frozen_time: 1635750000, # 7:00 Nov 1st 2021
  name: 'Annual renewal',
)

cus = Stripe::Customer.create(
  email: 'jenny.rosen@example.com',
  test_clock: clock.id,
  payment_method: 'pm_card_visa',
  invoice_settings: {default_payment_method: 'pm_card_visa'},
)

sub = Stripe::Subscription.create({
  customer: cus.id,
  items: [{price: price.id}],
})
p sub.id

# Advance by 1 month
Stripe::TestHelpers::TestClock.advance(
  clock.id,
  {frozen_time: 1638352800}, # Dec 1st 2021
)
final ridge
#

Can you provide in node js

#

This is the customer page where i have to add card

#

I am trying to add in payment methods its showing the same

glacial bridge
#

Can you screenshot the error?

#

And is that test mode customer?

final ridge
#

Yes its test mode

#

I am not getting any error but i am not able to fill the card

#

When i click on add it appears

dawn cairn
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

final ridge
#

Okay
I am asking about how to test the payment is automatically deducted or not
So he suggested me to use test clocks
So i am creating a customer in dashboard

#

But i am unable to add the card in subscription or customer.

dawn cairn
#

Do you have an issue with your code?
Or are you only working in Dashboard?

final ridge
#

I am working in dashboard only