see paypal error

This commit is contained in:
tavo 2024-09-09 22:35:16 -06:00
parent ef2d670df4
commit 775cdc2c0f

View file

@ -152,6 +152,11 @@ func CreateOrder() (string, error) {
}
defer raw.Body.Close()
if raw.StatusCode != http.StatusOK {
body, _ := io.ReadAll(raw.Body)
return "", fmt.Errorf("PayPal API error: %s", string(body))
}
var response struct {
ID string `json:"id"`
}