【发布时间】:2016-09-21 03:13:33
【问题描述】:
以下是 .Net 的 PayPal 示例中的一些代码,其中正在删除发票。我从:https://github.com/paypal/PayPal-NET-SDK/tree/master/Samples/Source 下载了这个。删除发票的代码通过以下调用 createdInvoice.Delete 来执行此操作,该调用返回 void。
问题:由于此方法返回 void,如何知道删除成功?
使用 NET SDK for PayPal 删除创建的发票的 PayPal 代码
// ^ Ignore workflow code segment
#region Track Workflow
this.flow.AddNewRequest("Create the invoice", invoice);
#endregion
// Create the invoice
var createdInvoice = invoice.Create(apiContext);
// ^ Ignore workflow code segment
#region Track Workflow
this.flow.RecordResponse(createdInvoice);
this.flow.AddNewRequest("Delete the invoice");
#endregion
createdInvoice.Delete(apiContext);//This method returns a void, so how we
//know it succeeded?????
// ^ Ignore workflow code segment
#region Track Workflow
this.flow.RecordActionSuccess("Invoice deleted successfully.");
#endregion
【问题讨论】:
标签: c# asp.net webforms paypal