Skip to content

Latest commit

 

History

History
280 lines (219 loc) · 9.08 KB

AlipayOpenMiniQrcodeApi.md

File metadata and controls

280 lines (219 loc) · 9.08 KB

AlipaySDKNet.OpenAPI.Api.AlipayOpenMiniQrcodeApi

All URIs are relative to https://openapi.alipay.com

Method HTTP request Description
Bind POST /v3/alipay/open/mini/qrcode/bind 关联普通二维码
Query GET /v3/alipay/open/mini/qrcode/query 查询普通二维码
Unbind POST /v3/alipay/open/mini/qrcode/unbind 删除已关联普通二维码

Bind

AlipayOpenMiniQrcodeBindResponseModel Bind (AlipayOpenMiniQrcodeBindModel alipayOpenMiniQrcodeBindModel = null)

关联普通二维码

商户可不需更换线下二维码,通过该接口完成配置后,用户用支付宝扫描普通二维码时打开小程序并跳转到指定页面,普通二维码关联小程序最多可设置20条规则。

Example

using System.Collections.Generic;
using System.Diagnostics;
using AlipaySDKNet.OpenAPI.Api;
using AlipaySDKNet.OpenAPI.Client;
using AlipaySDKNet.OpenAPI.Model;
using AlipaySDKNet.OpenAPI.Util;
using AlipaySDKNet.OpenAPI.Util.Model;

namespace Example
{
    public class BindExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://openapi.alipay.com";
            var apiInstance = new AlipayOpenMiniQrcodeApi(config);

            // 设置alipayConfig参数
            AlipayConfig alipayConfig = new AlipayConfig();
            alipayConfig.AppId = "app_id";
            alipayConfig.PrivateKey = "private_key";
            // 密钥模式
            alipayConfig.AlipayPublicKey = "alipay_public_key";
            // 证书模式
            // alipayConfig.AppCertPath = "../appCertPublicKey.crt";
            // alipayConfig.AlipayPublicCertPath = "../alipayCertPublicKey_RSA2.crt";
            // alipayConfig.RootCertPath = "../alipayRootCert.crt";
            alipayConfig.EncryptKey = "encrypt_key";
            AlipayConfigUtil alipayConfigUtil = new AlipayConfigUtil(alipayConfig);
            apiInstance.Client.SetAlipayConfigUtil(alipayConfigUtil);

            var alipayOpenMiniQrcodeBindModel = new AlipayOpenMiniQrcodeBindModel(); // AlipayOpenMiniQrcodeBindModel |  (optional) 

            try
            {
                // 关联普通二维码
                AlipayOpenMiniQrcodeBindResponseModel result = apiInstance.Bind(alipayOpenMiniQrcodeBindModel);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AlipayOpenMiniQrcodeApi.Bind: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
alipayOpenMiniQrcodeBindModel AlipayOpenMiniQrcodeBindModel [optional]

Return type

AlipayOpenMiniQrcodeBindResponseModel

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 common response -
0 请求失败 -

[Back to top] [Back to API list] [Back to README]

Query

AlipayOpenMiniQrcodeQueryResponseModel Query (int? pageNo = null, int? pageSize = null)

查询普通二维码

通过appId查询商户关联的普通二维码路由信息

Example

using System.Collections.Generic;
using System.Diagnostics;
using AlipaySDKNet.OpenAPI.Api;
using AlipaySDKNet.OpenAPI.Client;
using AlipaySDKNet.OpenAPI.Model;
using AlipaySDKNet.OpenAPI.Util;
using AlipaySDKNet.OpenAPI.Util.Model;

namespace Example
{
    public class QueryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://openapi.alipay.com";
            var apiInstance = new AlipayOpenMiniQrcodeApi(config);

            // 设置alipayConfig参数
            AlipayConfig alipayConfig = new AlipayConfig();
            alipayConfig.AppId = "app_id";
            alipayConfig.PrivateKey = "private_key";
            // 密钥模式
            alipayConfig.AlipayPublicKey = "alipay_public_key";
            // 证书模式
            // alipayConfig.AppCertPath = "../appCertPublicKey.crt";
            // alipayConfig.AlipayPublicCertPath = "../alipayCertPublicKey_RSA2.crt";
            // alipayConfig.RootCertPath = "../alipayRootCert.crt";
            alipayConfig.EncryptKey = "encrypt_key";
            AlipayConfigUtil alipayConfigUtil = new AlipayConfigUtil(alipayConfig);
            apiInstance.Client.SetAlipayConfigUtil(alipayConfigUtil);

            var pageNo = 1;  // int? | 页码 (optional) 
            var pageSize = 10;  // int? | 每页条数,最大为10 (optional) 

            try
            {
                // 查询普通二维码
                AlipayOpenMiniQrcodeQueryResponseModel result = apiInstance.Query(pageNo, pageSize);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AlipayOpenMiniQrcodeApi.Query: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
pageNo int? 页码 [optional]
pageSize int? 每页条数,最大为10 [optional]

Return type

AlipayOpenMiniQrcodeQueryResponseModel

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 common response -
0 请求失败 -

[Back to top] [Back to API list] [Back to README]

Unbind

Object Unbind (AlipayOpenMiniQrcodeUnbindModel alipayOpenMiniQrcodeUnbindModel = null)

删除已关联普通二维码

删除已关联普通二维码

Example

using System.Collections.Generic;
using System.Diagnostics;
using AlipaySDKNet.OpenAPI.Api;
using AlipaySDKNet.OpenAPI.Client;
using AlipaySDKNet.OpenAPI.Model;
using AlipaySDKNet.OpenAPI.Util;
using AlipaySDKNet.OpenAPI.Util.Model;

namespace Example
{
    public class UnbindExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://openapi.alipay.com";
            var apiInstance = new AlipayOpenMiniQrcodeApi(config);

            // 设置alipayConfig参数
            AlipayConfig alipayConfig = new AlipayConfig();
            alipayConfig.AppId = "app_id";
            alipayConfig.PrivateKey = "private_key";
            // 密钥模式
            alipayConfig.AlipayPublicKey = "alipay_public_key";
            // 证书模式
            // alipayConfig.AppCertPath = "../appCertPublicKey.crt";
            // alipayConfig.AlipayPublicCertPath = "../alipayCertPublicKey_RSA2.crt";
            // alipayConfig.RootCertPath = "../alipayRootCert.crt";
            alipayConfig.EncryptKey = "encrypt_key";
            AlipayConfigUtil alipayConfigUtil = new AlipayConfigUtil(alipayConfig);
            apiInstance.Client.SetAlipayConfigUtil(alipayConfigUtil);

            var alipayOpenMiniQrcodeUnbindModel = new AlipayOpenMiniQrcodeUnbindModel(); // AlipayOpenMiniQrcodeUnbindModel |  (optional) 

            try
            {
                // 删除已关联普通二维码
                Object result = apiInstance.Unbind(alipayOpenMiniQrcodeUnbindModel);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AlipayOpenMiniQrcodeApi.Unbind: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
alipayOpenMiniQrcodeUnbindModel AlipayOpenMiniQrcodeUnbindModel [optional]

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 common response -
0 请求失败 -

[Back to top] [Back to API list] [Back to README]