public PaypalResponse CreateBillingAgreement(PaypalResponse response) { CreateBillingAgreementRequestType request = new CreateBillingAgreementRequestType(); // (Required) The time-stamped token returned in the SetCustomerBillingAgreement response. // Note: The token expires after 3 hours. request.Token = response.ECToken; // Invoke the API CreateBillingAgreementReq wrapper = new CreateBillingAgreementReq(); wrapper.CreateBillingAgreementRequest = request; // Configuration map containing signature credentials and other required configuration. // For a full list of configuration parameters refer in wiki page // [https://github.com/paypal/sdk-core-dotnet/wiki/SDK-Configuration-Parameters] Dictionary <string, string> configurationMap = Configuration.GetAcctAndConfig(); // Create the PayPalAPIInterfaceServiceService service object to make the API call PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(configurationMap); // # API call // Invoke the CreateBillingAgreement method in service wrapper object CreateBillingAgreementResponseType billingAgreementResponse = service.CreateBillingAgreement(wrapper); PaypalResponse responsePaypal = new PaypalResponse(); responsePaypal = GetBillingAgreementID(billingAgreementResponse); return(responsePaypal); }
protected void Submit_Click(object sender, EventArgs e) { // Create request object CreateBillingAgreementRequestType request = new CreateBillingAgreementRequestType(); // (Required) The time-stamped token returned in the SetCustomerBillingAgreement response. // Note: The token expires after 3 hours. request.Token = token.Value; // Invoke the API CreateBillingAgreementReq wrapper = new CreateBillingAgreementReq(); wrapper.CreateBillingAgreementRequest = request; // Configuration map containing signature credentials and other required configuration. // For a full list of configuration parameters refer in wiki page // [https://github.com/paypal/sdk-core-dotnet/wiki/SDK-Configuration-Parameters] Dictionary <string, string> configurationMap = Configuration.GetAcctAndConfig(); // Create the PayPalAPIInterfaceServiceService service object to make the API call PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(configurationMap); // # API call // Invoke the CreateBillingAgreement method in service wrapper object CreateBillingAgreementResponseType billingAgreementResponse = service.CreateBillingAgreement(wrapper); // Check for API return status setKeyResponseObjects(service, billingAgreementResponse); }
protected void Submit_Click(object sender, EventArgs e) { // Create request object CreateBillingAgreementRequestType request = new CreateBillingAgreementRequestType(); request.Token = token.Value; // Invoke the API CreateBillingAgreementReq wrapper = new CreateBillingAgreementReq(); wrapper.CreateBillingAgreementRequest = request; PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(); CreateBillingAgreementResponseType billingAgreementResponse = service.CreateBillingAgreement(wrapper); // Check for API return status setKeyResponseObjects(service, billingAgreementResponse); }