Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hashCode = 1509386817;

            if (CardNonce != null)
            {
                hashCode += CardNonce.GetHashCode();
            }

            if (BillingAddress != null)
            {
                hashCode += BillingAddress.GetHashCode();
            }

            if (CardholderName != null)
            {
                hashCode += CardholderName.GetHashCode();
            }

            if (VerificationToken != null)
            {
                hashCode += VerificationToken.GetHashCode();
            }

            return(hashCode);
        }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is ChargeRequest other &&
                   ((IdempotencyKey == null && other.IdempotencyKey == null) || (IdempotencyKey?.Equals(other.IdempotencyKey) == true)) &&
                   ((AmountMoney == null && other.AmountMoney == null) || (AmountMoney?.Equals(other.AmountMoney) == true)) &&
                   ((CardNonce == null && other.CardNonce == null) || (CardNonce?.Equals(other.CardNonce) == true)) &&
                   ((CustomerCardId == null && other.CustomerCardId == null) || (CustomerCardId?.Equals(other.CustomerCardId) == true)) &&
                   ((DelayCapture == null && other.DelayCapture == null) || (DelayCapture?.Equals(other.DelayCapture) == true)) &&
                   ((ReferenceId == null && other.ReferenceId == null) || (ReferenceId?.Equals(other.ReferenceId) == true)) &&
                   ((Note == null && other.Note == null) || (Note?.Equals(other.Note) == true)) &&
                   ((CustomerId == null && other.CustomerId == null) || (CustomerId?.Equals(other.CustomerId) == true)) &&
                   ((BillingAddress == null && other.BillingAddress == null) || (BillingAddress?.Equals(other.BillingAddress) == true)) &&
                   ((ShippingAddress == null && other.ShippingAddress == null) || (ShippingAddress?.Equals(other.ShippingAddress) == true)) &&
                   ((BuyerEmailAddress == null && other.BuyerEmailAddress == null) || (BuyerEmailAddress?.Equals(other.BuyerEmailAddress) == true)) &&
                   ((OrderId == null && other.OrderId == null) || (OrderId?.Equals(other.OrderId) == true)) &&
                   ((AdditionalRecipients == null && other.AdditionalRecipients == null) || (AdditionalRecipients?.Equals(other.AdditionalRecipients) == true)) &&
                   ((VerificationToken == null && other.VerificationToken == null) || (VerificationToken?.Equals(other.VerificationToken) == true)));
        }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is CreateCustomerCardRequest other &&
                   ((CardNonce == null && other.CardNonce == null) || (CardNonce?.Equals(other.CardNonce) == true)) &&
                   ((BillingAddress == null && other.BillingAddress == null) || (BillingAddress?.Equals(other.BillingAddress) == true)) &&
                   ((CardholderName == null && other.CardholderName == null) || (CardholderName?.Equals(other.CardholderName) == true)) &&
                   ((VerificationToken == null && other.VerificationToken == null) || (VerificationToken?.Equals(other.VerificationToken) == true)));
        }
Exemplo n.º 4
0
        public override int GetHashCode()
        {
            int hashCode = 851688088;

            if (IdempotencyKey != null)
            {
                hashCode += IdempotencyKey.GetHashCode();
            }

            if (AmountMoney != null)
            {
                hashCode += AmountMoney.GetHashCode();
            }

            if (CardNonce != null)
            {
                hashCode += CardNonce.GetHashCode();
            }

            if (CustomerCardId != null)
            {
                hashCode += CustomerCardId.GetHashCode();
            }

            if (DelayCapture != null)
            {
                hashCode += DelayCapture.GetHashCode();
            }

            if (ReferenceId != null)
            {
                hashCode += ReferenceId.GetHashCode();
            }

            if (Note != null)
            {
                hashCode += Note.GetHashCode();
            }

            if (CustomerId != null)
            {
                hashCode += CustomerId.GetHashCode();
            }

            if (BillingAddress != null)
            {
                hashCode += BillingAddress.GetHashCode();
            }

            if (ShippingAddress != null)
            {
                hashCode += ShippingAddress.GetHashCode();
            }

            if (BuyerEmailAddress != null)
            {
                hashCode += BuyerEmailAddress.GetHashCode();
            }

            if (OrderId != null)
            {
                hashCode += OrderId.GetHashCode();
            }

            if (AdditionalRecipients != null)
            {
                hashCode += AdditionalRecipients.GetHashCode();
            }

            if (VerificationToken != null)
            {
                hashCode += VerificationToken.GetHashCode();
            }

            return(hashCode);
        }
        private void DisplayResult(PaymentMethodNonce paymentMethodNonce, string deviceData)
        {
            mNonce = paymentMethodNonce;
            //mPaymentMethodType = PaymentMethodType.ForType(mNonce);

            //mPaymentMethodIcon.SetImageResource(PaymentMethodType.ForType(mNonce).Drawable);
            mPaymentMethodTitle.Text       = paymentMethodNonce.TypeLabel;
            mPaymentMethodDescription.Text = paymentMethodNonce.Description;
            mPaymentMethod.Visibility      = Android.Views.ViewStates.Visible;

            mNonceString.Text       = GetString(Resource.String.nonce) + ": " + mNonce.Nonce;
            mNonceString.Visibility = Android.Views.ViewStates.Visible;

            string details = "";

            if (mNonce is CardNonce)
            {
                CardNonce cardNonce = (CardNonce)mNonce;

                details  = "Card Last Two: " + cardNonce.LastTwo + "\n";
                details += "3DS isLiabilityShifted: " + cardNonce.ThreeDSecureInfo.IsLiabilityShifted + "\n";
                details += "3DS isLiabilityShiftPossible: " + cardNonce.ThreeDSecureInfo.IsLiabilityShiftPossible;
            }
            else if (mNonce is PayPalAccountNonce)
            {
                PayPalAccountNonce paypalAccountNonce = (PayPalAccountNonce)mNonce;

                details  = "First name: " + paypalAccountNonce.FirstName + "\n";
                details += "Last name: " + paypalAccountNonce.LastName + "\n";
                details += "Email: " + paypalAccountNonce.Email + "\n";
                details += "Phone: " + paypalAccountNonce.Phone + "\n";
                details += "Payer id: " + paypalAccountNonce.PayerId + "\n";
                details += "Client metadata id: " + paypalAccountNonce.ClientMetadataId + "\n";
                details += "Billing address: " + formatAddress(paypalAccountNonce.BillingAddress) + "\n";
                details += "Shipping address: " + formatAddress(paypalAccountNonce.ShippingAddress);
            }
            else if (mNonce is AndroidPayCardNonce)
            {
                AndroidPayCardNonce androidPayCardNonce = (AndroidPayCardNonce)mNonce;

                details  = "Underlying Card Last Two: " + androidPayCardNonce.LastTwo + "\n";
                details += "Email: " + androidPayCardNonce.Email + "\n";
                details += "Billing address: " + formatAddress(androidPayCardNonce.BillingAddress) + "\n";
                details += "Shipping address: " + formatAddress(androidPayCardNonce.ShippingAddress);
            }
            else if (mNonce is VenmoAccountNonce)
            {
                VenmoAccountNonce venmoAccountNonce = (VenmoAccountNonce)mNonce;

                details = "Username: "******"Device Data: " + deviceData;
            mDeviceData.Visibility = Android.Views.ViewStates.Visible;

            mAddPaymentMethodButton.Visibility = Android.Views.ViewStates.Gone;
            mPurchaseButton.Enabled            = true;
        }