Closed scottsuhy closed 1 year ago
@scottsuhy Have you found any solution I am facing same issue
no, i'm just did the transactions direct and built my own UI to manage it.. i'm not sure cb is serious about the platform or they would have commented. i'm looking for alternatives.
For now I have found 2 issues.
1: Checkout requires extra parameter requested_info like you passed with curl. coinbase doc ref
2: Second issue is related with this package. In this makeRequest() funcion while making request author passed ['query' => $query, 'body' => json_encode($params)]
and when I dump the $query array before request I found the array empty, I shuffle these variable this way ['query' => $params, 'body' => json_encode($query)]
createCheckout worked fine. although I haven't tested other functions (charge, createCharge) after these changes.
Try adding requested info parameter to the request
public function createCheckout(Request $request){
$checkout = Coinbase::createCheckout([
'name' => 'Name',
'description' => 'Description',
'requested_info' => ['name','email'],
'local_price' => [
'amount' => 100,
'currency' => 'USD',
],
'pricing_type' => 'fixed_price',
]);
return $checkout;
}
Please refer : Coinbase-documentation
Is there a solution? I also have this error.
requested_info
is optional but must be present:
$checkout = Coinbase::createCheckout([
'name' => 'Name',
'description' => 'Description',
'requested_info' => [],
'local_price' => [
'amount' => 100,
'currency' => 'USD',
],
'pricing_type' => 'fixed_price',
]);
Also, createCheckout
will be fixed soon (#20), this is the correct code:
/**
* Creates a new checkout.
*
* @param array $params
* @return array
*/
public function createCheckout(array $params = [])
{
return $this->makeRequest('post', 'checkouts', [], $params);
}
Fixed in #20
Required Information
Expected behaviour
Actual behaviour
Simple call to API
results in error:
even though 'request_info' is optional per https://commerce.coinbase.com/docs/api/#create-a-checkout
Steps to reproduce
Generic install on generic laravel create controller with the following function
Extra details
Charge and Events api's work as expected.
Using curl works fine:
and once I create it with Curl,
getCheckouts
works fine too.