2014-07-15 2 views
0

아래 소스 코드로 클릭 은행 API를 사용하여 환불을 시도하고 있습니다.
클릭 은행 API를 사용하여 환불을 시작하는 방법

$ch = curl_init(); 
$qry_str="?type=rfnd&comment=API refund check&reason=7&refundType=FULL"; 

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'https://api.clickbank.com/rest/1.3/tickets/N5GNE72J'.$qry_str); 
curl_setopt($ch, CURLOPT_HEADER, true); 
//curl_setopt($ch, CURLOPT_GET, true); 
curl_setopt($ch, CURLOPT_CUSTOMREQUEST,'GET'); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml", "Authorization:DEV-xxxxxxxxx:API-yyyyyyyyyyyy")); 
$result = curl_exec($ch); 
curl_close($ch); 

print $result; 


I는 참조 용으로 두 개의 URL을 아래에 사용했다 : 그것은 빈 화면에 아무것도 표시되지 않습니다

  1. https://api.clickbank.com/api/api_13_examples/api_example.php
  2. https://api.clickbank.com/rest/1.3/tickets

위의 코드를 실행 한 후에는 displyed되고, 내 오류 플래그가 1로 설정되어 있으면 오류가 표시되지 않습니다.

답변

0

오랜 투쟁 끝에 해결책을 찾았습니다. 아래 코드를 사용하여 저에게 효과적이었습니다.

<?php 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 
    "https://api.clickbank.com/rest/1.3/tickets/627JE7CZ/?type=rfnd&comment=&reason=ticket.type.refund.7&refundType=FULL"); 
curl_setopt($ch, CURLOPT_HEADER, true); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
/** 
* ClickBank doesn't allow POST parameters to be sent in; however, for the CURL POST to work correctly, the 
* CURL_POSTFIELDS option must be set, so we'll just set it to empty and put all our request parameters on the URL 
*/ 
curl_setopt($ch, CURLOPT_POSTFIELDS, ""); 
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    "Accept: application/xml", 
    "Authorization:DEV-enter your dev key here:API-enter your clerk key here" 
)); 
$result = curl_exec($ch); 
curl_close($ch); 
?> 
관련 문제