#atul

1 messages · Page 1 of 1 (latest)

tranquil dirgeBOT
brittle coral
#

hi there! do you have a bit more context on that?

acoustic vine
#

pi_3Lh8Q4SApUbhYhpH10ha6olz

brittle coral
#

any other context?

acoustic vine
#

I am writting a test case to simulate the successfull payment

#

stripe.customers.createSource(
customer.id,
{ source: 'tok_visa' },
);

#

i added above card as default payment source

#

After this i tried to create subscription for the customer but, payment status shows incomplete

brittle coral
#

that's expected really, you have to tell us to charge that specific card.

#

also you shouldn't use createSource, that's deprecated

acoustic vine
#

instead of create source what can be used??

cloud tartan
#

Hi! I'm taking over this thread.

acoustic vine
#

I have requirement

cloud tartan
#

Can you clarify what are you trying to do?

acoustic vine
#

I need to write the test case foe successfully payment and payment failure

#

For this i creteadted a customer, a product

#

No i wanto creted customer to subcscribe to created product

#

I am stuck over how to make payment

cloud tartan
#

Are you using subscriptions?

acoustic vine
#

yes

cloud tartan
acoustic vine
#

yes

#

i need to write test case

#

where payment can be processed successfully without humn intervention

#

why all my payment remains in incomplete state

#

Anyone there ???

cloud tartan
acoustic vine
#

from where i can get the id of payment method for customer

#

??

cloud tartan
#

You could create a customer like this (in Node.js):

await stripe.customers.create({
  payment_method: "pm_card_us",
  invoice_settings: {
    default_payment_method: "pm_card_us"
  }
});
acoustic vine
#

Payment is not getting completed ??

#

What should be done

#

I tried with all aspect

#

Hello

cloud tartan
#

Payment is not getting completed ??
What does that mean? Can you share a subscription ID or PaymentIntent ID?

acoustic vine
#

pi_3Lh9dRSApUbhYhpH1qOI3qYo

#

Please let me know the issue

cloud tartan
#

A few things:

  • Why are you creating a PaymentIntent if you are using subscription?
  • You forgot to confirm the PaymentIntent. You can do that by passing confirm:true when creating the PI
acoustic vine
#

Things are got meshed up

#

I created a customer
I created a product
Now i have requirement, i need to create subscription, how can be this achieved(only human intervention is allowed as writting test script)

#

This is how I create customer
tripe.customers.create({
description: 'Test customer for mocha testing',
payment_method: "pm_card_us",
invoice_settings: {
default_payment_method: "pm_card_us"
}
});

#

This is how i create product
stripe.products.create({
name: 'Mochas test product',
default_price_data: {
currency: 'usd',
unit_amount: 1000,
recurring: {
interval: 'month',
interval_count: 1
}
}
});

#

Now tell me how to create subscription ??

fervent sparrow
acoustic vine
#

yes, i follwed it, payment is not geting completed?

fervent sparrow
#

What's the sub_xxx?

acoustic vine
#

This all i tried

#

I there any way to have payment ot be successfull

#

???

fervent sparrow
#

I can't really help without seeing what state the Subscription you've created is in

acoustic vine
#

incomplete

#

sub_1LhA6YSApUbhYhpHFFIwYK13

#

pi_3LhA6ZSApUbhYhpH1w0yWGFR

#

Above is the subscription id and payment intent_id

fervent sparrow
#

That's not the PI for that Subscription