From 708af24434a8613a0e893bef96ab479291b09293 Mon Sep 17 00:00:00 2001 From: Robert Cooper Date: Wed, 2 Mar 2022 13:26:42 -0500 Subject: [PATCH] authnet missing refund data (#212) * add phonenumber + email authnet * fix tests * add invoicenumber to authnet --- gateways/authorizenet/request_builders.go | 3 +++ gateways/authorizenet/request_builders_test.go | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/gateways/authorizenet/request_builders.go b/gateways/authorizenet/request_builders.go index 0dcc23a8..887659d2 100644 --- a/gateways/authorizenet/request_builders.go +++ b/gateways/authorizenet/request_builders.go @@ -106,6 +106,9 @@ func buildRefundRequest(merchantName string, transactionKey string, refundReques ExpirationDate: expirationDateXXXX, }, }, + Order: &Order{ + InvoiceNumber: common.SafeStr(refundRequest.MerchantOrderReference), + }, }, }, } diff --git a/gateways/authorizenet/request_builders_test.go b/gateways/authorizenet/request_builders_test.go index 0907748d..0fb2d1ac 100644 --- a/gateways/authorizenet/request_builders_test.go +++ b/gateways/authorizenet/request_builders_test.go @@ -303,6 +303,9 @@ func TestBuildRefundRequest(t *testing.T) { t.Run("With Valid Requests", func(t *testing.T) { base := sleet_testing.BaseRefundRequest() + MerchantOrderReference := "543321" + + base.MerchantOrderReference = &MerchantOrderReference amount := "1.00" cases := []struct { @@ -326,6 +329,9 @@ func TestBuildRefundRequest(t *testing.T) { ExpirationDate: expirationDateXXXX, }, }, + Order: &Order{ + InvoiceNumber: MerchantOrderReference, + }, }, }, },