Beispiel #1
0
        /// <summary>
        /// Creates (and processes) a new Refund Transaction added as a related resource.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="captureId">ID of the captured payment resource to refund.</param>
        /// <param name="refund">Refund</param>
        /// <returns>Refund</returns>
        public static Refund Refund(APIContext apiContext, string captureId, Refund refund)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(captureId, "captureId");
            ArgumentValidator.Validate(refund, "refund");

            // Configure and send the request
            var pattern      = "v1/payments/capture/{0}/refund";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { captureId });

            return(PayPalResource.ConfigureAndExecute <Refund>(apiContext, HttpMethod.POST, resourcePath, refund.ConvertToJson()));
        }
        public ApiResponse <CustomObjectprop> UpdateAccountCustomObjectbytoken(string access_token, string objectRecordId, string objectname, string customObject)
        {
            Validate(new ArrayList {
                objectRecordId, objectname, access_token
            });
            var additionalparams = new QueryParameters {
                ["objectname"] = objectname, ["access_token"] = access_token
            };
            var resourcePath = SDKUtil.FormatURIPath(("customobject/{0}"), new object[] { objectRecordId });

            return(ConfigureAndExecute <CustomObjectprop>(RequestType.Authentication, HttpMethod.Put, resourcePath, additionalparams,
                                                          customObject));
        }
        public ApiResponse <CustomObjectResponse> GetAccountCustomObject(string uId, string objectname)
        {
            Validate(new ArrayList {
                uId
            });
            var resourcePath       = SDKUtil.FormatURIPath(_resoucePath, new object[] { uId });
            var addtionalparameter = new QueryParameters {
                ["objectname"] = objectname
            };

            return(ConfigureAndExecute <CustomObjectResponse>(RequestType.Identity, HttpMethod.Get, resourcePath,
                                                              addtionalparameter));
        }
Beispiel #4
0
        /// <summary>
        /// Partially update the Payment resource for the given identifier
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="paymentId">ID of the payment to update.</param>
        /// <param name="patchRequest">PatchRequest</param>
        public static void Update(APIContext apiContext, string paymentId, PatchRequest patchRequest)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(paymentId, "paymentId");
            ArgumentValidator.Validate(patchRequest, "patchRequest");

            // Configure and send the request
            var pattern      = "v1/payments/payment/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { paymentId });

            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.PATCH, resourcePath, patchRequest.ConvertToJson());
        }
Beispiel #5
0
        /// <summary>
        /// Mark the status of the invoice as refunded.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="invoiceId">ID fo the invoice to mark as refunded.</param>
        /// <param name="refundDetail">RefundDetail</param>
        public static void RecordRefund(APIContext apiContext, string invoiceId, RefundDetail refundDetail)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(invoiceId, "invoiceId");
            ArgumentValidator.Validate(refundDetail, "refundDetail");

            // Configure and send the request
            var pattern      = "v1/invoicing/invoices/{0}/record-refund";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { invoiceId });

            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.POST, resourcePath, refundDetail.ConvertToJson());
        }
        public ApiResponse <LoginRadiusDeleteResponse> DeleteAdditionalPermissionfromContext(string uid,
                                                                                             string rolecontextname, AdditionalRolePermissions _AdditionalRolePermissions)
        {
            Validate(new ArrayList {
                uid, rolecontextname
            });
            var resourcePath =
                SDKUtil.FormatURIPath(new LoginRadiusResoucePath("{0}/rolecontext/{1}/additionalpermission"),
                                      new object[] { uid, rolecontextname });

            return(ConfigureAndExecute <LoginRadiusDeleteResponse>(RequestType.Identity, HttpMethod.Delete, resourcePath,
                                                                   _AdditionalRolePermissions.ConvertToJson()));
        }
