Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 869
Haris ur Rehman Avatar asked Oct 27 '25 18:10

Haris ur Rehman


1 Answers

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.

like image 153
agf Avatar answered Oct 29 '25 08:10

agf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!