Skip to content

Commit a460bbe

Browse files
authored
Merge pull request #337 from rossmannpaul78/rossmannpaul78-ach-refunds-patch
Update Payments.php to support ACH Refunds
2 parents a25950e + 647222a commit a460bbe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

QuickBooks/Payments.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ class Quickbooks_Payments
8282
const URL_ECHECK = '/quickbooks/v4/payments/echecks';
8383
const URL_REFUND = '/quickbooks/v4/payments/charges/<id>/refunds';
8484

85+
const URL_ECHECK_REFUND = '/quickbooks/v4/payments/echecks/<echeck_id>/refunds';
86+
8587
const BASE_SANDBOX = 'https://sandbox.api.intuit.com';
8688
const BASE_PRODUCTION = 'https://api.intuit.com';
8789

@@ -368,6 +370,11 @@ public function refund($Context, $id, $amount, $context = array())
368370
{
369371
$url = str_replace('<id>', $id, QuickBooks_Payments::URL_REFUND);
370372

373+
if ($context['is_ach_refund'])
374+
{
375+
$url = str_replace('<echeck_id>', $id, QuickBooks_Payments::URL_ECHECK_REFUND);
376+
}
377+
371378
$payload = array(
372379
'amount' => $amount,
373380
'context' => array(

0 commit comments

Comments
 (0)