#miran-testing
1 messages · Page 1 of 1 (latest)
hello @ocean roost! they can be found here : https://stripe.com/docs/testing
You'd want to click on the "PaymentMethods" tab
Hi, will I get the payment method by using this id like 'pm_card_visa' ?;
$paymentMethod = \Stripe\PaymentMethod::retrieve($request->get('paymentMethod'));
here's the code
what are you trying to test though?
I want to create subscription
manually we can do that, but now we want to automate the test
or should I pass the 'pm_card_visa' in the subscription create function?
you need to pass in a Customer when creating a subscription. The customer also needs to have a payment method attached
so what you'd need to do is to have an existing customer with pm_card_visa attached (and set the default payment method). Then create a subscription with that same customer
What if I reuse a payment method id from another test customer?
Like, I'll grab a id from the dashboard payments tab?
Will that work?
if you're intending to explicitly pass the payment method id in the subscription's default_payment_method, yes that would work. As long as you remember to pass in that particular test customer when creating the subscription too
Can several customers have same payment method attached to them?
each PaymentMethod id is unique. Even if you use the same credit card details e.g. 4242 test card, the generated PaymentMethod id would be different
so you can have the same credit card attached to several different customers
but not the same PaymentMethod attached to several different customers
So, how can I generate unique PaymentMethod, each time I want to attach it to a customer?
that we get inside handleCardSetup method using test card numbers like 4242424?
thanks.