Skip to content

Commit

Permalink
Add params to doRefund
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Oct 25, 2019
1 parent 2795a50 commit c3b4d86
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion CRM/Core/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,19 @@ public function doPayment(&$params, $component = 'contribute') {
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
public function doRefund($params) {
return [];
// Mandatory Params:
// trxn_id: The transaction ID that the payment processor uses to identify the payment to refund.
// amount: The amount to refund (eg. 12.05). This should always be specified in "dot" notation with no currency symbol.
return [
// refund_status_id would normally return the contribution_status_id Completed or Failed
'refund_status_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'),
// The refund trxn_id may be different from the trxn_id of the original payment.
// If it is the same then trxn_id should be copied to refund_trxn_id
'refund_trxn_id' => NULL,
// Array of params returned by the payment processor. The contents of this will vary by processor and should not be relied on.
// However, they can be very useful for logging or providing specific feedback.
'processor_result' => [],
];
}

/**
Expand Down

0 comments on commit c3b4d86

Please sign in to comment.