【问题标题】:Paypal Express Checkout Error (Method Specified is not Supported)Paypal Express 结帐错误(不支持指定的方法)
【发布时间】:2013-03-30 14:12:09
【问题描述】:

我是 codeigniter 和 paypal 的新手。我正在研究 gocart(一个基于 codeIgniter 的开源电子商务解决方案)。我尝试使用其中集成的 paypal API,但显示错误如下:

[ACK] => 失败 [L_ERRORCODE0] => 81002 [L_SHORTMESSAGE0] => 未指定的方法 [L_LONGMESSAGE0] => 不支持指定的方法 [L_SEVERITYCODE0] => 错误 下面是我的代码:paypal_expres.php
$this->RETURN_URL = 'www.example.com';
$this->CANCEL_URL = 'www.example.com';
$this->currency = 'USD';
$this->host = "api-3t.sandbox.paypal.com";
$this->gate = 'https://www.sandbox.paypal.com/cgi-bin/webscr?';


public function doExpressCheckout($amount, $desc, $invoice='') { 
    $data = array( 
      'PAYMENTACTION' =>'Sale',
      'AMT' => '24',
      'RETURNURL' => $this->getReturnTo(),
      'CANCELURL' => $this->getReturnToCancel(),
      'CURRENCYCODE'=> $this->currency,
      'METHOD' => 'SetExpressCheckout'
    ); 
    $query = $this->buildQuery($data);
    $result = $this->response($query);  
    $response = $result->getContent();
    $return = $this->responseParse($response);  
    echo ''; 
    print_r($return);
    echo '';
    if ($return['ACK'] == 'Success') {
        header('Location: '.$this->gate.'cmd=_express-checkout&useraction=commit&token='.$return['TOKEN'].''); 
    }
    return($return);
}

public function doExpressCheckout($amount, $desc, $invoice='') {
    $data = array( 
      'PAYMENTACTION' =>'Sale',
      'AMT' => '24',
      'RETURNURL' => $this->getReturnTo(),
      'CANCELURL' => $this->getReturnToCancel(),
      'CURRENCYCODE'=> $this->currency,
      'METHOD' => 'SetExpressCheckout'
    );
    $query = $this->buildQuery($data);
    $result = $this->response($query);
    $response = $result->getContent();
    $return = $this->responseParse($response);
    echo ''; 
    print_r($return);
    echo '';
    if ($return['ACK'] == 'Success') {
        header('Location: '.$this->gate.'cmd=_express-checkout&useraction=commit&token='.$return['TOKEN'].'');
        die(); 
    }
    return($return); 
}

private function response($data) {
    $result = $this->CI->httprequest->connect($data);
    if ($result<400) return $this->CI->httprequest;
    return false;
}
private function buildQuery($data = array()) {
    $data['USER'] = $this->API_USERNAME;
    $data['PWD'] = $this->API_PASSWORD;
    $data['SIGNATURE'] = $this->API_SIGNATURE; 
    $data['VERSION'] = '56.0';
    $query = http_build_query($data);
    return $query;
} 

【问题讨论】:

  • 当你没有传递一个有效的方法时,通常会产生这个错误,但也可能是由于其他事情没有被正确传递。您能否提供您发送的 API 请求字符串,减去您的 API 凭据。
  • 当我手动点击请求时,它就成功了。请求是:api-3t.sandbox.paypal.com/…
  • 您能否在问题帖子中提供您的字符串。由于评论部分的显示方式,我看不到您发送的内容的完整链接。

标签: php paypal express-checkout


【解决方案1】:

当 Paypal 返回此消息时,它是传输方法的情况,而不是方法参数/属性。

在 Paypal 中只接受 POST。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-06-30
    • 2017-03-21
    • 2016-11-13
    • 1970-01-01
    • 2018-12-12
    • 1970-01-01
    • 2017-09-07
    相关资源
    最近更新 更多