Beispiel #7
0
        /// <summary>
        /// Updates the Webhook identified by webhook_id for the application associated with access token.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="webhookId">ID of the webhook to be updated.</param>
        /// <param name="patchRequest">PatchRequest</param>
        /// <returns>Webhook</returns>
        public static Webhook Update(APIContext apiContext, string webhookId, PatchRequest patchRequest)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(webhookId, "webhookId");
            ArgumentValidator.Validate(patchRequest, "patchRequest");

            // Configure and send the request
            var pattern      = "v1/notifications/webhooks/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { webhookId });

            return(PayPalResource.ConfigureAndExecute <Webhook>(apiContext, HttpMethod.PATCH, resourcePath, patchRequest.ConvertToJson()));
        }
Beispiel #8
0
        /// <summary>
        /// Cancels an invoice.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="invoiceId">ID of the invoice to cancel.</param>
        /// <param name="cancelNotification">CancelNotification</param>
        public static void Cancel(APIContext apiContext, string invoiceId, CancelNotification cancelNotification)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(invoiceId, "invoiceId");
            ArgumentValidator.Validate(cancelNotification, "cancelNotification");

            // Configure and send the request
            var pattern      = "v1/invoicing/invoices/{0}/cancel";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { invoiceId });

            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.POST, resourcePath, cancelNotification.ConvertToJson());
        }
        /// <summary>
        /// Creates (and processes) a new Capture Transaction added as a related resource.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="authorizationId">ID of the authorization to capture.</param>
        /// <param name="capture">Capture</param>
        /// <returns>Capture</returns>
        public static Capture Capture(APIContext apiContext, string authorizationId, Capture capture)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(authorizationId, "authorizationId");
            ArgumentValidator.Validate(capture, "capture");

            // Configure and send the request
            var pattern      = "v1/payments/authorization/{0}/capture";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { authorizationId });

            return(PayPalResource.ConfigureAndExecute <Capture>(apiContext, HttpMethod.POST, resourcePath, capture.ConvertToJson()));
        }
        /// <summary>
        /// Set the balance for an agreement by passing the ID of the agreement to the request URI. In addition, pass a Currency object in the request JSON that specifies the currency type and value of the balance.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="agreementId">ID of the billing agreement to perform the operation against.</param>
        /// <param name="currency">Currency</param>
        public static void SetBalance(APIContext apiContext, string agreementId, Currency currency)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(agreementId, "agreementId");
            ArgumentValidator.Validate(currency, "currency");

            // Configure and send the request
            var pattern      = "v1/payments/billing-agreements/{0}/set-balance";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { agreementId });

            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.POST, resourcePath, currency.ConvertToJson());
        }
        /// <summary>
        /// Cancel a billing agreement by passing the ID of the agreement to the request URI. In addition, pass an AgreementStateDescriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="agreementId">ID of the billing agreement that will be canceled.</param>
        /// <param name="agreementStateDescriptor">AgreementStateDescriptor</param>
        public static void Cancel(APIContext apiContext, string agreementId, AgreementStateDescriptor agreementStateDescriptor)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(agreementId, "agreementId");
            ArgumentValidator.Validate(agreementStateDescriptor, "agreementStateDescriptor");

            // Configure and send the request
            var pattern      = "v1/payments/billing-agreements/{0}/cancel";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { agreementId });

            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.POST, resourcePath, agreementStateDescriptor.ConvertToJson());
        }
        /// <summary>
        /// Delete the Credit Card resource for the given identifier.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="creditCardId">Identifier of the credit card resource to obtain the data for.</param>
        public static void Delete(APIContext apiContext, string creditCardId)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(creditCardId, "creditCardId");

            // Configure and send the request
            apiContext.MaskRequestId = true;
            var pattern      = "v1/vault/credit-cards/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { creditCardId });

            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.DELETE, resourcePath);
        }
        /// <summary>
        /// Update information in a previously saved card. Only the modified fields need to be passed in the request.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="creditCardId">ID fo the credit card to update.</param>
        /// <param name="patchRequest">PatchRequest</param>
        /// <returns>CreditCard</returns>
        public static CreditCard Update(APIContext apiContext, string creditCardId, PatchRequest patchRequest)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(creditCardId, "creditCardId");
            ArgumentValidator.Validate(patchRequest, "patchRequest");

            // Configure and send the request
            var pattern      = "v1/vault/credit-cards/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { creditCardId });

            return(PayPalResource.ConfigureAndExecute <CreditCard>(apiContext, HttpMethod.PATCH, resourcePath, patchRequest.ConvertToJson()));
        }
        /// <summary>
        /// Delete an existing web experience profile by passing the profile ID to the request URI.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="profileId">ID of the profile to delete.</param>
        public static void Delete(APIContext apiContext, string profileId)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(profileId, "profileId");

            // Configure and send the request
            apiContext.MaskRequestId = true;
            var pattern      = "v1/payment-experience/web-profiles/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { profileId });

            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.DELETE, resourcePath);
        }
