#arjun.maniyar-attach-pm
1 messages · Page 1 of 1 (latest)
can you share what you're trying to run & the error without including your key please?
Sure
$request_headers = [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Bearer '.TEST_STRIPE_SECRET_KEY
];
$url = "https://api.stripe.com/v1/payment_methods";
$fields = array(
'customer' => $customer_id,
'type'=>'card'
);
$request_payload = http_build_query($fields);
$response_body = curlPost($url , $request_payload , $request_headers);
Basically, I need to get all payment methods of a customer through API and then charge that customer with a payment method
well wait, before you said create a payment method and not you're saying get them all
which are you having issues with?
you attach after creating: https://stripe.com/docs/api/payment_methods/attach
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
your request looks like maybe you're doing a POST when you mean to do a GET:
https://stripe.com/docs/api/payment_methods/list?lang=curl
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I need to get payment methods, what should I call in CURL?
Try changing curlPost to whatever the equivalent GET method is
Hi