Skip to content

Commit a18c8d5

Browse files
authored
Merge pull request AuthorizeNet#98 from truefusion/patch-1
Transaction ID required!
2 parents 5172f52 + 8efa59d commit a18c8d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PaymentTransactions/refund-transaction.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
define("AUTHORIZENET_LOG_FILE", "phplog");
77

8-
function refundTransaction($amount)
8+
function refundTransaction($refTransId, $amount)
99
{
1010
/* Create a merchantAuthenticationType object with authentication details
1111
retrieved from the constants file */
@@ -27,6 +27,7 @@ function refundTransaction($amount)
2727
$transactionRequest->setTransactionType( "refundTransaction");
2828
$transactionRequest->setAmount($amount);
2929
$transactionRequest->setPayment($paymentOne);
30+
$transactionRequest->setRefTransId($refTransId);
3031

3132

3233
$request = new AnetAPI\CreateTransactionRequest();
@@ -84,4 +85,4 @@ function refundTransaction($amount)
8485
}
8586
if(!defined('DONT_RUN_SAMPLES'))
8687
refundTransaction( \SampleCode\Constants::SAMPLE_AMOUNT_REFUND);
87-
?>
88+
?>

0 commit comments

Comments
 (0)