#aliahmad-default-pm
1 messages · Page 1 of 1 (latest)
hi
You can set a defauLt PM at either the Customer or Subscription level
how can set at customer level
with api
how can we charge with different payment method every time at customer level
@cinder storm
Please don't @ me
okay
You'd use this field: https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Depends what kind of payments you're processing and which payment UI you use
I am using web ui
this is object how can i set default pm
You'd use the update customer endpoint, and pass that parameter: https://stripe.com/docs/api/customers/update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
There's examples there depending on what language you're using
Cannot charge a customer that has no active card what is this
Does the customer have an active payment method?
yes
Stripe\Stripe::setApiKey('sk_test_51LIYoyDT3g17iFGAp9EJdBqp82HNjbYLPIzOZpHHRDZBoQjhCu94byxa40bphz20A15CakeoDFIJZ339MbWymumw005tDnRbrh');
$charge=Stripe\Charge::create ([
'customer' => $id,
"amount" => $total * 100,
"currency" => "usd",
"description" => "Test payment from Blisky.com."
]);
What is $id?
Also, why are you using Charges directly? You shouldn't: https://stripe.com/docs/payments/payment-intents/migration
What is what?
what is this