public void Create_CreatesApplePayCardWithNonce() { Result <Customer> result = gateway.Customer.Create(new CustomerRequest()); Assert.IsTrue(result.IsSuccess()); var request = new PaymentMethodRequest { CustomerId = result.Target.Id, PaymentMethodNonce = Nonce.ApplePayAmex }; Result <PaymentMethod> paymentMethodResult = gateway.PaymentMethod.Create(request); Assert.IsTrue(paymentMethodResult.IsSuccess()); Assert.IsNotNull(paymentMethodResult.Target.Token); Assert.IsNotNull(paymentMethodResult.Target.ImageUrl); Assert.IsInstanceOf(typeof(ApplePayCard), paymentMethodResult.Target); ApplePayCard applePayCard = (ApplePayCard)paymentMethodResult.Target; Assert.IsNotNull(applePayCard.CardType); Assert.IsNotNull(applePayCard.ExpirationMonth); Assert.IsNotNull(applePayCard.ExpirationYear); Assert.IsNotNull(applePayCard.CreatedAt); Assert.IsNotNull(applePayCard.UpdatedAt); Assert.IsNotNull(applePayCard.Subscriptions); Assert.IsNotNull(applePayCard.PaymentInstrumentName); Assert.IsNotNull(applePayCard.SourceDescription); Assert.IsNotNull(applePayCard.IsExpired); Assert.AreEqual(result.Target.Id, applePayCard.CustomerId); Assert.AreEqual(PaymentInstrumentType.APPLE_PAY_CARD, paymentMethodResult.Target.PaymentInstrumentType); }
public void Find_IncludesApplePayCardsInPaymentMethods() { var createRequest = new CustomerRequest { PaymentMethodNonce = Nonce.ApplePayAmex }; Customer createdCustomer = gateway.Customer.Create(createRequest).Target; Customer customer = gateway.Customer.Find(createdCustomer.Id); Assert.IsNotNull(customer.ApplePayCards); Assert.IsNotNull(customer.PaymentMethods); ApplePayCard card = customer.ApplePayCards[0]; Assert.IsNotNull(card.Token); Assert.AreEqual(card, customer.PaymentMethods[0]); }