Beispiel #15
0
        /// <summary>
        /// Executes the payment (after approved by the Payer) associated with this resource when the payment method is PayPal.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="paymentId">ID of the payment to execute.</param>
        /// <param name="paymentExecution">PaymentExecution</param>
        /// <returns>Payment</returns>
        public static Payment Execute(APIContext apiContext, string paymentId, PaymentExecution paymentExecution)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(paymentId, "paymentId");
            ArgumentValidator.Validate(paymentExecution, "paymentExecution");

            // Configure and send the request
            var pattern      = "v1/payments/payment/{0}/execute";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { paymentId });

            return(PayPalResource.ConfigureAndExecute <Payment>(apiContext, HttpMethod.POST, resourcePath, paymentExecution.ConvertToJson()));
        }
Beispiel #16
0
        /// <summary>
        /// Update information in a previously saved card. Only the modified fields need to be passed in the request.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <returns>CreditCard</returns>
        public CreditCard Update(APIContext apiContext)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(this.id, "Id");

            // Configure and send the request
            object[] parameters   = new object[] { this.id };
            string   pattern      = "v1/vault/credit-card/{0}";
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = this.ConvertToJson();

            return(PayPalResource.ConfigureAndExecute <CreditCard>(apiContext, HttpMethod.PATCH, resourcePath, payLoad));
        }
Beispiel #17
0
        /// <summary>
        /// Voids (cancels) an Order.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <returns>Order</returns>
        public Order Void(APIContext apiContext)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(this.id, "Id");

            // Configure and send the request
            object[] parameters   = new object[] { this.id };
            string   pattern      = "v1/payments/orders/{0}/do-void";
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = "";

            return(PayPalResource.ConfigureAndExecute <Order>(apiContext, HttpMethod.POST, resourcePath, payLoad));
        }
        /// <summary>
        /// Search for invoice resources.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="search">Search</param>
        /// <returns>Invoices</returns>
        public Invoices Search(APIContext apiContext, Search search)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(search, "search");

            // Configure and send the request
            object[] parameters   = new object[] { this.id };
            string   pattern      = "v1/invoicing/search";
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = search.ConvertToJson();

            return(PayPalResource.ConfigureAndExecute <Invoices>(apiContext, HttpMethod.POST, resourcePath, payLoad));
        }
Beispiel #19
0
        /// <summary>
        /// Retrieve the details of a particular web experience profile by passing the ID of the profile to the request URI.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="profileId">string</param>
        /// <returns>WebProfile</returns>
        public static WebProfile Get(APIContext apiContext, string profileId)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(profileId, "profileId");

            // Configure and send the request
            object[] parameters   = new object[] { profileId };
            string   pattern      = "v1/payment-experience/web-profiles/{0}";
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = "";

            return(PayPalResource.ConfigureAndExecute <WebProfile>(apiContext, HttpMethod.GET, resourcePath, payLoad));
        }
        /// <summary>
        /// Get call for Refund.
        /// GET /v1/payments/refund/:refundId
        /// <param name="accessToken">Access Token</param>
        /// <param name="refundId">RefundId</param>
        /// <returns>Returns Refund object</returns>
        /// </summary>
        public static Refund Get(string accessToken, string refundId)
        {
            if (String.IsNullOrEmpty(refundId))
            {
                throw new System.ArgumentNullException("refundId cannot be null or empty");
            }
            string pattern = "v1/payments/refund/{0}";

            object[] container    = new Object[] { refundId };
            string   resourcePath = SDKUtil.FormatURIPath(pattern, container);
            string   payLoad      = string.Empty;

            return(PayPalResource.ConfigureAndExecute <Refund>(accessToken, HttpMethod.GET, resourcePath, payLoad));
        }
