api_qualification.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. //
  3. // 营销加价购对外API
  4. //
  5. // 指定服务商可通过该接口报名加价购活动、查询某个区域内的加价购活动列表、锁定加价活动购资格以及解锁加价购活动资格。
  6. //
  7. // API version: 1.4.0
  8. // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
  9. package retailstore
  10. import (
  11. "context"
  12. nethttp "net/http"
  13. neturl "net/url"
  14. "git.nanodreamtech.com/sg/wechatpay-go/core"
  15. "git.nanodreamtech.com/sg/wechatpay-go/core/consts"
  16. "git.nanodreamtech.com/sg/wechatpay-go/services"
  17. )
  18. type QualificationApiService services.Service
  19. // LockQualification 锁定品牌加价购活动资格
  20. //
  21. // 接口介绍:指定服务商仅能通过该接口锁定品牌加价购活动资格。品牌加价购活动资格被成功锁定后不能被其它订单使用,且成功锁定品牌加价购活动资格是微信支付系统对门店和服务商发放补贴资金的前置条件,否则微信支付系统不对门店和服务商发放补贴资金。品牌加价购活动资格被锁定后,如未被解锁,则不能被其它订单使用。
  22. // 使用对象:指定服务商。
  23. func (a *QualificationApiService) LockQualification(ctx context.Context, req LockQualificationRequest) (resp *LockQualificationResponse, result *core.APIResult, err error) {
  24. var (
  25. localVarHTTPMethod = nethttp.MethodPost
  26. localVarPostBody interface{}
  27. localVarQueryParams neturl.Values
  28. localVarHeaderParams = nethttp.Header{}
  29. )
  30. localVarPath := consts.WechatPayAPIServer + "/v3/marketing/goods-subsidy-activity/qualification/lock"
  31. // Make sure All Required Params are properly set
  32. // Setup Body Params
  33. localVarPostBody = req
  34. // Determine the Content-Type Header
  35. localVarHTTPContentTypes := []string{"application/json"}
  36. // Setup Content-Type
  37. localVarHTTPContentType := core.SelectHeaderContentType(localVarHTTPContentTypes)
  38. // Perform Http Request
  39. result, err = a.Client.Request(ctx, localVarHTTPMethod, localVarPath, localVarHeaderParams, localVarQueryParams, localVarPostBody, localVarHTTPContentType)
  40. if err != nil {
  41. return nil, result, err
  42. }
  43. // Extract LockQualificationResponse from Http Response
  44. resp = new(LockQualificationResponse)
  45. err = core.UnMarshalResponse(result.Response, resp)
  46. if err != nil {
  47. return nil, result, err
  48. }
  49. return resp, result, nil
  50. }
  51. // UnlockQualification 解锁品牌加价购活动资格
  52. //
  53. // 接口介绍:指定服务商仅能通过该接口解锁品牌加价购活动资格。商户调用微信支付下单接口失败或者在其它交易流程被阻断的场景下,如果此时品牌加价购活动资格已被当前订单锁定,需调用该接口解锁被锁定的品牌加价购活动资格,否则,如果被锁定的品牌加价购活动资格未被成功解锁,该品牌加价购活动资格无法被使用。
  54. // 使用对象:指定服务商。
  55. func (a *QualificationApiService) UnlockQualification(ctx context.Context, req UnlockQualificationRequest) (resp *UnlockQualificationResponse, result *core.APIResult, err error) {
  56. var (
  57. localVarHTTPMethod = nethttp.MethodPost
  58. localVarPostBody interface{}
  59. localVarQueryParams neturl.Values
  60. localVarHeaderParams = nethttp.Header{}
  61. )
  62. localVarPath := consts.WechatPayAPIServer + "/v3/marketing/goods-subsidy-activity/qualification/unlock"
  63. // Make sure All Required Params are properly set
  64. // Setup Body Params
  65. localVarPostBody = req
  66. // Determine the Content-Type Header
  67. localVarHTTPContentTypes := []string{"application/json"}
  68. // Setup Content-Type
  69. localVarHTTPContentType := core.SelectHeaderContentType(localVarHTTPContentTypes)
  70. // Perform Http Request
  71. result, err = a.Client.Request(ctx, localVarHTTPMethod, localVarPath, localVarHeaderParams, localVarQueryParams, localVarPostBody, localVarHTTPContentType)
  72. if err != nil {
  73. return nil, result, err
  74. }
  75. // Extract UnlockQualificationResponse from Http Response
  76. resp = new(UnlockQualificationResponse)
  77. err = core.UnMarshalResponse(result.Response, resp)
  78. if err != nil {
  79. return nil, result, err
  80. }
  81. return resp, result, nil
  82. }