Skip to content

Latest commit

 

History

History
382 lines (302 loc) · 15.9 KB

AlipayUserAgreementApi.md

File metadata and controls

382 lines (302 loc) · 15.9 KB

AlipaySDKNet.OpenAPI.Api.AlipayUserAgreementApi

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

Method HTTP request Description
Migrate POST /v3/alipay/user/agreement/migrate 代扣协议迁移
Query GET /v3/alipay/user/agreement/query 支付宝个人代扣协议查询接口
Transfer POST /v3/alipay/user/agreement/transfer 协议由普通通用代扣协议产品转移到周期扣协议产品
Unsign POST /v3/alipay/user/agreement/unsign 支付宝个人代扣协议解约接口

Migrate

Object Migrate (AlipayUserAgreementMigrateModel alipayUserAgreementMigrateModel = 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 MigrateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://openapi.alipay.com";
            var apiInstance = new AlipayUserAgreementApi(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 alipayUserAgreementMigrateModel = new AlipayUserAgreementMigrateModel(); // AlipayUserAgreementMigrateModel |  (optional) 

            try
            {
                // 代扣协议迁移
                Object result = apiInstance.Migrate(alipayUserAgreementMigrateModel);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AlipayUserAgreementApi.Migrate: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
alipayUserAgreementMigrateModel AlipayUserAgreementMigrateModel [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]

Query

AlipayUserAgreementQueryResponseModel Query (string personalProductCode = null, string alipayUserId = null, string alipayOpenId = null, string alipayLogonId = null, string signScene = null, string externalAgreementNo = null, string thirdPartyType = null, string agreementNo = 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 QueryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://openapi.alipay.com";
            var apiInstance = new AlipayUserAgreementApi(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 personalProductCode = GENERAL_WITHHOLDING_P;  // string | 协议产品码,商户和支付宝签约时确定,商户可咨询技术支持。 (optional) 
            var alipayUserId = 2088101122675263;  // string | 用户的支付宝账号对应 的支付宝唯一用户号,以 2088 开头的 16 位纯数字 组成。 本参数与alipay_logon_id若都填写,则以本参数为准,优先级高于 alipay_logon_id。 (optional) 
            var alipayOpenId = 074a1CcTG1LelxKe4xQC0zgNdId0nxi95b5lsNpazWYoCo5;  // string | 用户的支付宝账号对应 的支付宝唯一用户号, 本参数与alipay_logon_id若都填写,则以本参数为准,优先级高于 alipay_logon_id。 (optional) 
            var alipayLogonId = abx@alitest.com;  // string | 用户的支付宝登录账号,支持邮箱或手机号码格式。本参数与alipay_open_id 或 alipay_user_id 同时填写,优先按照 alipay_open_id 或 alipay_user_id 处理。 (optional) 
            var signScene = INDUSTRY|MEDICAL;  // string | 签约场景码,该值需要与系统/页面签约接口调用时传入的值保持一 致。如:周期扣款场景与调用 alipay.user.agreement.page.sign(支付宝个人协议页面签约接口) 签约时的 sign_scene 相同。  注意:当传入商户签约号 external_agreement_no 时,该值不能为空或默认值 DEFAULT|DEFAULT。  (optional) 
            var externalAgreementNo = test;  // string | 代扣协议中标示用户的唯一签约号(确保在商户系统中 唯一)。 格式规则:支持大写小写字母和数字,最长 32 位。 (optional) 
            var thirdPartyType = PARTNER;  // string | 签约第三方主体类型。对于三方协议,表示当前用户和哪一类的第三方主体进行签约。 默认为PARTNER。 (optional) 
            var agreementNo = 20170322450983769228;  // string | 支付宝系统中用以唯一标识用户签约记录的编号(用户签约成功后的协议号 ) ,如果传了该参数,其他参数会被忽略 (optional) 

            try
            {
                // 支付宝个人代扣协议查询接口
                AlipayUserAgreementQueryResponseModel result = apiInstance.Query(personalProductCode, alipayUserId, alipayOpenId, alipayLogonId, signScene, externalAgreementNo, thirdPartyType, agreementNo);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AlipayUserAgreementApi.Query: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
personalProductCode string 协议产品码,商户和支付宝签约时确定,商户可咨询技术支持。 [optional]
alipayUserId string 用户的支付宝账号对应 的支付宝唯一用户号,以 2088 开头的 16 位纯数字 组成。 本参数与alipay_logon_id若都填写,则以本参数为准,优先级高于 alipay_logon_id。 [optional]
alipayOpenId string 用户的支付宝账号对应 的支付宝唯一用户号, 本参数与alipay_logon_id若都填写,则以本参数为准,优先级高于 alipay_logon_id。 [optional]
alipayLogonId string 用户的支付宝登录账号,支持邮箱或手机号码格式。本参数与alipay_open_id 或 alipay_user_id 同时填写,优先按照 alipay_open_id 或 alipay_user_id 处理。 [optional]
signScene string 签约场景码,该值需要与系统/页面签约接口调用时传入的值保持一 致。如:周期扣款场景与调用 alipay.user.agreement.page.sign(支付宝个人协议页面签约接口) 签约时的 sign_scene 相同。 注意:当传入商户签约号 external_agreement_no 时,该值不能为空或默认值 DEFAULT DEFAULT。
externalAgreementNo string 代扣协议中标示用户的唯一签约号(确保在商户系统中 唯一)。 格式规则:支持大写小写字母和数字,最长 32 位。 [optional]
thirdPartyType string 签约第三方主体类型。对于三方协议,表示当前用户和哪一类的第三方主体进行签约。 默认为PARTNER。 [optional]
agreementNo string 支付宝系统中用以唯一标识用户签约记录的编号(用户签约成功后的协议号 ) ,如果传了该参数,其他参数会被忽略 [optional]

Return type

AlipayUserAgreementQueryResponseModel

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]

Transfer

AlipayUserAgreementTransferResponseModel Transfer (AlipayUserAgreementTransferModel alipayUserAgreementTransferModel = 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 TransferExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://openapi.alipay.com";
            var apiInstance = new AlipayUserAgreementApi(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 alipayUserAgreementTransferModel = new AlipayUserAgreementTransferModel(); // AlipayUserAgreementTransferModel |  (optional) 

            try
            {
                // 协议由普通通用代扣协议产品转移到周期扣协议产品
                AlipayUserAgreementTransferResponseModel result = apiInstance.Transfer(alipayUserAgreementTransferModel);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AlipayUserAgreementApi.Transfer: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
alipayUserAgreementTransferModel AlipayUserAgreementTransferModel [optional]

Return type

AlipayUserAgreementTransferResponseModel

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]

Unsign

Object Unsign (AlipayUserAgreementUnsignModel alipayUserAgreementUnsignModel = 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 UnsignExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://openapi.alipay.com";
            var apiInstance = new AlipayUserAgreementApi(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 alipayUserAgreementUnsignModel = new AlipayUserAgreementUnsignModel(); // AlipayUserAgreementUnsignModel |  (optional) 

            try
            {
                // 支付宝个人代扣协议解约接口
                Object result = apiInstance.Unsign(alipayUserAgreementUnsignModel);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AlipayUserAgreementApi.Unsign: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
alipayUserAgreementUnsignModel AlipayUserAgreementUnsignModel [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]