/// <summary> /// Handle GetFundingPlans API call /// </summary> /// <param name="context"></param> private void GetFundingPlans(HttpContext context) { NameValueCollection parameters = context.Request.Params; GetFundingPlansRequest req = new GetFundingPlansRequest(new RequestEnvelope("en_US"), parameters["payKey"]); // All set. Fire the request AdaptivePaymentsService service = new AdaptivePaymentsService(); GetFundingPlansResponse resp = null; try { resp = service.GetFundingPlans(req); } catch (System.Exception e) { context.Response.Write(e.Message); return; } // Display response values. Dictionary<string, string> keyResponseParams = new Dictionary<string, string>(); string redirectUrl = null; if (!(resp.responseEnvelope.ack == AckCode.FAILURE) && !(resp.responseEnvelope.ack == AckCode.FAILUREWITHWARNING)) { int idx = 1; foreach (FundingPlan plan in resp.fundingPlan) { keyResponseParams.Add("Funding plan Id " + idx, plan.fundingPlanId); keyResponseParams.Add("Funding plan amount " + idx, plan.fundingAmount.amount + plan.fundingAmount.code ); idx++; } } displayResponse(context, "GetFundingPlans", keyResponseParams, service.getLastRequest(), service.getLastResponse(), resp.error, redirectUrl); }