Example #1
0
 public static PaypalPaymentRequestDTO DirectCcToken2PaypalPaymentRequestDto(this PaypalCreditCardPaymentDTO dto, int userId, Guid requestId, BillingEnums.ePaypalRequestTypes type)
 {
     return(new PaypalPaymentRequestDTO
     {
         ReuqstId = requestId
         , UserId = userId
         , PaymentMethod = BillingEnums.ePaymentMethods.Credit_Card
         , PaypalRequestType = type
         , Amount = dto.amount
         , PriceLineId = dto.priceLineId
         , CourseId = dto.courseId
         , BundleId = dto.bundleId
         , TrackingID = dto.trackingId
         , AddressId = dto.addressId
         , PaymentInstrumentId = dto.paymentInstrumentId
         , CouponCode = dto.couponCode
     });
 }
Example #2
0
        public static Payer CreditCard2RestApiPayer(this PaypalCreditCardPaymentDTO dto, string payerEmail)
        {
            var creditCard = dto.card.CreditCardDto2RestApiCreditCard();

            var fundInstrument = new FundingInstrument {
                credit_card = creditCard
            };

            var fundingInstrumentList = new List <FundingInstrument> {
                fundInstrument
            };

            return(new Payer
            {
                funding_instruments = fundingInstrumentList,
                payment_method = BillingEnums.ePaymentMethods.Credit_Card.EnumToLowerString(),
                payer_info = new PayerInfo
                {
                    email = payerEmail
                }
            });
        }