Exemple #1
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            // Create request object
            UpdateRecurringPaymentsProfileRequestType request = new UpdateRecurringPaymentsProfileRequestType();

            populateRequestObject(request);

            // Invoke the API
            UpdateRecurringPaymentsProfileReq wrapper = new UpdateRecurringPaymentsProfileReq();

            wrapper.UpdateRecurringPaymentsProfileRequest = 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 UpdateRecurringPaymentsProfile method in service wrapper object
            UpdateRecurringPaymentsProfileResponseType updateRPProfileResponse = service.UpdateRecurringPaymentsProfile(wrapper);

            // Check for API return status
            setKeyResponseObjects(service, updateRPProfileResponse);
        }
        protected void Submit_Click(object sender, EventArgs e)
        {
            // Create request object
            UpdateRecurringPaymentsProfileRequestType request = new UpdateRecurringPaymentsProfileRequestType();

            populateRequestObject(request);

            // Invoke the API
            UpdateRecurringPaymentsProfileReq wrapper = new UpdateRecurringPaymentsProfileReq();

            wrapper.UpdateRecurringPaymentsProfileRequest = request;
            PayPalAPIInterfaceServiceService           service = new PayPalAPIInterfaceServiceService();
            UpdateRecurringPaymentsProfileResponseType updateRPProfileResponse = service.UpdateRecurringPaymentsProfile(wrapper);

            // Check for API return status
            setKeyResponseObjects(service, updateRPProfileResponse);
        }
        private void setKeyResponseObjects(PayPalAPIInterfaceServiceService service, UpdateRecurringPaymentsProfileResponseType response)
        {
            Dictionary <string, string> responseParams = new Dictionary <string, string>();

            responseParams.Add("API Status", response.Ack.ToString());
            HttpContext CurrContext = HttpContext.Current;

            CurrContext.Items.Add("Response_redirectURL", null);
            if (response.Ack.Equals(AckCodeType.FAILURE) ||
                (response.Errors != null && response.Errors.Count > 0))
            {
                CurrContext.Items.Add("Response_error", response.Errors);
            }
            else
            {
                CurrContext.Items.Add("Response_error", null);
            }
            CurrContext.Items.Add("Response_keyResponseObject", responseParams);
            CurrContext.Items.Add("Response_apiName", "UpdateRecurringPaymentsProfile");
            CurrContext.Items.Add("Response_requestPayload", service.getLastRequest());
            CurrContext.Items.Add("Response_responsePayload", service.getLastResponse());
            Server.Transfer("../APIResponse.aspx");
        }