支付模块
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

28 rindas
1.1 KiB

  1. package adapay
  2. import (
  3. "strings"
  4. adapayCore "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/lib/adapay-sdk/adapay-core"
  5. )
  6. type refundInterface interface {
  7. Create(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error)
  8. Query(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error)
  9. }
  10. type Refund struct {
  11. *Adapay
  12. }
  13. func (r *Refund) Create(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error) {
  14. reqUrl := BASE_URL + strings.Replace(REFUND_CREATE, "{payment_id}", adapayCore.ToString(reqParam["payment_id"]), -1)
  15. return adapayCore.RequestAdaPay(reqUrl, adapayCore.POST, reqParam, r.HandleConfig(multiMerchConfigId...))
  16. }
  17. func (r *Refund) Query(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error) {
  18. reqUrl := BASE_URL + REFUND_QUERY
  19. return adapayCore.RequestAdaPay(reqUrl, adapayCore.GET, reqParam, r.HandleConfig(multiMerchConfigId...))
  20. }