Ejemplo n.º 1
0
        private async Task <CreditCard> Tokenize(OrderCloudIntegrationsCreditCardToken card, string userToken)
        {
            var userCurrency = await _hsExchangeRates.GetCurrencyForUser(userToken);

            var auth = await _cardConnect.Tokenize(CardConnectMapper.Map(card, userCurrency.ToString()));

            return(CreditCardMapper.Map(card, auth));
        }
Ejemplo n.º 2
0
        public static CardConnectAccountRequest Map(OrderCloudIntegrationsCreditCardToken card, string currency)
        {
            var acct = new CardConnectAccountRequest()
            {
                currency = currency,
                account  = card.AccountNumber
            };

            return(acct);
        }
Ejemplo n.º 3
0
        public static CardConnectCreditCard Map(OrderCloudIntegrationsCreditCardToken card, CardConnectAccountResponse response)
        {
            var cc = new CardConnectCreditCard()
            {
                CardType             = card.CardType,
                CardholderName       = card.CardholderName,
                ExpirationDate       = card.ExpirationDate.ToDateTime(),
                PartialAccountNumber = card.AccountNumber.ToCreditCardDisplay(),
                Token = response.token,
                xp    = new CreditCardXP
                {
                    CCBillingAddress = card.CCBillingAddress
                }
            };

            return(cc);
        }
Ejemplo n.º 4
0
        public async Task <BuyerCreditCard> MeTokenizeAndSave(OrderCloudIntegrationsCreditCardToken card, VerifiedUserContext user)
        {
            var buyerCreditCard = await _oc.Me.CreateCreditCardAsync(await MeTokenize(card, user.AccessToken), user.AccessToken);

            return(buyerCreditCard);
        }
Ejemplo n.º 5
0
        public async Task <CreditCard> TokenizeAndSave(string buyerID, OrderCloudIntegrationsCreditCardToken card, VerifiedUserContext user)
        {
            var creditCard = await _oc.CreditCards.CreateAsync(buyerID, await Tokenize(card, user.AccessToken), user.AccessToken);

            return(creditCard);
        }
Ejemplo n.º 6
0
        public async Task <BuyerCreditCard> MeTokenizeAndSave(OrderCloudIntegrationsCreditCardToken card, DecodedToken decodedToken)
        {
            var buyerCreditCard = await _oc.Me.CreateCreditCardAsync(await MeTokenize(card, decodedToken.AccessToken), decodedToken.AccessToken);

            return(buyerCreditCard);
        }
Ejemplo n.º 7
0
        public async Task <CreditCard> TokenizeAndSave(string buyerID, OrderCloudIntegrationsCreditCardToken card, DecodedToken decodedToken)
        {
            var creditCard = await _oc.CreditCards.CreateAsync(buyerID, await Tokenize(card, decodedToken.AccessToken), decodedToken.AccessToken);

            return(creditCard);
        }