Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Umbraco developers,
We solve problem with crash, now we have worked PayPal payment. But,
Orders doesn't appears in ucommerce admin part,
Code of order creation :
catalog = ProductCatalog.Get(catalogId); SiteContext.Current.CatalogContext.CurrentCatalogName = catalog.Name; Product product = Product.Get(Convert.ToInt32(e.CommandArgument)); Basket basket = SiteContext.Current.OrderContext.NewBasket(Currency.FirstOrDefault(x => x.ExchangeRate == 100)); PurchaseOrder purchaseOrder = basket.PurchaseOrder; purchaseOrder.AddProduct(catalog, product, 1); var userService = new UserService(); var profile = userService.GetCurrentUserProfile(); Library.ExecuteBasketPipeline(); var address = purchaseOrder.BillingAddress ?? new OrderAddress(); address.AddressName = "Billing"; address.FirstName = profile.FirstName; address.LastName = profile.LastName; address.EmailAddress = profile.UserName; address.PhoneNumber = profile.PhoneNumber; address.MobilePhoneNumber = "mobilePhoneNumber"; address.CompanyName = "company"; address.Line1 = "line1"; address.Line2 = "line2"; address.PostalCode = profile.Zip; address.City = profile.City; address.State = profile.State; address.Country = Country.FirstOrDefault(x => x.Name == "Great Britain"); address.PurchaseOrder = purchaseOrder; Customer customer = Customer.Create(address); purchaseOrder.Customer = customer; purchaseOrder.BillingAddress = address; purchaseOrder.Save(); // Saves cascade to children, so the address is saved as well var paymentMethod = PaymentMethod.All().Single(x => x.Name == "PayPal"); var service = paymentMethod.GetPaymentMethodService(); var paymentFactory = paymentMethod.GetPaymentMethodService() as IPaymentFactory; Payment payment = paymentFactory.CreatePayment(new PaymentRequest(purchaseOrder, paymentMethod, new Money(purchaseOrder.OrderTotal.Value, purchaseOrder.BillingCurrency))); payment.Save(); payment = service.RequestPayment(new PaymentRequest(purchaseOrder, paymentMethod, new Money(purchaseOrder.OrderTotal.Value, purchaseOrder.BillingCurrency)));
Please help us ))
Thanks,
Alexandr
Hi Alex,
Did you find an answer to this?
Fab
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
PayPal payment
Hi Umbraco developers,
We solve problem with crash, now we have worked PayPal payment. But,
Orders doesn't appears in ucommerce admin part,
Code of order creation :
Please help us ))
Thanks,
Alexandr
Hi Alex,
Did you find an answer to this?
Thanks,
Fab
is working on a reply...