Skip to content

Latest commit

 

History

History
224 lines (175 loc) · 7.69 KB

AlipayOpenAgentApi.md

File metadata and controls

224 lines (175 loc) · 7.69 KB

AlipayOpenAgentApi

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

Method HTTP request Description
cancel POST /v3/alipay/open/agent/cancel 取消代商户签约、创建应用事务
confirm POST /v3/alipay/open/agent/confirm 提交代商户签约、创建应用事务
create POST /v3/alipay/open/agent/create 开启代商户签约、创建应用事务

cancel

Object cancel(alipayOpenAgentCancelModel)

取消代商户签约、创建应用事务

取消代商户签约、创建应用事务

Example

// Import classes:
import com.alipay.v3.ApiClient;
import com.alipay.v3.ApiException;
import com.alipay.v3.Configuration;
import com.alipay.v3.util.*;
import com.alipay.v3.api.models.*;
import com.alipay.v3.api.AlipayOpenAgentApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://openapi.alipay.com");
    // 设置alipayConfig参数(全局设置一次)
    AlipayConfig config = new AlipayConfig();
    config.setAppId("app_id");
    config.setPrivateKey("private_key");
    config.setAlipayPublicKey("alipay_public_key");
    config.setEncryptKey("encrypt_key");
    defaultClient.setAlipayConfig(config);

    AlipayOpenAgentApi apiInstance = new AlipayOpenAgentApi(defaultClient);
    AlipayOpenAgentCancelModel alipayOpenAgentCancelModel = new AlipayOpenAgentCancelModel(); // AlipayOpenAgentCancelModel | 
    try {
      Object result = apiInstance.cancel(alipayOpenAgentCancelModel);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenAgentApi#cancel");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
alipayOpenAgentCancelModel AlipayOpenAgentCancelModel [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 请求失败 -

confirm

AlipayOpenAgentConfirmResponseModel confirm(alipayOpenAgentConfirmModel)

提交代商户签约、创建应用事务

提交事务。只允许提交init状态的事务,submit|cancel|timeout 状态的都是终态,不允许提交,且不允许提交空事务,需要先调用代创建小程序、代签约当面付等业务接口,再提交事务。服务市场订购及授权,使用订单授权凭证order_ticket开启的事务,提交后会有应用授权令牌返回。

Example

// Import classes:
import com.alipay.v3.ApiClient;
import com.alipay.v3.ApiException;
import com.alipay.v3.Configuration;
import com.alipay.v3.util.*;
import com.alipay.v3.api.models.*;
import com.alipay.v3.api.AlipayOpenAgentApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://openapi.alipay.com");
    // 设置alipayConfig参数(全局设置一次)
    AlipayConfig config = new AlipayConfig();
    config.setAppId("app_id");
    config.setPrivateKey("private_key");
    config.setAlipayPublicKey("alipay_public_key");
    config.setEncryptKey("encrypt_key");
    defaultClient.setAlipayConfig(config);

    AlipayOpenAgentApi apiInstance = new AlipayOpenAgentApi(defaultClient);
    AlipayOpenAgentConfirmModel alipayOpenAgentConfirmModel = new AlipayOpenAgentConfirmModel(); // AlipayOpenAgentConfirmModel | 
    try {
      AlipayOpenAgentConfirmResponseModel result = apiInstance.confirm(alipayOpenAgentConfirmModel);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenAgentApi#confirm");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
alipayOpenAgentConfirmModel AlipayOpenAgentConfirmModel [optional]

Return type

AlipayOpenAgentConfirmResponseModel

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 请求失败 -

create

AlipayOpenAgentCreateResponseModel create(alipayOpenAgentCreateModel)

开启代商户签约、创建应用事务

在 ISV 代商户进行应用创建、产品签约时,用于开启一个操作事务,必须是第一个调用的接口。场景1:ISV 代商户进行应用创建、产品签约,最后提交事务后需要商户确认才能完成流程;场景2:服务市场订购及授权,使用订单授权凭证order_ticket开启预授权模式,该模式下提交事务后无需商户确认。

Example

// Import classes:
import com.alipay.v3.ApiClient;
import com.alipay.v3.ApiException;
import com.alipay.v3.Configuration;
import com.alipay.v3.util.*;
import com.alipay.v3.api.models.*;
import com.alipay.v3.api.AlipayOpenAgentApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://openapi.alipay.com");
    // 设置alipayConfig参数(全局设置一次)
    AlipayConfig config = new AlipayConfig();
    config.setAppId("app_id");
    config.setPrivateKey("private_key");
    config.setAlipayPublicKey("alipay_public_key");
    config.setEncryptKey("encrypt_key");
    defaultClient.setAlipayConfig(config);

    AlipayOpenAgentApi apiInstance = new AlipayOpenAgentApi(defaultClient);
    AlipayOpenAgentCreateModel alipayOpenAgentCreateModel = new AlipayOpenAgentCreateModel(); // AlipayOpenAgentCreateModel | 
    try {
      AlipayOpenAgentCreateResponseModel result = apiInstance.create(alipayOpenAgentCreateModel);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AlipayOpenAgentApi#create");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
alipayOpenAgentCreateModel AlipayOpenAgentCreateModel [optional]

Return type

AlipayOpenAgentCreateResponseModel

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 请求失败 -