如何检查eway所做的当前事务,以及如果付款成功,如何更新我的到期日期和时间。
是否有任何功能可以检查eway最近进行的事务。
$requestbody = array(
'RebillCustomerID' => $rebillCustomerID,
'RebillID' => $rebillID
);
$client = $this->createObjet();
return $result = $client->QueryTransactions($requestbody);我使用这个,但作为回报,所有的交易细节。如果有其他选择,请帮助我。
发布于 2016-03-03 22:30:33
没有一个API只返回使用eWAY循环的最近的事务。您可以通过查找任何不是“未决”或“未来”的事务的最新事务时间来查找当前事务。
这样做的一个快速例子如下:
$requestbody = array(
'RebillCustomerID' => $rebillCustomerID,
'RebillID' => $rebillID
);
$result = $client->QueryTransactions($requestbody);
$current = mostRecent($result);
function mostRecent ($result){
$return = '';
foreach ($result->QueryTransactionsResult->rebillTransaction as $r) {
$mostRecent = 0;
if ($r->Status != 'Pending' && $r->Status != 'Future') {
$curDate = strtotime($r->TransactionDate);
if ($curDate > $mostRecent) {
$mostRecent = $curDate;
$return = $r;
}
}
}
return $return;
}https://stackoverflow.com/questions/35766876
复制相似问题