我正在尝试使用 payum 解决方案将贝宝结帐集成到我的网站。
第 1 步:付款页面,通过验证触发重定向到贝宝:OK 第 2 步:用户使用他的凭据登录并授权付款:OK
第 3 步:用户使用正确的令牌正确重定向到我的 doneAction。令牌状态为“已捕获”:OK
第 4 步:我不知道下一步该做什么来验证付款。我知道我必须验证付款,但是如何?
下面,有我的 doneAction 基于 payum doc :
public function doneAction(Request $request){
$token = $this->get('payum.security.http_request_verifier')->verify($request);
$gateway = $this->get('payum')->getGateway($token->getGatewayName());
$gateway->execute($status = new GetHumanStatus($token));
//die(dump($status->isCaptured()));
$payment = $status->getFirstModel();
if ($status->isCaptured()) {
// What to do here
}
return new JsonResponse(array(
'status' => $status->getValue(),
'payment' => array(
'total_amount' => $payment->getTotalAmount(),
'currency_code' => $payment->getCurrencyCode(),
'details' => $payment->getDetails(),
),
));
}
谢谢阅读。