Documentation ¶
Index ¶
- Variables
- func Bool(v bool) *bool
- func CalculateChecksum(payload interface{}, prefix, suffix []byte) string
- func CurrentMode() string
- func Int(v int) *int
- func String(v string) *string
- func SwitchToLiveMode()
- func SwitchToTestMode()
- type Account
- type Bank
- type Card
- type ChargeRequest
- type ChargeResponse
- type ChargeValidationResponse
- type Chargeable
- type Customer
- type FlwMeta
- type ForexParams
- type ForexResponse
- type GetFeeRequest
- type GetFeeResponse
- type MobileMoneyGH
- type Mpesa
- type MpesaPaymentInfo
- type Payment
- type PreAuthResponse
- type RefundTxnResponse
- type TxnVerificationChecklist
- type TxnVerificationResponse
- func (resp *TxnVerificationResponse) VerifyAmount(amt int) error
- func (resp *TxnVerificationResponse) VerifyChargeResponseValue() error
- func (resp *TxnVerificationResponse) VerifyCurrency(currency string) error
- func (resp *TxnVerificationResponse) VerifyReference(ref string) error
- func (resp *TxnVerificationResponse) VerifyStatus() error
- type USSD
- type USSDPaymentInfo
- type Verifiable
- type XRQTxnVerificationResponse
- func (resp *XRQTxnVerificationResponse) VerifyAmount(amt int) error
- func (resp *XRQTxnVerificationResponse) VerifyChargeResponseValue() error
- func (resp *XRQTxnVerificationResponse) VerifyCurrency(currency string) error
- func (resp *XRQTxnVerificationResponse) VerifyReference(ref string) error
- func (resp *XRQTxnVerificationResponse) VerifyStatus() error
Constants ¶
This section is empty.
Variables ¶
var ( // PublicKey is your rave secret key PublicKey string // SecretKey is your rave secret key SecretKey string )
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CalculateChecksum ¶
CalculateChecksum implements rave's checksum integrity check for inline js https://flutterwavedevelopers.readme.io/docs/checksum To use with a payment payload, provide the payment object as the payload interface add the payment PBFPubKey and your secret key as byte prefix and suffix respectively
func CurrentMode ¶
func CurrentMode() string
CurrentMode returns the current mode of operation, live or test This actual variable itself, currentMode is not exposed to prevent direct (external) modification (external) modification should only be done via the helper methods below
func Int ¶
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
func String ¶
String is a helper routine that allocates a new string value to store v and returns a pointer to it.
func SwitchToLiveMode ¶
func SwitchToLiveMode()
SwitchToLiveMode changes to current operation mode to live Rave api requests in the live mode are made to the real live rave api servers and not the test servers
func SwitchToTestMode ¶
func SwitchToTestMode()
SwitchToTestMode changes to current operation mode to test Rave api requests in the live mode are made to the test rave api servers and not the live servers
Types ¶
type Account ¶
type Account struct { AccountBank string `json:"account_bank"` // TODO: account_bank vs accountbank AccountIsBlacklisted int `json:"account_is_blacklisted"` AccountNumber string `json:"account_number"` AccountToken struct { Token string `json:"token"` } `json:"account_token"` ChargeAccountURL string `json:"-"` ValidateAccountChargeURL string `json:"-"` Country string `json:"country"` CreatedAt string `json:"createdAt"` Currency string `json:"currency"` DeletedAt interface{} `json:"deletedAt"` FirstName string `json:"first_name"` ID int `json:"id"` LastName string `json:"last_name"` Passcode string `json:"passcode"` UpdatedAt string `json:"updatedAt"` }
Account is a type that encapsulates rave's account description It has all account attributes necessary for rave api card references It also implements the chargable interface required for making charge requests and validating them
func (*Account) BuildChargeRequestPayload ¶
func (a *Account) BuildChargeRequestPayload(creq *ChargeRequest) []byte
BuildChargeRequestPayload is an implemenation of the Chargeable interface it returns the byte representation of the charge request client at the ChargeRequest level, chargeables are merely interface objects so trying to compose a struct with an interface object results in go adding the interface name key to the result bytes see https://play.golang.com/p/MFfbuPLrjo6 so here we upend it so the individual concrete types do the marshalling
func (*Account) ChargeURL ¶
ChargeURL is an implemenation of the Chargeable interface it returns the url to be used for charging the given account
func (*Account) ValidateChargeURL ¶
ValidateChargeURL is an implemenation of the Chargeable interface it returns the url to be used for validating charge on the given account
type Bank ¶
type Bank struct { Code string `json:"bankcode"` Name string `json:"bankname"` Internetbanking bool `json:"internetbanking"` }
Bank is a type of rave bank resources
func ListBanks ¶
ListBanks returns list of banks from the rave api https://flutterwavedevelopers.readme.io/v1.0/reference#list-of-banks
type Card ¶
type Card struct { Brand string `json:"brand,omitempty"` CardBIN string `json:"cardBIN,omitempty"` CardNo string `json:"cardno"` CardTokens []struct { Embedtoken string `json:"embedtoken"` Shortcode string `json:"shortcode"` } `json:"card_tokens,omitempty"` ChargeCardURL string `json:"-"` Country string `json:"country"` Currency string `json:"currency"` Cvv string `json:"cvv"` Expirymonth string `json:"expirymonth"` Expiryyear string `json:"expiryyear"` FirstName string `json:"firstname,omitempty"` Last4digits string `json:"last4digits,omitempty"` LastName string `json:"lastname,omitempty"` Pin string `json:"pin"` ValidateCardChargeURL string `json:"-"` }
Card is a type that encapsulates rave's card description It has all card attributes necessary for rave api card references It also implements the chargable interface required for making charge requests and validating them
func (*Card) BuildChargeRequestPayload ¶
func (c *Card) BuildChargeRequestPayload(creq *ChargeRequest) []byte
BuildChargeRequestPayload is an implemenation of the Chargeable interface it returns the byte representation of the charge request client at the ChargeRequest level, chargeables are merely interface objects so trying to compose a struct with an interface object results in go adding the interface name key to the result bytes see https://play.golang.com/p/MFfbuPLrjo6 so here we upend it so the individual concrete types do the marshalling
func (*Card) ChargeURL ¶
ChargeURL is an implemenation of the Chargeable interface it returns the url to be used for charging the given card
func (*Card) ValidateChargeURL ¶
ValidateChargeURL is an implemenation of the Chargeable interface it returns the url to be used for charging the given card
type ChargeRequest ¶
type ChargeRequest struct { PBFPubKey string `json:"PBFPubKey"` Amount float64 `json:"amount"` ChargeType string `json:"charge_type"` DeviceFingerprint string `json:"device_fingerprint"` Email string `json:"email"` IP string `json:"IP"` TxRef string `json:"txRef"` PaymentType string `json:"payment_type"` PhoneNumber string `json:"phonenumber"` RedirectURL string `json:"redirect_url"` SuggestedAuth string `json:"suggested_auth"` }
ChargeRequest is a holds information necessary charging a given card it has a charge method defined on it that takes a card and proceeds to charge it with the given information
func (*ChargeRequest) Charge ¶
func (cr *ChargeRequest) Charge(chargeable Chargeable) (*ChargeResponse, error)
Charge makes the request to charge the given card it returns the response from the server
type ChargeResponse ¶
type ChargeResponse struct { Data chargeResponseData `json:"data"` Message string `json:"message"` Status string `json:"status"` ValidateChargeURL string `json:"-"` PBFPubKey string `json:"-"` }
ChargeResponse is a type of rave response to a charge card request
func CapturePreAuthPayment ¶
func CapturePreAuthPayment(ref string) (*ChargeResponse, error)
CapturePreAuthPayment makes request to rave's capture endpoint to claim preauth payments It takes the flwRef as param and returns the capture response and any error that occures https://flutterwavedevelopers.readme.io/v2.0/reference#capture
func (*ChargeResponse) OTPValidation ¶
func (cr *ChargeResponse) OTPValidation(otp string) (*ChargeValidationResponse, error)
OTPValidation handles the final part to a resource charge using the provided otp returns the server response
type ChargeValidationResponse ¶
type ChargeValidationResponse struct { Data struct { Data struct { Responsecode string `json:"responsecode"` Responsemessage string `json:"responsemessage"` } `json:"data"` Tx chargeResponseData `json:"tx"` } `json:"data"` Message string `json:"message"` Status string `json:"status"` }
ChargeValidationResponse is a type of the response from rave for charge validation request It's a hybrid of the response for both card and account validation requests
type Chargeable ¶
type Chargeable interface { ChargeURL() string ValidateChargeURL() string BuildChargeRequestPayload(*ChargeRequest) []byte }
Chargeable is an abstract representation for chargeable resources like cards and accounts
type Customer ¶
type Customer struct { AccountID int `json:"AccountId"` CreatedAt string `json:"createdAt"` Customertoken interface{} `json:"customertoken"` DeletedAt interface{} `json:"deletedAt"` Email string `json:"email"` FullName string `json:"fullName"` ID int `json:"id"` Phone interface{} `json:"phone"` UpdatedAt string `json:"updatedAt"` }
Customer is a type that encapsulates rave's customer description
type FlwMeta ¶
type FlwMeta struct { ACCOUNTVALIDATIONRESPMESSAGE interface{} `json:"ACCOUNTVALIDATIONRESPMESSAGE"` ACCOUNTVALIDATIONRESPONSECODE string `json:"ACCOUNTVALIDATIONRESPONSECODE"` VBVRESPONSECODE string `json:"VBVRESPONSECODE"` VBVRESPONSEMESSAGE string `json:"VBVRESPONSEMESSAGE"` ChargeResponse string `json:"chargeResponse"` ChargeResponseMessage string `json:"chargeResponseMessage"` }
FlwMeta ...
type ForexParams ¶
type ForexParams struct { Amount string `json:"amount"` OriginCurrency string `json:"origin_currency"` DestinationCurrency string `json:"destination_currency"` SecKey string `json:"SECKEY"` }
ForexParams type represents allowed params for querying rave's forex endpoint
type ForexResponse ¶
type ForexResponse struct { Data struct { ConvertedAmount int `json:"converted_amount"` Destinationcurrency string `json:"destinationcurrency"` Lastupdated string `json:"lastupdated"` OriginalAmount string `json:"original_amount"` Origincurrency string `json:"origincurrency"` Rate int `json:"rate"` } `json:"data"` Message string `json:"message"` Status string `json:"status"` }
ForexResponse is raves response for forex rate request
func ForexRate ¶
func ForexRate(fxp *ForexParams) (*ForexResponse, error)
ForexRate queries rave forex endpoint for the current rate of the currencies in the params it returns the request response and any error that occurs
type GetFeeRequest ¶
type GetFeeRequest struct { Amount string `json:"amount"` PBFPubKey string `json:"PBFPubKey"` Currency string `json:"currency"` PType string `json:"ptype,omitempty"` Card6 string `json:"card6,omitempty"` }
GetFeeRequest encapsulates the params need for requesting fee amount from the rave api https://flutterwavedevelopers.readme.io/v2.0/reference#get-fees
type GetFeeResponse ¶
type GetFeeResponse struct { Data struct { ChargeAmount string `json:"charge_amount"` Fee float64 `json:"fee"` Merchantfee string `json:"merchantfee"` Ravefee string `json:"ravefee"` } `json:"data"` Message string `json:"message"` Status string `json:"status"` }
GetFeeResponse is a type of rave's response to a get fee request
func GetFee ¶
func GetFee(p *GetFeeRequest) (*GetFeeResponse, error)
GetFee returns rave's fee response for the given get fee request it returns any error that occures
type MobileMoneyGH ¶
type MobileMoneyGH struct { ChargeRequestURL string `json:"-"` Currency string `json:"currency"` Country string `json:"country"` LastName string `json:"lastname,omitempty"` FirstName string `json:"firstname,omitempty"` IsMobileMoneyGH int `json:"is_mobile_money_gh"` Network string `json:"network"` }
MobileMoneyGH is a type that encapsulates rave's ghana mobile money description It has all mpesa attributes necessary for rave api ghana mobile money description references It also implements the chargable interface required for making charge requests and validating them
func (*MobileMoneyGH) BuildChargeRequestPayload ¶
func (gh *MobileMoneyGH) BuildChargeRequestPayload(cReq *ChargeRequest) []byte
BuildChargeRequestPayload is an implemenation of the Chargeable interface it returns the byte representation of the charge request client at the ChargeRequest level, chargeables are merely interface objects so trying to compose a struct with an interface object results in go adding the interface name key to the result bytes see https://play.golang.com/p/MFfbuPLrjo6 so here we upend it so the individual concrete types do the marshalling
func (*MobileMoneyGH) ChargeURL ¶
func (gh *MobileMoneyGH) ChargeURL() string
ChargeURL is an implemenation of the Chargeable interface it returns the url to be used for charging the given card
func (*MobileMoneyGH) ValidateChargeURL ¶
func (gh *MobileMoneyGH) ValidateChargeURL() string
ValidateChargeURL is an implemenation of the Chargeable interface it returns the url to be used for charging the given card
type Mpesa ¶
type Mpesa struct { ChargeMpesaURL string `json:"-"` Currency string `json:"currency"` Country string `json:"country"` LastName string `json:"lastname,omitempty"` FirstName string `json:"firstname,omitempty"` IsMpesa string `json:"is_mpesa,omitempty"` }
Mpesa is a type that encapsulates rave's mpesa description It has all mpesa attributes necessary for rave api mpesa references It also implements the chargable interface required for making charge requests and validating them
func (*Mpesa) BuildChargeRequestPayload ¶
func (m *Mpesa) BuildChargeRequestPayload(cReq *ChargeRequest) []byte
BuildChargeRequestPayload is an implemenation of the Chargeable interface it returns the byte representation of the charge request client at the ChargeRequest level, chargeables are merely interface objects so trying to compose a struct with an interface object results in go adding the interface name key to the result bytes see https://play.golang.com/p/MFfbuPLrjo6 so here we upend it so the individual concrete types do the marshalling
func (*Mpesa) ChargeURL ¶
ChargeURL is an implemenation of the Chargeable interface it returns the url to be used for charging the given card
func (*Mpesa) ValidateChargeURL ¶
ValidateChargeURL is an implemenation of the Chargeable interface it returns the url to be used for charging the given card
type MpesaPaymentInfo ¶
MpesaPaymentInfo is the information necessary for completing mpesa payment
func MpesaPaymentInstruction ¶
func MpesaPaymentInstruction(cr *ChargeResponse) *MpesaPaymentInfo
MpesaPaymentInstruction parses the given charge response and returns the payment info: business number and account number for completing the payment
type Payment ¶
type Payment struct { Amount int `json:"amount"` Country string `json:"country"` Currency string `json:"currency"` CustomDescription string `json:"custom_description"` CustomLogo string `json:"custom_logo"` CustomTitle string `json:"custom_title"` CustomerEmail string `json:"customer_email"` CustomerFirstname string `json:"customer_firstname"` CustomerLastname string `json:"customer_lastname"` CustomerPhone string `json:"customer_phone"` PaymentMethod string `json:"payment_method"` TxRef string `json:"txref"` }
Payment is a type that encapsulates rave's concept of payment together with PaymentVerfication it contains required implementations for interacting with the payment APIs
type PreAuthResponse ¶
type PreAuthResponse struct { Data struct { Data struct { AuthorizeID string `json:"authorizeId"` Avsresponsecode interface{} `json:"avsresponsecode"` Avsresponsemessage interface{} `json:"avsresponsemessage"` Otptransactionidentifier interface{} `json:"otptransactionidentifier"` Redirecturl interface{} `json:"redirecturl"` Responsecode string `json:"responsecode"` Responsehtml interface{} `json:"responsehtml"` Responsemessage string `json:"responsemessage"` Responsetoken interface{} `json:"responsetoken"` Transactionreference string `json:"transactionreference"` } `json:"data"` Status string `json:"status"` } `json:"data"` Message string `json:"message"` Status string `json:"status"` }
PreAuthResponse is a type of rave response for refund or void preauth payment response
func RefundPreAuthPayment ¶
func RefundPreAuthPayment(ref string) (*PreAuthResponse, error)
RefundPreAuthPayment fullfiles the raves preauth feature by refunding the preauthorized paymemnt It takes the flwRef and makes a request to refund the txn It returns the response and any error that occurs https://flutterwavedevelopers.readme.io/v2.0/reference#refund-or-void
func VoidPreAuthPayment ¶
func VoidPreAuthPayment(ref string) (*PreAuthResponse, error)
VoidPreAuthPayment fullfiles the raves preauth feature by voiding the preauthorized paymemnt It takes the flwRef and makes a request to void the txn It returns the response and any error that occurs https://flutterwavedevelopers.readme.io/v2.0/reference#refund-or-void
type RefundTxnResponse ¶
type RefundTxnResponse struct { Data struct { AccountID int `json:"AccountId"` AmountRefunded int `json:"AmountRefunded"` FlwRef string `json:"FlwRef"` TransactionID int `json:"TransactionId"` CreatedAt string `json:"createdAt"` ID int `json:"id"` Status string `json:"status"` UpdatedAt string `json:"updatedAt"` WalletID int `json:"walletId"` } `json:"data"` Message string `json:"message"` Status string `json:"status"` }
RefundTxnResponse is rave's response for refund txn request
func Refund ¶
func Refund(ref string) (*RefundTxnResponse, error)
Refund makes a refund request for txn with the given ref it returns rave's response and any error that occurs
type TxnVerificationChecklist ¶
type TxnVerificationChecklist struct { Amount int `json:"-"` FlwRef string `json:"flw_ref,omitempty"` // for some weird reason, this just had to be different from below Flwref string `json:"flwref,omitempty"` // for some weird reason, this just had to be different from above LastAttempt string `json:"last_attempt,omitempty"` Normalize string `json:"normalize"` OnlySuccessful string `json:"only_successful,omitempty"` VerificationURL string `json:"-"` SECKEY string `json:"SECKEY"` TransactionCurrency string `json:"-"` TxRef string `json:"tx_ref,omitempty"` // for some weird reason, this just had to be different from above Txref string `json:"txref,omitempty"` // for some weird reason, this just had to be different from below // Done tracks whether verification has been attempted. It starts out false for new objects and changes to true after #verify is called on the object Done bool `json:"-"` }
TxnVerificationChecklist encapsulates the payment verification process It includes details of the payment to verify and the verification response
func NewTxnVerificationChecklist ¶
func NewTxnVerificationChecklist(amount int, flwRef, currency string) *TxnVerificationChecklist
NewTxnVerificationChecklist returns a new paymentVerificationChecklist object with the given params
func NewXRQTxnVerificationChecklist ¶
func NewXRQTxnVerificationChecklist(amount int, flwRef, txRef, currency string) *TxnVerificationChecklist
NewXRQTxnVerificationChecklist returns a new paymentVerificationChecklist object with the given params It sets up the checklist to use the rave's xrequery transaction verification endpoint
func (*TxnVerificationChecklist) Verify ¶
func (tvc *TxnVerificationChecklist) Verify(v Verifiable) []error
Verify performs the rave's recommended verification check on the verifiable resource It returns an array of error for verfications that fail (if any) and marks the verification as Done
func (*TxnVerificationChecklist) VerifyTransaction ¶
func (tvc *TxnVerificationChecklist) VerifyTransaction() (*TxnVerificationResponse, []error)
VerifyTransaction sends a rave Transaction verfication request and then verfies the response It validates that verification checklist contains all the required information for making the request http://flw-pms-dev.eu-west-1.elasticbeanstalk.com/flwv3-pug/getpaidx/api/verify it also marks the verification as done If the verification URL is not set, it set's it to the default from config
func (*TxnVerificationChecklist) VerifyXRequeryTransaction ¶
func (tvc *TxnVerificationChecklist) VerifyXRequeryTransaction() (*XRQTxnVerificationResponse, []error)
VerifyXRequeryTransaction sends a rave XRequery transaction verification request and then verifies the response It validates that verification checklist contains all the required information for making the request it also marks the verification as done https://flutterwavedevelopers.readme.io/v1.0/reference#xrequery-transaction-verification If the verification URL is not set, it set's it to the default from config
type TxnVerificationResponse ¶
type TxnVerificationResponse struct { Data txnVerificationResponseData `json:"data"` Message string `json:"message"` Status string `json:"status"` }
TxnVerificationResponse is a type of rave response for transaction verification request it implements the verifiable interface to allow rave's recommended followup verification
func (*TxnVerificationResponse) VerifyAmount ¶
func (resp *TxnVerificationResponse) VerifyAmount(amt int) error
VerifyAmount verifies that the given amount matches that in the transaction returns error otherwise
func (*TxnVerificationResponse) VerifyChargeResponseValue ¶
func (resp *TxnVerificationResponse) VerifyChargeResponseValue() error
VerifyChargeResponseValue verifies that the charge response value for the transaction is either '0' or '00'
func (*TxnVerificationResponse) VerifyCurrency ¶
func (resp *TxnVerificationResponse) VerifyCurrency(currency string) error
VerifyCurrency verifies that the currency in the txn verification matches the given currency returns error otherwise
func (*TxnVerificationResponse) VerifyReference ¶
func (resp *TxnVerificationResponse) VerifyReference(ref string) error
VerifyReference verifies that the flw ref in the transaction matches the given ref returns error otherwise
func (*TxnVerificationResponse) VerifyStatus ¶
func (resp *TxnVerificationResponse) VerifyStatus() error
VerifyStatus verifies that response status is success returns error otherwise
type USSD ¶
type USSD struct { AccountBank string `json:"accountbank"` // vs account_bank AccountNumber string `json:"accountnumber"` ChargeRequestURL string `json:"-"` ValidateCardChargeURL string `json:"-"` Country string `json:"country"` Currency string `json:"currency"` FirstName string `json:"firstname,omitempty"` LastName string `json:"lastname,omitempty"` IsUSSD string `json:"is_ussd,omitempty"` OrderRef string `json:"orderRef,omitempty"` }
USSD is a type that encapsulates rave's ussd description It has all ussd attributes necessary for rave api ussd referencess It also implements the chargable interface required for making charge requests
func (*USSD) BuildChargeRequestPayload ¶
func (c *USSD) BuildChargeRequestPayload(cReq *ChargeRequest) []byte
BuildChargeRequestPayload is an implemenation of the Chargeable interface it returns the byte representation of the charge request client at the ChargeRequest level, chargeables are merely interface objects so trying to compose a struct with an interface object results in go adding the interface name key to the result bytes see https://play.golang.com/p/MFfbuPLrjo6 so here we upend it so the individual concrete types do the marshalling
func (*USSD) ChargeURL ¶
ChargeURL is an implemenation of the Chargeable interface it returns the url to be used for charging the given card
func (*USSD) ValidateChargeURL ¶
ValidateChargeURL is an implemenation of the Chargeable interface it returns the url to be used for charging the given card
type USSDPaymentInfo ¶
USSDPaymentInfo is the information necessary for completing mpesa payment
func USSDPaymentInstruction ¶
func USSDPaymentInstruction(cr *ChargeResponse) *USSDPaymentInfo
USSDPaymentInstruction parses the given charge response and returns the payment info for completing the payment
type Verifiable ¶
type Verifiable interface { VerifyStatus() error VerifyCurrency(string) error VerifyAmount(int) error VerifyChargeResponseValue() error VerifyReference(string) error }
Verifiable is an abstract representation of any rave resources that can be verified verified here
type XRQTxnVerificationResponse ¶
type XRQTxnVerificationResponse struct { Data xRQTxnVerificationResponseData `json:"data"` Message string `json:"message"` Status string `json:"status"` }
XRQTxnVerificationResponse is a type of rave response for xrquery transaction verification request it implements the verifiable interface to allow rave's recommended followup verification
func (*XRQTxnVerificationResponse) VerifyAmount ¶
func (resp *XRQTxnVerificationResponse) VerifyAmount(amt int) error
VerifyAmount verifies that the given amount matches that in the transaction returns error otherwise
func (*XRQTxnVerificationResponse) VerifyChargeResponseValue ¶
func (resp *XRQTxnVerificationResponse) VerifyChargeResponseValue() error
VerifyChargeResponseValue verifies that the charge response value for the transaction is either '0' or '00'
func (*XRQTxnVerificationResponse) VerifyCurrency ¶
func (resp *XRQTxnVerificationResponse) VerifyCurrency(currency string) error
VerifyCurrency verifies that the currency in the txn verification matches the given currency returns error otherwise
func (*XRQTxnVerificationResponse) VerifyReference ¶
func (resp *XRQTxnVerificationResponse) VerifyReference(ref string) error
VerifyReference verifies that the flw ref in the transaction matches the given ref returns error otherwise
func (*XRQTxnVerificationResponse) VerifyStatus ¶
func (resp *XRQTxnVerificationResponse) VerifyStatus() error
VerifyStatus verifies that response status is success returns error otherwise