public void Convert_Token_NotNull()
        {
            //Arrange
            Payment payment = new Payment()
            {
                Token = "Token"
            };
            PaymentToApiPaymentConverter converter = new PaymentToApiPaymentConverter(payment);

            //Act
            HyperWalletLibrary.Model.Payment result = converter.Convert();

            //Assert
            Assert.True(result.Token != null);
        }
Exemple #2
0
        public async Task <Payment> PostAsync(Payment item)
        {
            try
            {
                _paymentToApiPayment.Content = item;
                HyperWalletLibrary.Model.Payment newItem  = _paymentToApiPayment.Convert();
                HyperWalletLibrary.Model.Payment response = await _api.PostAsync(newItem);

                Payment payment = new Payment(response);
                return(payment);
            }
            catch (Exception)
            {
                return(null);
            }
        }