您如何在重复退款交易中获得 original_transaction_id
How do you get the original_transaction_id on a Recurly refund transaction
在PHP
中使用循环API
$transaction = Recurly_Transaction::get($uuid);
$transaction 变量没有像导出的交易 csv 中那样的 original_transaction_id 字段:
https://yoursubdomain.recurly.com/exports/new#transactions
如何通过 API 获得 original_transaction_id?
Github 已打开的问题:
https://github.com/recurly/recurly-client-php/issues/216
看起来 https://github.com/recurly/recurly-client-php/issues/216
正在讨论这个问题
::更新 8.2.2016::
他们在 PHP 客户端的版本 2.6.0 中添加了 original_transaction_id:
问题:https://github.com/recurly/recurly-client-php/issues/216#issuecomment-197558757
拉:https://github.com/recurly/recurly-client-php/pull/238
::结束更新 8.2.2016::
//::HACK:: Only works when there is 1 purchase transaction.
$all_account_transactions = Recurly_TransactionList::getForAccount($refund_transaction->details[0]->account_code);
foreach ($all_account_transactions as $account_transaction)
{
if($account_transaction->action=="purchase" &&
$account_transaction->subscription->get()->uuid == $refund_transaction->subscription->get()->uuid )
{
//This is a purchase transaction and its from the same subscription as the $refund_transaction.
//If there's only 1 purchase transaction then this is your transaction that was refunded.
//If there's multiple purchase transactions you'll have to figure out which one you want to apply the refund to
}
}
在PHP
中使用循环API$transaction = Recurly_Transaction::get($uuid);
$transaction 变量没有像导出的交易 csv 中那样的 original_transaction_id 字段:
https://yoursubdomain.recurly.com/exports/new#transactions
如何通过 API 获得 original_transaction_id?
Github 已打开的问题: https://github.com/recurly/recurly-client-php/issues/216
看起来 https://github.com/recurly/recurly-client-php/issues/216
正在讨论这个问题::更新 8.2.2016::
他们在 PHP 客户端的版本 2.6.0 中添加了 original_transaction_id:
问题:https://github.com/recurly/recurly-client-php/issues/216#issuecomment-197558757
拉:https://github.com/recurly/recurly-client-php/pull/238
::结束更新 8.2.2016::
//::HACK:: Only works when there is 1 purchase transaction.
$all_account_transactions = Recurly_TransactionList::getForAccount($refund_transaction->details[0]->account_code);
foreach ($all_account_transactions as $account_transaction)
{
if($account_transaction->action=="purchase" &&
$account_transaction->subscription->get()->uuid == $refund_transaction->subscription->get()->uuid )
{
//This is a purchase transaction and its from the same subscription as the $refund_transaction.
//If there's only 1 purchase transaction then this is your transaction that was refunded.
//If there's multiple purchase transactions you'll have to figure out which one you want to apply the refund to
}
}