Beispiel #21
0
        /// <summary>
        /// Obtain the Bank Account resource for the given identifier.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="bankAccountId">string</param>
        /// <returns>BankAccount</returns>
        public static BankAccount Get(APIContext apiContext, string bankAccountId)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(bankAccountId, "bankAccountId");

            // Configure and send the request
            object[] parameters   = new object[] { bankAccountId };
            string   pattern      = "v1/vault/bank-accounts/{0}";
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = "";

            return(PayPalResource.ConfigureAndExecute <BankAccount>(apiContext, HttpMethod.GET, resourcePath, payLoad));
        }
        /// <summary>
        /// Get call for Payment.
        /// GET /v1/payments/payment?count=:count&start_id=:start_id&start_index=:start_index&start_time=:start_time&end_time=:end_time&payee_id=:payee_id&sort_by=:sort_by&sort_order=:sort_order
        /// <param name="apiContext">APIContext required for the call</param>
        /// <param name="parameters">Container for query strings</param>
        /// <returns>Returns PaymentHistory object</returns>
        /// </summary>
        public static PaymentHistory Get(APIContext apiContext, QueryParameters parameters)
        {
            if (string.IsNullOrEmpty(apiContext.AccessToken))
            {
                throw new ArgumentNullException("AccessToken cannot be null");
            }
            string pattern = "v1/payments/payment?count={0}&start_id={1}&start_index={2}&start_time={3}&end_time={4}&payee_id={5}&sort_by={6}&sort_order={7}";

            object[] container    = new object[] { parameters };
            string   resourcePath = SDKUtil.FormatURIPath(pattern, container);
            string   payLoad      = string.Empty;

            return(PayPalResource.ConfigureAndExecute <PaymentHistory>(apiContext, HttpMethod.GET, resourcePath, payLoad));
        }
Beispiel #23
0
        /// <summary>
        /// Deletes an external refund, by invoice ID and transaction ID.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="invoiceId">The ID of the invoice from which to delete the refund transaction.</param>
        /// <param name="transactionId">The ID of the refund transaction to delete.</param>
        public static void DeleteExternalRefund(APIContext apiContext, string invoiceId, string transactionId)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(invoiceId, "invoiceId");
            ArgumentValidator.Validate(transactionId, "transactionId");

            // Configure and send the request
            apiContext.MaskRequestId = true;
            var pattern      = "v1/invoicing/invoices/{0}/refund-records/{1}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { invoiceId, transactionId });

            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.DELETE, resourcePath);
        }
Beispiel #24
0
        /// <summary>
        /// Retrieves a list of Credit Card resources.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="containerDictionary">Dictionary<String, String></param>
        /// <returns>CreditCardHistory</returns>
        public static CreditCardHistory List(APIContext apiContext, Dictionary <String, String> containerDictionary)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(containerDictionary, "containerDictionary");

            // Configure and send the request
            object[] parameters   = new object[] { containerDictionary };
            string   pattern      = "v1/vault/credit-card?count={0}&start_id={1}&start_index={2}&start_time={3}&end_time={4}&payer_id={5}";
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = "";

            return(PayPalResource.ConfigureAndExecute <CreditCardHistory>(apiContext, HttpMethod.GET, resourcePath, payLoad));
        }
        /// <summary>
        /// Reauthorizes an expired Authorization.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <returns>Authorization</returns>
        public Authorization Reauthorize(APIContext apiContext)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(this.id, "Id");

            // Configure and send the request
            object[] parameters   = new object[] { this.id };
            string   pattern      = "v1/payments/authorization/{0}/reauthorize";
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = this.ConvertToJson();

            return(PayPalResource.ConfigureAndExecute <Authorization>(apiContext, HttpMethod.POST, resourcePath, payLoad));
        }
