eWay 支付网关 定期支付
eWay payment Gateway Recurring payment
如何查看eway的当前交易以及如果付款成功如何更新我的过期日期和时间。
有没有查看eway最近交易的功能
$requestbody = array(
'RebillCustomerID' => $rebillCustomerID,
'RebillID' => $rebillID
);
$client = $this->createObjet();
return $result = $client->QueryTransactions($requestbody);
我用这个,但在 return 所有交易细节。
如果还有其他选择,请帮助我。
没有 API 到 return 只有最近的 eWAY 经常性交易。您可以通过查找任何非 "Pending" 或 "Future".
的交易的最近交易时间来找到当前交易
一个简单的例子如下:
$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;
}
如何查看eway的当前交易以及如果付款成功如何更新我的过期日期和时间。
有没有查看eway最近交易的功能
$requestbody = array(
'RebillCustomerID' => $rebillCustomerID,
'RebillID' => $rebillID
);
$client = $this->createObjet();
return $result = $client->QueryTransactions($requestbody);
我用这个,但在 return 所有交易细节。 如果还有其他选择,请帮助我。
没有 API 到 return 只有最近的 eWAY 经常性交易。您可以通过查找任何非 "Pending" 或 "Future".
的交易的最近交易时间来找到当前交易一个简单的例子如下:
$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;
}