Hi
I am processing Terminal Refund using Go SDK. All payments was done through card present but when I am getting below error when I am performing Terminal Refunds.
For all successful payment transaction, I am getting this error.
package exampleimport (
client "github.com/square/square-go-sdk/client"
option "github.com/square/square-go-sdk/option"
square "github.com/square/square-go-sdk"
context "context"
terminal "github.com/square/square-go-sdk/terminal"
)func do() () {
client := client.NewClient(
option.WithBaseURL(
square.Environments.Production,
),
option.WithToken(
"Etests",
),
)
client.Terminal.Refunds.Create(
context.TODO(),
&terminal.CreateTerminalRefundRequest{
IdempotencyKey: "cbe242fb-2425-4d37-86d7-0293fc7206bd",
Refund: &square.TerminalRefund{
DeviceID: "device:xxxxx",
PaymentID: "testY",
Reason: "Test",
AmountMoney: &square.Money{
Amount: square.Int64(
17,
),
Currency: square.CurrencyUsd.Ptr(),
},
},
},
)
}
{
“errors”: [
{
“code”: “BAD_REQUEST”,
“detail”: “Payment does not support card present refunds. Use the Refunds API to refund this payment. Refunds API - Square API Reference”,
“category”: “INVALID_REQUEST_ERROR”
}
]
}
what could be the issue ?