Skip to content

Commit

Permalink
Fix #509
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Oct 2, 2016
1 parent 633decf commit 01bc993
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Payment/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public function reverseByTransactionId($transactionId)
* @param float $refundFee
* @param string $opUserId
* @param string $type
* @param string $refundAccount
*
* @return \EasyWeChat\Support\Collection
*/
Expand All @@ -190,14 +191,16 @@ public function refund(
$totalFee,
$refundFee = null,
$opUserId = null,
$type = self::OUT_TRADE_NO
$type = self::OUT_TRADE_NO,
$refundAccount = 'REFUND_SOURCE_UNSETTLED_FUNDS'
) {
$params = [
$type => $orderNo,
'out_refund_no' => $refundNo,
'total_fee' => $totalFee,
'refund_fee' => $refundFee ?: $totalFee,
'refund_fee_type' => $this->merchant->fee_type,
'refund_account' => $refundAccount,
'op_user_id' => $opUserId ?: $this->merchant->merchant_id,
];

Expand All @@ -211,6 +214,7 @@ public function refund(
* @param float $totalFee
* @param float $refundFee
* @param string $opUserId
* @param string $refundAccount
*
* @return \EasyWeChat\Support\Collection
*/
Expand All @@ -219,9 +223,10 @@ public function refundByTransactionId(
$refundNo,
$totalFee,
$refundFee = null,
$opUserId = null
$opUserId = null,
$refundAccount = 'REFUND_SOURCE_UNSETTLED_FUNDS'
) {
return $this->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, self::TRANSACTION_ID);
return $this->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, self::TRANSACTION_ID, $refundAccount);
}

/**
Expand Down

0 comments on commit 01bc993

Please sign in to comment.