#Anil
1 messages · Page 1 of 1 (latest)
Could you elaborate which step you are stucking on?
Yes, i want to test whether the payment is automatically deducting or not
Can you suggest me what to do?
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
Okay so i have ro create a customer in stripe dashboards?
or via API
Okay let me test with dashboard first.
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
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
)
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
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
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
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.
Do you have an issue with your code?
Or are you only working in Dashboard?
I am working in dashboard only