2017-12-23 8 views
0

私のモバイルアプリケーションでは、私はpayumoneyを完全に設定しており、その作業は素晴らしいです。そのちょうど払い戻しの場合。payumoney refund api in php

include('../connection.php'); 

$orderid="AMD197"; 

$view_rs =$conn->prepare("SELECT * from tbl_payumoney_order WHERE orderid=:orderid");  

$view_rs->execute(array(':orderid'=>$orderid));     
$vfetch=$view_rs->fetch(); 

$merchantId="393463"; 
$paymentId= $vfetch['paymentId']; 
$refundAmount= $vfetch['amount']; 
$merchantAmount= $vfetch['amount']; 
$aggregatorAmount= "0"; 
$refundType="1"; 

$data_string="paymentId=".$paymentId."&refundAmount=".$refundAmount."&refundType=".$refundType."&merchantId=".$merchantId."&merchantAmount=".$merchantAmount."&aggregatorAmount=".$aggregatorAmount; 

//paymentId=123456&refundAmount=56&refundType=1&merchantId=765433&merchantAmount=6&aggregatorAmount=50 


$ch = curl_init();  
$url = "https://test.payumoney.com/payment/refund/refundPayment"; 

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 

curl_setopt($ch, CURLOPT_URL,$url); 
curl_setopt($ch, CURLOPT_POST, true); /* tell curl you want to post something*/ 
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string); /* define what you want to post*/ 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); /* return the output in string format*/ 
$headers = array(); 

$headers[] = 'Content-Type: application/json'; 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec ($ch); 
$info = curl_getinfo($ch); 

$data = json_decode($output, true); 

print_r($data); 

$status= $data['status']; 
$message= $data['message']; 
$result= $data['result']; 

私はこの応答を取得しています:

アレイ([状態] => -1 [行] => 0 [以下は、私がアプリから呼び出すPHPファイル内のコードです私は何をやっている場合はメッセージ] =>何かが間違っていた GUID 3k4pcbv6kdqf405g0lut7id32mセッションIDヌル[結果] => [GUID] => 3k4pcbv6kdqf405g0lut7id32m [セッションID] => nullの[のerrorCode] =>)

は、誰もがお勧めできますここで間違っている?

答えて

0

何かが間違っていた...エラーがPayUmoney API Documentationに応じて、あなたのアプリケーションやウェブサイトに起因する500、502、503または504 ServerエラーにPayUmoneyの終わりに来ます。また、以下のような故障の場合にはより多くの情報を得るためにあなたのカールを更新

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

は、これらのHTTP応答コードについての詳細を知るためには、あなたは下のリンクに従う必要が

$output = curl_exec($ch); 

if ($output === false){ 
    // throw new Exception('Curl error: ' . curl_error($output)); 
    print_r('Curl error: ' . curl_error($output)); 
} 

まだ問題がわからない場合は、PayUmoney Support Teamに連絡してください。

+0

PayUmoney APIドキュメンテーションを使用するのと同じやり方はありませんでした。 – jack

+0

このリンクを確認してください:https://stackoverflow.com/questions/36472935/how-do-i-integrate-payumoney-refund-api-in-php –

+0

3)あなたはまた、リクエスト: –