Closed sanbornsen closed 3 years ago
I figured that the order create request is returning 400 in the SDK but the same request on curl is returning 200. What am I missing?
The documentation is incorrect, it should be receipt
and not receipt_id
in payload
data := map[string]interface{}{
"amount": amountInCents,
"currency": "INR",
"receipt": receiptID, // <-- here
"payment_capture": 1,
}
This is how my code look like
data := map[string]interface{}{
"amount": 1000,
"currency": "INR",
"receipt": receiptID,
"payment_capture": 1,
}
extraHeader := map[string]string{
"API_KEY": "SECRET_KEY",
}
body, err := client.Order.Create(data, extraHeader)
if err != nil {
log.Println(err)
}
I am getting this error when i create order with incorrect api key or secret key
%!v(PANIC=Error method: runtime error: invalid memory address or nil pointer dereference)
I want to know which type of error is returning
Same request on curl returning 401 response code
401 response code is the error for UnAuthorized error or Invalid Key & Permission Denied
This is how my code looks like
I am getting this error