How do I check the return of a Braintree transaction?

I'm trying to run Braintree transaction rollback tests, but I'm having a problem. The Braintree API allows you to issue refunds for transactions that have been settled. However, transactions created in a sandboxed environment are only "set" once every 24 hours. Therefore, when I try to return them in the test suite, the refund is always rejected because the original transaction was "dispatched by_ object" and not "set".

How to get around this?

+3


source to share


1 answer


I work at Braintree. If you have more questions, you can always contact our support team .

TestHelper in PHP Braintree library has a way to resolve a sandboxed transaction:



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);
        }

    . . .
}

      

Similar methods exist for other supported languages.

+4


source







All Articles