【发布时间】:2014-11-02 04:12:51
【问题描述】:
整个贝宝流程一直是一场接一场的噩梦。除了一个小问题,我已经成功完成了申请。来自 paypal Payment::execute() 的响应对象没有文档。我的前端是客户端,所以我真的不知道这个响应数组包含什么。
这是我目前得到的:
$paymentId = $this->ppconf; //stores paymentId
if(empty($paymentId)){Throw New \Exception('missing payment id'); }
$payment = Payment::get($paymentId, $apiContext);
$execution = new PaymentExecution();
$execution->setPayerId($z);
$response = $payment->execute($execution, $apiContext); // i need to know what this response array looks like and what the response codes are, so i can generate my $result array for my application.
$state = $response->getState();
$failures = ['failed','canceled','expired'];
if(in_array($state,$failures)){
$result = ['type'=>'error'];
}else{
$result = ['type'=>'success'];
$this->finished = true;
}
return $result;
【问题讨论】:
-
谢谢,但它仍然没有告诉我
Payment::execute()的输出是什么。