Browse Source

增加转账接口

master
wuliangbo 5 years ago
parent
commit
9cc13c2726
  1. 7
      src/Payment/Fund/Client.php
  2. 6
      src/Payment/Model/AlipayFundTransUniTransferContentBuilder.php

7
src/Payment/Fund/Client.php

@ -24,6 +24,8 @@ class Client extends AppClient
$contentBuilder->setOutBizNo($payload['out_biz_no']); $contentBuilder->setOutBizNo($payload['out_biz_no']);
$contentBuilder->setTransAmount($payload['trans_amount']); $contentBuilder->setTransAmount($payload['trans_amount']);
$contentBuilder->setIdentity($payload['identity']); $contentBuilder->setIdentity($payload['identity']);
$productCode = $payload['product_code'] ?? 'TRANS_ACCOUNT_NO_PWD';
$contentBuilder->setProductCode($productCode);
if (isset($payload['identity_type'])) { if (isset($payload['identity_type'])) {
$contentBuilder->setIdentity($payload['identity_type']); $contentBuilder->setIdentity($payload['identity_type']);
} }
@ -33,9 +35,8 @@ class Client extends AppClient
if (isset($payload['remark'])) { if (isset($payload['remark'])) {
$contentBuilder->setRemark($payload['remark']); $contentBuilder->setRemark($payload['remark']);
} }
if (isset($payload['biz_scene'])) { $bizScene = $payload['biz_scene'] ?? 'DIRECT_TRANSFER';
$contentBuilder->setBizScene($payload['biz_scene']); $contentBuilder->setBizScene($bizScene);
}
if (isset($payload['order_title'])) { if (isset($payload['order_title'])) {
$contentBuilder->setOrderTitle($payload['order_title']); $contentBuilder->setOrderTitle($payload['order_title']);
} }

6
src/Payment/Model/AlipayFundTransUniTransferContentBuilder.php

@ -161,4 +161,10 @@ class AlipayFundTransUniTransferContentBuilder extends BaseContentBuilder
$this->businessParams = $businessParams; $this->businessParams = $businessParams;
$this->bizContentarr['business_params'] = $businessParams; $this->bizContentarr['business_params'] = $businessParams;
} }
public function setProductCode($productCode = 'TRANS_ACCOUNT_NO_PWD')
{
$this->productCode = $productCode;
$this->bizContentarr['product_code'] = $productCode;
}
} }
Loading…
Cancel
Save