Наследование: Braintree.Request
        public Result <PayPalAccount> Update(string token, PayPalAccountRequest request)
        {
            XmlNode xml = service.Put(service.MerchantPath() + "/payment_methods/paypal_account/" + token, request);

            return(new ResultImpl <PayPalAccount>(new NodeWrapper(xml), gateway));
        }
Пример #2
0
        public void Update_CanMakeDefault()
        {
            Result<Customer> customerResult = gateway.Customer.Create(new CustomerRequest());
            Assert.IsTrue(customerResult.IsSuccess());

            var creditCardRequest = new CreditCardRequest
            {
                CustomerId = customerResult.Target.Id,
                Number = "5105105105105100",
                ExpirationDate = "05/12"
            };
            CreditCard creditCard = gateway.CreditCard.Create(creditCardRequest).Target;
            Assert.IsTrue(creditCard.IsDefault.Value);

            var request = new PaymentMethodRequest
            {
                CustomerId = customerResult.Target.Id,
                PaymentMethodNonce = Nonce.PayPalFuturePayment
            };
            Result<PaymentMethod> result = gateway.PaymentMethod.Create(request);

            Assert.IsTrue(result.IsSuccess());

            var updateRequest = new PayPalAccountRequest
            {
                Options = new PayPalOptionsRequest
                {
                    MakeDefault = true
                }
            };
            var updateResult = gateway.PayPalAccount.Update(result.Target.Token, updateRequest);

            Assert.IsTrue(updateResult.IsSuccess());
            Assert.IsTrue(updateResult.Target.IsDefault.Value);
        }
Пример #3
0
        public void Update_CanUpdateToken()
        {
            Result<Customer> customerResult = gateway.Customer.Create(new CustomerRequest());
            Assert.IsTrue(customerResult.IsSuccess());

            var request = new PaymentMethodRequest
            {
                CustomerId = customerResult.Target.Id,
                PaymentMethodNonce = Nonce.PayPalFuturePayment
            };
            Result<PaymentMethod> result = gateway.PaymentMethod.Create(request);

            Assert.IsTrue(result.IsSuccess());

            string newToken = Guid.NewGuid().ToString();
            var updateRequest = new PayPalAccountRequest
            {
                Token = newToken
            };
            var updateResult = gateway.PayPalAccount.Update(result.Target.Token, updateRequest);

            Assert.IsTrue(updateResult.IsSuccess());
            Assert.AreEqual(newToken, updateResult.Target.Token);
        }
 public Result<PayPalAccount> Update(string token, PayPalAccountRequest request)
 {
     XmlNode xml = service.Put(service.MerchantPath() + "/payment_methods/paypal_account/" + token, request);
     return new ResultImpl<PayPalAccount>(new NodeWrapper(xml), gateway);
 }
Пример #5
0
        public Result <PayPalAccount> Update(String token, PayPalAccountRequest request)
        {
            XmlNode xml = Service.Put("/payment_methods/paypal_account/" + token, request);

            return(new ResultImpl <PayPalAccount>(new NodeWrapper(xml), Service));
        }
Пример #6
0
 public Result<PayPalAccount> Update(String token, PayPalAccountRequest request)
 {
     XmlNode xml = Service.Put("/payment_methods/paypal_account/" + token, request);
     return new ResultImpl<PayPalAccount>(new NodeWrapper(xml), Service);
 }