我还是有问题,当这个产品已经购买后,它应该进入第二次付款。不知道这是第一次付款还是第二次付款
public function _process(Invoice $invoice, Am_Mvc_Request $request, Am_Paysystem_Result $result)
{
if ((float)$invoice->first_total == 0) {
$invoice->addAccessPeriod(new Am_Paysystem_Transaction_Free($this));
$result->setAction(
new Am_Paysystem_Action_Redirect(
$this->getReturnUrl()));
return;
} else {
$res = $this->getPaymentParams($invoice);
if (!empty($res->statusCode) && $res->statusCode === "00") {
//FIRST PAYMENT NOT DETECTED
if ($invoice->isFirstPayment()) {
$a = new Am_Paysystem_Action_Redirect(REL_ROOT_URL . "/payment/" . $this->getId() . "/instructions?id=" . $invoice->getSecureId($this->getId()));
} else {
$a = new Am_Paysystem_Action_Redirect(REL_ROOT_URL . "/payment/" . $this->getId() . "/rebill?id=" . $invoice->getSecureId($this->getId()));
}
$result->setAction($a);
} else {
print_rr($res);
$result->setFailed('Connection Problem with DUITKU');
}
}
}