Here's the code. Tried several variations of params. Any input would be great.
$endpoint = "https://api.stripe.com/v1/payments";
$params = array('limit' => '100', 'created[gte]' => '1627831313');
$url = $endpoint . '?' . http_build_query($params);
$ch = curl_init();
$headr = array();
$headr[] = 'Content-length: 0';
$headr[] = 'Content-type: application/json';
$headr[] = 'Authorization: Bearer [OUR STRIPE KEY]';
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$result=curl_exec($ch);
curl_close($ch);
Here's the response we get:
curl https://api.stripe.com/v1/payments -u [OUR STRIPE KEY]: -d limit=3 -d created=1627831313 -G { "error": { "code": "parameter_unknown", "doc_url": "https://ift.tt/3sWNuEM", "message": "Received unknown parameter: created", "param": "created", "type": "invalid_request_error" } }
source https://stackoverflow.com/questions/68955365/stripe-api-using-curl-and-php-unable-to-get-subscriptions-or-payments-by-creat
Comments
Post a Comment