2010-09-28 100 views

回答

26

是的。

您可以暂停或使用 ManageRecurringPaymentsProfileStatus API通过 取消轮廓。您也可以重新激活 暂停的配置文件。但是,如果已达到 失败付款的最大数量 ,则在重新激活 配置文件之前,您将需要 来增加付款失败 的数量。

请找this参考:

Accodring到PayPal,你可以采取任何的利用ManagerecurringPayments API三个动作。

  • 取消 - 仅在活动中的配置文件或 暂停状态可以取消。
  • 挂起 - 只有在主动 状态轮廓可以suspended.-
  • 重新激活 - 在 暂停状态,可以重新激活.--
+3

这不只是为 “贝宝的Pro /快速支付”? OP正在讨论常规的PayPal订阅系统。 – erikcw 2011-09-16 15:51:04

+1

为我使用订阅ID作为配置文件ID。 – pat 2012-01-03 04:48:16

+1

您不能使用API​​取消旧订阅,如下面答案中所述。 – 2012-08-24 11:14:15

3

“订阅通过网站付款标准只能创建配置文件'订阅'按钮在2009年之前,订阅配置文件ID以S-XXXXXXXX开头,您无法通过任何API调用管理这些订阅,2009年之后,订阅配置文件ID以I-XXXXXX开头,您可以取消通过ManageRecurringPaymentsProfileStatus API调用订阅。“

如果遇到同样的问题,只能通过Robert来阅读它,它可以工作,您可以使用API​​取消标准网站订阅。

+0

什么工作?我有同样的问题,我不能取消S-订阅。 – Tomas 2012-08-22 07:14:54

+2

是的,你将无法使用API​​取消“S”的前缀订阅。 – 2012-08-24 11:06:32

+0

如何使用I-前缀创建订阅? – Tomas 2012-08-24 11:08:13

0

我不认为你可以使用API​​来取消支付与贝宝标准支付事件专业人士,而只有快速结账将工作。我试过并得到错误消息:“定期支付API不支持订阅配置文件”。你可以找到更多here

+0

努力中检索订阅的详细信息时,您将只能得到这个错误。 ''任何''订阅都可以进行状态编辑。 – gunwin 2014-04-08 23:37:19

5

在找到解决方案之前,我发现此线程,并认为我会回来给出答案。 (C#。网络解决方案)

您将需要以下的NuGet包:

Install-Package RestApiSDK 
Install-Package PayPalCoreSDK 
Install-Package PayPalMerchantSDK 

而且以下参考:

using PayPal.Api; 
using PayPal.PayPalAPIInterfaceService; 
using PayPal.PayPalAPIInterfaceService.Model; 

下面的代码:

public static void CancelRecurringPayment(string ProfileID) 
{ 
    ManageRecurringPaymentsProfileStatusRequestType request = 
     new ManageRecurringPaymentsProfileStatusRequestType(); 
    ManageRecurringPaymentsProfileStatusRequestDetailsType details = 
     new ManageRecurringPaymentsProfileStatusRequestDetailsType(); 
    request.ManageRecurringPaymentsProfileStatusRequestDetails = details; 

    details.ProfileID = ProfileID; 

    details.Action = StatusChangeActionType.CANCEL; 

    // Invoke the API 
    ManageRecurringPaymentsProfileStatusReq wrapper = new ManageRecurringPaymentsProfileStatusReq(); 
    wrapper.ManageRecurringPaymentsProfileStatusRequest = request; 

    Dictionary<string, string> configurationMap = new Dictionary<string, string>(); 

    configurationMap.Add("mode", "live"); 
    // Signature Credential 
    configurationMap.Add("account1.apiUsername", "APIUSERNAME"); 
    configurationMap.Add("account1.apiPassword", "APIPASSWORD"); 
    configurationMap.Add("account1.apiSignature", "APISIGNATURE"); 

    // Create the PayPalAPIInterfaceServiceService service object to make the API call 
    PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(configurationMap); 

    ManageRecurringPaymentsProfileStatusResponseType manageProfileStatusResponse = 
       service.ManageRecurringPaymentsProfileStatus(wrapper); 

    // Check for API return status 

    Dictionary<string, string> responseParams = new Dictionary<string, string>(); 
    responseParams.Add("API Status", manageProfileStatusResponse.Ack.ToString()); 

    if (manageProfileStatusResponse.Ack.Equals(AckCodeType.FAILURE) || (manageProfileStatusResponse.Errors != null && manageProfileStatusResponse.Errors.Count > 0)) 
    { 
     //FAILURE 
     Console.WriteLine(manageProfileStatusResponse.Errors.ToString()); 
    } 
    else 
    { 
     //SUCCESS 
     Console.Write("Success!"); 
    } 
    Console.WriteLine(); 
} 
+1

您的代码非常好,并且重点突出。它帮助我解决了我的问题。谢谢。 – Sunil 2016-05-24 19:45:28

相关问题