public Payment(HyperWalletLibrary.Model.Payment payment) { Token = payment.Token; Amount = payment.Amount; Id = payment.ClientPaymentId; DestinationToken = payment.DestinationToken; ExpiresOn = payment.ExpiresOn; Notes = payment.Notes; }
public async Task <Payment> GetAsync(string token) { try { HyperWalletLibrary.Model.Payment response = await _api.GetAsync(token); Payment payment = new Payment(response); return(payment); } catch (Exception) { return(null); } }
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); }
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); } }