コード例 #1
0
        /// <summary>
        /// Creates the single transactionItem.
        /// </summary>
        /// <param name="transactionItem">The transactionItem.</param>
        /// <param name="transactionId">The transactionItem identifier.</param>
        /// <returns></returns>
        private PayPalTransactionItem CreateSingleTransaction(PayPal3dPartyTransactionItem transactionItem, int transactionId)
        {
            var feeAmount   = CurrencyConverter.ConvertToGBP(transactionItem.FeeAmount, transactionItem.Created ?? default(DateTime));
            var grossAmount = CurrencyConverter.ConvertToGBP(transactionItem.GrossAmount, transactionItem.Created ?? default(DateTime));
            var netAmount   = CurrencyConverter.ConvertToGBP(transactionItem.NetAmount, transactionItem.Created ?? default(DateTime));

            return(new PayPalTransactionItem {
                Created = transactionItem.Created,
                PayPalTransactionId = transactionItem.PayPalTransactionId,
                Status = transactionItem.Status,
                TimeZone = transactionItem.TimeZone,
                FeeAmount = feeAmount.Amount,
                GrossAmount = grossAmount.Amount,
                NetAmount = netAmount.Amount,
                CurrencyId = 164, //GBP //TODO: some normal way
                TransactionId = transactionId,
                Type = transactionItem.Type
            });
        }