public void Create_DoesNotOverrideTheBillingAddressForVaultedCreditCards()
{
var customer = gateway.Customer.Create().Target;
var nonce = TestHelper.GetNonceForNewCreditCard(
gateway,
new Params
{
{ "number", "4111111111111111" },
{ "expirationMonth", "12" },
{ "expirationYear", "2020" },
{ "billing_address", new Params
{
{ "street_address", "456 Xyz Way" }
}
}
},
customer.Id);
Assert.IsFalse(string.IsNullOrEmpty(nonce));
var result = gateway.PaymentMethod.Create(new PaymentMethodRequest
{
PaymentMethodNonce = nonce,
CustomerId = customer.Id,
BillingAddress = new PaymentMethodAddressRequest
{
StreetAddress = "123 Abc Way"
}
});
Assert.IsTrue(result.IsSuccess());
Assert.That(result.Target, Is.InstanceOf(typeof(CreditCard)));
var token = result.Target.Token;
var foundCreditCard = gateway.CreditCard.Find(token);
Assert.IsNotNull(foundCreditCard);
Assert.AreEqual("456 Xyz Way", foundCreditCard.BillingAddress.StreetAddress);
}