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 14, 2019
1 parent 8feafc5 commit f7cfa8b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions CRM/Core/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,20 @@ public function doPayment(&$params, $component = 'contribute') {
* @return array
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
public function doRefund(&$params) {
return [];
public function doRefund($params) {
// 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 f7cfa8b

Please sign in to comment.