Skip to content

Instantly share code, notes, and snippets.

@mertkahyaoglu
Created January 22, 2018 13:28
Show Gist options
  • Save mertkahyaoglu/74baba4494c4136baf6880d06e5481e2 to your computer and use it in GitHub Desktop.
Save mertkahyaoglu/74baba4494c4136baf6880d06e5481e2 to your computer and use it in GitHub Desktop.
type Request interface {
toPkiString() string
}
func prepareResponse(request Request, methodType string, endpoint string, options Options) string {
pkiString := request.toPkiString()
requestJson, _ := json.Marshal(request)
requestJson = string(requestJson)
response := connect(methodType, endpoint, options, requestJson, pkiString)
return response
}
func (approval Disapproval) Create(request CreateDisapprovalRequest, options Options) string {
response := prepareResponse(request, "POST", "/payment/iyzipos/item/disapprove", options)
return response
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment