This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Authorize Net to support Google Pay Refunds (#257)
* Update Authorize Net to support Google Pay Refunds Update Authorize Net to support Google Pay Refunds. Authorize Net requires last 4 digits of credit card number for all refunds. We don't currently store this for auth.net Google Pay transactions, however we have the ability to fetch this from auth net via api(getTransactionDetails). This PR fetches the last4 from getTransactionDetails and populates the CC number in the refund request Related bug: https://app.asana.com/0/1200616417881435/1204243318709223/f Thread: https://boltpay.slack.com/archives/C03U3T92Y8Z/p1680433093558869 * Update authorizenet.go * Update authorizenet.go * Update types.go * Update types.go * Update types.go * Fix bugs * Update types.go * Update request_builders_test.go * Update authorizenet.go * Add unit tests * Add err * Why is this not working? * Add integration test * Update authorizenet.go * Update authorizenet.go * Update authorizenet_test.go * Update authorizenet_test.go * Update authorizenet_test.go
- Loading branch information
1 parent
ac0e98c
commit cce88d1
Showing
9 changed files
with
288 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
gateways/authorizenet/test_data/transactionDetailsErrorResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"messages": { | ||
"resultCode": "Error", | ||
"message": [ | ||
{ | ||
"code": "E00040", | ||
"text": "The record cannot be found." | ||
} | ||
] | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
gateways/authorizenet/test_data/transactionDetailsSuccessResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"transaction": { | ||
"transId": "40116993894", | ||
"submitTimeUTC": "2023-03-21T20:01:31.243Z", | ||
"submitTimeLocal": "2023-03-21T13:01:31.243", | ||
"transactionType": "authOnlyTransaction", | ||
"transactionStatus": "settledSuccessfully", | ||
"responseCode": 1, | ||
"responseReasonCode": 1, | ||
"responseReasonDescription": "Approval", | ||
"authCode": "6UBJKU", | ||
"AVSResponse": "Y", | ||
"cardCodeResponse": "P", | ||
"batch": { | ||
"batchId": "13855989", | ||
"settlementTimeUTC": "2023-03-22T03:40:34.663Z", | ||
"settlementTimeLocal": "2023-03-21T20:40:34.663", | ||
"settlementState": "settledSuccessfully" | ||
}, | ||
"order": { | ||
"invoiceNumber": "9006052827063014", | ||
"discountAmount": 0, | ||
"taxIsAfterDiscount": false | ||
}, | ||
"authAmount": 100.5, | ||
"settleAmount": 100.5, | ||
"taxExempt": false, | ||
"payment": { | ||
"creditCard": { | ||
"cardNumber": "XXXX1111", | ||
"expirationDate": "XXXX", | ||
"cardType": "Visa" | ||
} | ||
}, | ||
"customer": { | ||
"email": "[email protected]" | ||
}, | ||
"billTo": { | ||
"phoneNumber": "13126470579", | ||
"firstName": "Abhishek", | ||
"lastName": "Tidke", | ||
"address": "21150 N Tatum Blvd Apt 2088", | ||
"city": "Phoenix", | ||
"state": "Arizona", | ||
"zip": "85050", | ||
"country": "US" | ||
}, | ||
"shipTo": { | ||
"firstName": "Abhishek", | ||
"lastName": "Tidke", | ||
"address": "21150 N Tatum Blvd Apt 2088", | ||
"city": "Phoenix", | ||
"state": "Arizona", | ||
"zip": "85050", | ||
"country": "US" | ||
}, | ||
"recurringBilling": false, | ||
"customerIP": "70.176.143.138", | ||
"product": "Card Not Present", | ||
"marketType": "eCommerce", | ||
"networkTransId": "L49LOS1DVBGDNPKEVZG3NOG", | ||
"authorizationIndicator": "pre" | ||
}, | ||
"messages": { | ||
"resultCode": "Ok", | ||
"message": [ | ||
{ | ||
"code": "I00001", | ||
"text": "Successful." | ||
} | ||
] | ||
} | ||
} | ||
|
Oops, something went wrong.