Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vitaly Vasilega 62 posts 184 karma points
    Dec 17, 2014 @ 19:40
    Vitaly Vasilega
    0

    How to create the invoice, if all of the providers I only use Notification Provider?

    Hi everyone!

    I understand that it's a little strange, but at the moment I need a shop that can only send notifications without payment.

    I can't find an example that I made it possible to create an invoice with only the values in the "Address".

    Thanks!

     

  • DFBerry 53 posts 130 karma points
    Dec 17, 2014 @ 19:44
    DFBerry
    0

    Hi Vitaly,

    I would like to learn more about your workflow. Your customer puts items in the basket/cart and finalizes the purchasem creating an invoice. Then you want to send a notification prior to payment of the invoice (whilte status is cancelled or unpaid or partial). Is that the correct workflow?

    -Dina

     

  • Vitaly Vasilega 62 posts 184 karma points
    Dec 17, 2014 @ 19:59
    Vitaly Vasilega
    0

    Hi Dina,

    Workflow will be as follows:

    1. The user adds products to cart

    2. Then the user navigates to a basket and confirms that all products in the cart it is ready to buy.

    3. At the checkout page, the user fills in the following fields: name, phone number, email address and confirm your purchase.

    After the third step, I must send a notice to the client with a list of products, and the administrator of the site that created a new invoice.

    At the moment, will not be online payment through the website, the site owner will contact the customer by phone and will take the products to the customer. Payment will be in cash at the meeting.

     

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 17, 2014 @ 20:09
    Rusty Swayne
    100

    Hi Vitaly,

    I'd love to know the use case for this ... sounds super interesting.

      // start with the Invoice Service
      var invoiceService = MerchelloContext.Current.Services.InvoiceService;
    
      // Create an unpaid invoice status (or use whatever status appropriate)
      var invoiceStatus = invoiceService.GetInvoiceStatusByKey(Merchello.Core.Constants.DefaultKeys.InvoiceStatus.Unpaid);
    
    
      var billingAddress = [your address as IAddress];
    
      var invoice = invoiceService.CreateInvoice(invoiceStatus.Key);
    
      invoice.SetBillingAddress(billingAddress);
    
      // if you have products - loop through them and add them as line itesm
      foreach(var product in productsArray)
      {
             var extendedData = new ExtendedDataCollection();
             var variant = product.GetProductVariantForPurchase();
             extendedData.AddProductVariantValues(variant);
             var lineItem = new InvoiceLineItem(LineItemType.Product, product.Name, product.Sku, 1, price, extendedData);
             invoice.Items.Add(lineItem);
      }
    
      // you would add a shipping line item if applicable (let me know if you need this one - tricky to do without providers)
      // you would add a tax line item too if applicable
    
      invoice.Total = invoice.Items.Sum(x => x.TotalPrice);
    
      // optional stuff
      // invoice.PoNumber = [your PO Number]
      // invoice.InvoiceNumberPrefix = [prefix for the invoice number]
    
      invoiceService.Save(invoice);
    
      // Updates the sales history (not required)
      invoice.AuditCreated();
    
  • Vitaly Vasilega 62 posts 184 karma points
    Dec 17, 2014 @ 20:21
    Vitaly Vasilega
    0

    Hi Rusty,

    Quite simply, we are from Russia and we have no possibility to use any payment provider.

    This provider need to write yourself, but it's not simple.

    For Umbraco no e-commerce package, which would have this capability out of the box. 

    If not Merchello, I would have to write custom e-commerce package. But he would not be as good as Merchello.

    Thank you for a piece of code will check tomorrow.

    Good luck.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 17, 2014 @ 20:33
    Rusty Swayne
    0

    HI Vitaly,

    You might consider using the default Cash Payment provider - it should work where ever. Depending on how you are using the notifications to handle your payment, I'll bet there is a way to come up with a workflow to make it "automated".

    Let me know if you want to chat about it.

    Thanks,

    Rusty

  • Vitaly Vasilega 62 posts 184 karma points
    Dec 17, 2014 @ 20:36
    Vitaly Vasilega
    0

    Hi Rusty,

    Thanks for the tip, I'll try to understand.

  • Vitaly Vasilega 62 posts 184 karma points
    Dec 17, 2014 @ 20:40
    Vitaly Vasilega
    0

    To me it is very important that you have fixed the ticket of M-520. But you  ignore it. Why?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 17, 2014 @ 21:00
    Rusty Swayne
    0

    Hi Vitaly - I don't mean to make it seem like I am ignoring it, I just have not had time to get to it yet as I have other things due as well. I will bump it up on my to do list ...

    Is this the only place you've seen where saving Russian works is an issue or is is systemic?

  • Vitaly Vasilega 62 posts 184 karma points
    Dec 18, 2014 @ 16:12
    Vitaly Vasilega
    0

    Hi Rusty,

    At the moment this is the only place. But how come some free time, I will test other parts Merchello.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 18, 2014 @ 17:49
    Rusty Swayne
    0

    Thanks Vitaly - Let's continue this discussion on the issue - http://issues.merchello.com/youtrack/issue/M-520

Please Sign in or register to post replies

Write your reply to:

Draft