#arjun.maniyar-attach-pm

1 messages · Page 1 of 1 (latest)

woeful hazel
#

can you share what you're trying to run & the error without including your key please?

fair dawn
#

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

woeful hazel
#

well wait, before you said create a payment method and not you're saying get them all

#

which are you having issues with?

fair dawn
#

I need to get payment methods, what should I call in CURL?

woeful hazel
#

Try changing curlPost to whatever the equivalent GET method is

fair dawn
#

Okay

#

Let me try that

#

Thanks for the help

fair dawn
#

Hi