2017-10-08 99 views
1

我一直在PHP中實施braintree +託管資金。Braintree + esrow撥款

我一直在使用Braintree PHP代碼。

代碼完美地工作,我可以在我的braintree沙箱儀表板中看到交易。

但前面一步我想集成託管資金,這是行不通的。下面是代碼示例。

require_once "braintree-php/lib/Braintree.php"; 
Braintree_Configuration::environment("sandbox"); 
Braintree_Configuration::merchantId("merchantID"); 
Braintree_Configuration::publicKey("public-key"); 
Braintree_Configuration::privateKey("private-key"); 


$result = Braintree_Transaction::sale(
    [ 
'amount' => '100.00', 
'merchantAccountId' => 'abc', 
'creditCard' => [ 
    'number' => '378282246310005', 
     'expirationDate' => '12/18' 
], 
'options' => [ 
     'submitForSettlement' => true, 
     'holdInEscrow' => true, 
    ], 
    'serviceFeeAmount' => "10.00" 
    ] 

); 
if ($result->success) { 
echo '<pre>'; 
print_r("success!: " . $result->transaction->id); 
print_r("success!: " . $result->transaction->escrowStatus); 
print_r($result->transaction->serviceFeeAmount); 
$escow = Braintree_Transaction::holdInEscrow($result->transaction->id); 
} else if ($result->transaction) { 
print_r("Error processing transaction:"); 
print_r("\n code: " . $result->transaction->processorResponseCode); 
print_r("\n text: " . $result->transaction->processorResponseText); 
} else { 
echo '<pre>'; 
print_r("Validation errors: \n"); 

print_r($result->errors->deepAll()); 
} 

它給了我下面的錯誤。

1) Service fee not supported on master merchant account. 
2) Transaction could not be held in escrow. 

我已經通過選擇USA作爲國家創建了沙箱帳戶。任何人可以幫助我如何在Braintree付款期間實現託管資金,以及我在代碼中做錯了什麼。

我已經從下面的鏈接代碼成功創建子商家。

On boarding Sub-merchants

回答

0

全面披露:我在布倫特裏工作。如果您還有其他問題,請隨時聯繫 support

我能夠找到您的沙盒帳戶,看起來您註冊了一個沙盒帳戶,並指出印度是您的業務所在地,這就是您收到這些驗證錯誤的原因,因爲市場不是與美國以外的任何國家兼容。

爲了測試Marketplace功能,you'll need to sign up for a new Sandbox account,確保您選擇美國作爲您的國家/地區價值。

+0

感謝您的回覆...我已按照您的指示創建了另一個帳戶,並且當時我選擇了國家/地區作爲美國(您的公司位於哪裏?),因此我面臨同樣的問題。僅供參考,我可以從美國沙箱帳戶創建子商家。請引導我,我做錯了什麼?預先感謝您:) –

+0

請讓我知道,如果你有關它的更多細節。 –

+0

謝謝@AshPatel。您是否介意通過電子郵件發送到[email protected]以便我們獲得更多的細節信息?非常感激。 – ThinkAboutIt