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

            request.TransactionID = transactionId.Value;
            request.Action        = (FMFPendingTransactionActionType)
                                    Enum.Parse(typeof(FMFPendingTransactionActionType), action.SelectedValue);

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

            wrapper.ManagePendingTransactionStatusRequest = request;
            PayPalAPIInterfaceServiceService           service = new PayPalAPIInterfaceServiceService();
            ManagePendingTransactionStatusResponseType manageProfileStatusResponse =
                service.ManagePendingTransactionStatus(wrapper);


            // Check for API return status
            setKeyResponseObjects(service, manageProfileStatusResponse);
        }
예제 #2
0
        private string CancelTransaction(string transactionId)
        {
            // Create request object
            ManagePendingTransactionStatusRequestType request =
                new ManagePendingTransactionStatusRequestType();

            // (Required) The transaction ID of the payment transaction.
            request.TransactionID = transactionId;
            // (Required) The operation you want to perform on the transaction. It is one of the following values:
            // * Accept – Accepts the payment
            // * Deny – Rejects the payment
            request.Action = FMFPendingTransactionActionType.DENY;

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

            wrapper.ManagePendingTransactionStatusRequest = 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]

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

            // # API call
            // Invoke the ManagePendingTransactionStatus method in service wrapper object
            ManagePendingTransactionStatusResponseType manageProfileStatusResponse =
                service.ManagePendingTransactionStatus(wrapper);

            if (manageProfileStatusResponse.Ack.Equals(AckCodeType.FAILURE) ||
                (manageProfileStatusResponse.Errors != null && manageProfileStatusResponse.Errors.Any()))
            {
                return(string.Empty);
            }
            return(manageProfileStatusResponse.Status);
        }
예제 #3
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            // Create request object
            ManagePendingTransactionStatusRequestType request =
                new ManagePendingTransactionStatusRequestType();

            // (Required) The transaction ID of the payment transaction.
            request.TransactionID = transactionId.Value;
            // (Required) The operation you want to perform on the transaction. It is one of the following values:
            // * Accept – Accepts the payment
            // * Deny – Rejects the payment
            request.Action = (FMFPendingTransactionActionType)
                             Enum.Parse(typeof(FMFPendingTransactionActionType), action.SelectedValue);

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

            wrapper.ManagePendingTransactionStatusRequest = 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 ManagePendingTransactionStatus method in service wrapper object
            ManagePendingTransactionStatusResponseType manageProfileStatusResponse =
                service.ManagePendingTransactionStatus(wrapper);


            // Check for API return status
            setKeyResponseObjects(service, manageProfileStatusResponse);
        }