Beispiel #26
0
        public void FormatURIPathMapQueryMapTest()
        {
            string pattern = "/a/b/first/second";
            Dictionary <string, string> pathParameters  = new Dictionary <string, string>();
            Dictionary <string, string> queryParameters = new Dictionary <string, string>();

            queryParameters.Add("query1", "value1");
            queryParameters.Add("query2", "value2");
            string uriPath = SDKUtil.FormatURIPath(pattern, pathParameters,
                                                   queryParameters);

            Assert.AreEqual(uriPath,
                            "/a/b/first/second?query1=value1&query2=value2&");
        }
Beispiel #27
0
        /// <summary>
        /// Execute a billing agreement after buyer approval by passing the payment token to the request URI.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <returns>Agreement</returns>
        public Agreement Execute(APIContext apiContext)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(this.token, "token");

            // Configure and send the request
            object[] parameters   = new object[] { this.token };
            string   pattern      = "v1/payments/billing-agreements/{0}/agreement-execute";
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = "";

            return(PayPalResource.ConfigureAndExecute <Agreement>(apiContext, HttpMethod.POST, resourcePath, payLoad));
        }
Beispiel #28
0
        /// <summary>
        /// Returns user details
        /// <param name="apiContext">APIContext to be used for the call.</param>
        /// <param name="userinfoParameters">Query parameters used for API call</param>
        /// </summary>
        public static Userinfo GetUserinfo(APIContext apiContext, UserinfoParameters userinfoParameters)
        {
            string pattern = "v1/identity/openidconnect/userinfo?schema={0}&access_token={1}";

            object[] parameters   = new object[] { userinfoParameters };
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);

            if (apiContext == null)
            {
                apiContext = new APIContext();
            }
            apiContext.MaskRequestId = true;
            return(PayPalResource.ConfigureAndExecute <Userinfo>(apiContext, HttpMethod.GET, resourcePath));
        }
Beispiel #29
0
        /// <summary>
        /// Obtain the Refund transaction resource for the given identifier.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="refundId">string</param>
        /// <returns>Refund</returns>
        public static Refund Get(APIContext apiContext, string refundId)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(refundId, "refundId");

            // Configure and send the request
            object[] parameters   = new object[] { refundId };
            string   pattern      = "v1/payments/refund/{0}";
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = "";

            return(PayPalResource.ConfigureAndExecute <Refund>(apiContext, HttpMethod.GET, resourcePath, payLoad));
        }
        //public ApiResponse<CustomObjectResponse> GetAccountCustomObjectByObjectId(string uId, string objectRecordId)
        //{
        //    Validate(new ArrayList {uId, objectRecordId});
        //    var pattern = _resoucePath.ChildObject("{1}").ObjectName;
        //    var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] {uId, objectRecordId});
        //    return ConfigureAndExecute<CustomObjectResponse>(RequestType.Identity, HttpMethod.Get, resourcePath);
        //}

        public ApiResponse <LoginRadiusDeleteResponse> DeleteAccountCustomObject(string uId, string objectRecordId, string objectname)
        {
            Validate(new ArrayList {
                uId, objectRecordId
            });
            var pattern          = _resoucePath.ChildObject("{1}").ObjectName;
            var resourcePath     = SDKUtil.FormatURIPath(pattern, new object[] { uId, objectRecordId });
            var additionalparams = new QueryParameters {
                ["objectname"] = objectname
            };

            return(ConfigureAndExecute <LoginRadiusDeleteResponse>(RequestType.Identity, HttpMethod.Delete,
                                                                   resourcePath, additionalparams));
        }