Document tolerance, max_age_hours and payer_error
The API accepts per-call overrides for the underpayment limit ("25" = 25 ETB,
"1%" = one percent) and the receipt age limit (hours, 0 disables), and returns
payer_error alongside error. None of it was in this SDK.
payer_error is the payer-facing wording: show it to the customer, because error
is written for the merchant and can name their own saved accounts.
This commit is contained in:
@@ -50,6 +50,13 @@ type VerifyRequest struct {
|
|||||||
Amount float64 `json:"amount"`
|
Amount float64 `json:"amount"`
|
||||||
ReceiverName string `json:"receiver_name"`
|
ReceiverName string `json:"receiver_name"`
|
||||||
ReceiverAccount string `json:"receiver_account,omitempty"` // required for CBE & Abyssinia
|
ReceiverAccount string `json:"receiver_account,omitempty"` // required for CBE & Abyssinia
|
||||||
|
|
||||||
|
// Overrides the merchant's saved underpayment limit for this call only.
|
||||||
|
// "25" = 25 Birr, "1%" = one percent of Amount. Omit to use the saved setting.
|
||||||
|
Tolerance string `json:"tolerance,omitempty"`
|
||||||
|
// Overrides the saved receipt age limit for this call, in hours. 0 disables
|
||||||
|
// the age check for this call. Omit to use the saved setting.
|
||||||
|
MaxAgeHours *int `json:"max_age_hours,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// VerifyResult is the API response. Verification failures arrive here (Verified=false + Error set),
|
// VerifyResult is the API response. Verification failures arrive here (Verified=false + Error set),
|
||||||
@@ -83,6 +90,10 @@ type VerifyResult struct {
|
|||||||
// reference exists and the amount matches, but says nothing about who
|
// reference exists and the amount matches, but says nothing about who
|
||||||
// received the money).
|
// received the money).
|
||||||
ReceiverSource string `json:"receiver_source"`
|
ReceiverSource string `json:"receiver_source"`
|
||||||
|
// PayerError is the same failure written for the CUSTOMER to read. Show
|
||||||
|
// this to the payer, not Error: Error is written for the merchant and can
|
||||||
|
// name their own saved accounts. Empty when the payment verified.
|
||||||
|
PayerError string `json:"payer_error,omitempty"`
|
||||||
|
|
||||||
// Sandbox is true only on TEST-... responses.
|
// Sandbox is true only on TEST-... responses.
|
||||||
Sandbox bool `json:"sandbox"`
|
Sandbox bool `json:"sandbox"`
|
||||||
|
|||||||
Reference in New Issue
Block a user