I am using BrainTree sandbox account. I am using marketplace and perform following sale method from api. I hold the transaction in escrow and try to release but i fail to do so. Anyone has experience in BrainTree Marketplace?
Following are the parameter i am passing:
Braintree_Transaction::sale(
[
'amount' => 10,
'merchantAccountId' => SubMerchantID,
'paymentMethodNonce' => nonceFromTheClient,
'options' => array(
'submitForSettlement' => true,
'holdInEscrow' => true
),
'serviceFeeAmount' => 2
)
];
I want to hold transaction in Escrow. The above sale is successfully done but i can not release transaction from Escrow. (I need help in this)
I have used below code to release payment :-
Braintree_Transaction::releaseFromEscrow($userdata->transaction_id);
When i try to release transaction i got following error: "Cannot release a transaction that is not escrowed."
I find transaction details by Braintree_Transaction find method and it shows all the details about transaction and escrowStatus is hold_pending.
I get to know from documentation that I need to change status to "Held". But I am not sure how ?
I am sure that escrowStatus is cause this problem.
Now what to do to release transaction from escrow?
Please let me know if i am doing wrong.