Ejemplo n.º 1
0
        public static void Create(MarketplaceMember buyer, int quantity, MarketplaceProduct product)
        {
            MarketplaceIPN IPN = new MarketplaceIPN(buyer.Id, quantity, product.Id, buyer.DeliveryAddress, buyer.Email);

            IPN.Save();

            SendEmailNotification(buyer, product.Title, IPN.Hash);
        }
Ejemplo n.º 2
0
        private static void ConfirmIPN(MarketplaceIPN ipn)
        {
            MarketplaceProduct product = new MarketplaceProduct(ipn.ProductId);
            Member             seller  = new Member(product.SellerId);

            if (ipn.Status == MarketplaceIPNStatus.Pending)
            {
                ipn.Status = MarketplaceIPNStatus.Confirmed;
                ipn.Save();

                seller.AddToPurchaseBalance(ipn.ProductQuantity * product.Price, "Marketplace sale", BalanceLogType.MarketplaceSale);
                seller.SaveBalances();
            }
        }