Braintree - Why braintree transactions created via API, or via sandbox, take so much time before settled?

混江龙づ霸主 提交于 2019-11-30 18:56:29

问题


Whenever, I create a transaction via Braintree API, or via their sandbox, it goes through many statuses like Authorized, Submitted for Settlement, Settled ... and all this takes 24 hours approximately. I want to ask is there a way by which I can create a transaction in sandbox/api and it is settled or disputed instantly. I don't know why it takes so much time ... e.g. in online shopping my credit card is charged immediately. How can same be achieved via braintree payments sandbox ?


回答1:


I work at Braintree. It looks like we already responded to your support email, but I'll post this here for others who have the same problem.

Each client library has a method to instantly settle a transaction in Sandbox. For PHP, it's in the TestHelper:

class Braintree_TestHelper
{
    . . .

    public static function settle($transactionId)
        {
            $http = new Braintree_Http(Braintree_Configuration::$global);
            $path = Braintree_Configuration::$global->merchantPath() . '/transactions/' . $transactionId . '/settle';
            $http->put($path);
        }

    . . .
}

In production, any transaction that you run will generally show up as a charge on a credit card instantly, but it isn't "permanent" and the money won't actually move until the transaction has settled. In other words, even though settlement can take 24 hours, the charge doesn't take that long to show up on the card.



来源:https://stackoverflow.com/questions/29310096/braintree-why-braintree-transactions-created-via-api-or-via-sandbox-take-so

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!