Reputation:
I want to accept bitcoin payment using coinbase commerce API(https://commerce.coinbase.com/docs/api/)
I was created a payment address using curl as below.
$curl = curl_init();
$postFilds=array(
'name' => 'Test Name',
'description' => 'Testing for checkout api',
'pricing_type' => 'fixed_price',
'local_price' => [
'amount' => '100.00',
'currency' => 'USD'
],
'requested_info' => ['Test', '[email protected]'],
'metadata' => ['userId'=>10]
);
$postFilds=urldecode(http_build_query($postFilds));
curl_setopt_array($curl,
array(
CURLOPT_URL => "https://api.commerce.coinbase.com/charges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $postFilds,
CURLOPT_HTTPHEADER => array(
"X-CC-Api-Key: api_key",
"X-CC-Version: 2018-03-22",
"content-type: multipart/form-data"
),
)
);
$response = curl_exec($curl);
now I want to check payment status is failed or successes using curl OR PHP
I don't know how to use webhook. my site is in laravel 5
Thank You!
Upvotes: 0
Views: 1054