Braintree marketplace - What happens if Master Merchant do charge client at time time of sale, but has to pay to submerchant

試著忘記壹切 提交于 2019-12-11 11:53:12

问题


I have implemented PHP braintree API in a project, I want to use Marketplace api for the same.

Now, we have promotional events and we do not charge client, but we have to pay amount to sub-merchant who has delivered goods.

So below is the code to add service fees, which is clear that at the time of sale we have to add sub-merchant id for merchantAccountId, amount will be payment charged from client, what is paymentMethodNonce?

$result = Braintree_Transaction::sale(array(
  'merchantAccountId' => 'provider_sub_merchant_account',
  'amount' => '10.00',
  'paymentMethodNonce' => 'nonce-from-the-client',
  'serviceFeeAmount' => "1.00"
));

Another query is, at the time of sale we have to pass credit card details of the client? What if client is already in vault ? Below is another code from Braintree document with creditCard details

$result = Braintree_Transaction::sale(
  array(
    'amount' => "100",
    'merchantAccountId' => "blue_ladders_store",
    'creditCard' => array(
      'number' => "4111111111111111",
      'expirationDate' => "12/20",
    ),
    'options' => array(
      'submitForSettlement' => true,
      'holdInEscrow' => true,
    ),
    'serviceFeeAmount' => "10.00"
  )
);

If we do not add creditCard number and have to pay sub-merchant then how can that be done.

Thanks

来源:https://stackoverflow.com/questions/28714871/braintree-marketplace-what-happens-if-master-merchant-do-charge-client-at-time

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