已通过API验证了与我的Paypal交易,但我的帐户余额为$ 0.00

时间:2018-11-22 09:23:41

标签: paypal payment-gateway

昨天(通过API(https://api.paypal.com/v1/payments/payment/)已验证Paypal交易,但我的帐户余额为$ 0.00。

今天,相同的API回答了我-------- [“名称”] =>字符串(19)“ INVALID_RESOURCE_ID” [“消息”] =>字符串(39)“未找到所请求的资源ID” [“ information_link“] =>字符串(54)” https://developer.paypal.com/docs/api/payments/#errors“ [” debug_id“] =>字符串(13)” b39d1f444064e“

余额再次变为$ 0。如何解决该问题,我的在线商店中有经过验证的付款,通过API查询,他们在付款过程中获得了“已验证”状态。现在该怎么办?在哪里搜索问题?

(在此沙盒版本运行良好之前)。

付款执行:

if($test_mode_paypal)
        $execute_url = 'https://api.sandbox.paypal.com/v1/payments/payment/'.$pay_key.'/execute';
    else
        $execute_url = 'https://api.paypal.com/v1/payments/payment/'.$pay_key.'/execute';

    $header = array();
    $header[] = 'Content-type: application/json';
    $header[] = 'Accept: application/json';
    $header[] = 'Authorization: Bearer '.$accessToken;
    $data ='{
      "payer_id":"'.$payer_id.'"
    }';
    //open connection
    $curl = curl_init();
    //set connection properties
    curl_setopt($curl, CURLOPT_URL, $execute_url);
    curl_setopt($curl, CURLOPT_POST, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    curl_setopt($curl, CURLOPT_HTTPHEADER,$header);
    //execute post
    $response = curl_exec($curl);
    //close connection
    curl_close($curl);

    $result = json_decode($response);


    $response_arr = array();
    if($result->state == 'approved')
    {
        $response_arr['status'] = 'ok';
        $response_arr['message'] = $response;
        return $response_arr;
    }

1 个答案:

答案 0 :(得分:0)

听起来像您created the payment,但您从来没有executed it

相关问题