App\Ninja\PaymentDrivers\BasePaymentDriver::refundDetails PHP Method

refundDetails() protected method

protected refundDetails ( $payment, $amount )
    protected function refundDetails($payment, $amount)
    {
        return ['amount' => $amount, 'transactionReference' => $payment->transaction_reference];
    }

Usage Example

 protected function refundDetails($payment, $amount)
 {
     $data = parent::refundDetails($payment, $amount);
     $data['refund_reason'] = 'Refund issued by merchant.';
     // WePay issues a full refund when no amount is set. If an amount is set, it will try
     // to issue a partial refund without refunding any fees. However, the Stripe driver
     // (but not the API) requires the amount parameter to be set no matter what.
     if ($data['amount'] == $payment->getCompletedAmount()) {
         unset($data['amount']);
     }
     return $data;
 }