Copied to clipboard

Flag this post as spam?

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


  • Keith Donnell 82 posts 187 karma points
    May 20, 2015 @ 21:23
    Keith Donnell
    0

    Opening an order with a $0 balance

    We have a "free sample" product we need to implement.  If this is the only product that is in the cart/basket, the shipping total will be $0 and taxes will be $0.  Since we don't need to charge the customer, we skip the CC info step, and we have that all wired up, but I'm having trouble figuring out a way to open the order/invoice without calling preparation.AuthorizeCapturePayment().

    Things I've tried:

    *  Calling preparation.AuthorizeCapturePayment with just the paymentMethodKey.  This bombs out, likely because it's expecting certain arguments that are missing (CC info)

    *  Calling preparation.PrepareInvoice().  This creates the invoice, but the invoice appears as "Unpaid" in the dashboard.

     

    Is there any way to accomplish this?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 20, 2015 @ 21:37
    Rusty Swayne
    1

    You could enable the cash provider, not offer it as a payment method in your UI and then apply (AuthorizeCapture) a cash payment of $0. Would that do it?

  • Keith Donnell 82 posts 187 karma points
    May 20, 2015 @ 22:01
    Keith Donnell
    0

    @Rusty Good idea - I'll give that a shot.

  • Keith Donnell 82 posts 187 karma points
    May 20, 2015 @ 22:19
    Keith Donnell
    0

    @Rusty I enabled the Cash provider, but GetPaymentGatewayMethods() is still returning only Stripe.  Tried touching web.config, and still no dice.  Any ideas?

    Edit: My apologies.  I enabled the provider, but didn't add the method :/

  • Keith Donnell 82 posts 187 karma points
    May 20, 2015 @ 22:26
    Keith Donnell
    0

    Everything appears to have worked.  Thanks again.

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Jul 16, 2015 @ 12:01
    Biagio Paruolo
    0

    How have you done? Could you share the code with other peoples, please?

  • Keith Donnell 82 posts 187 karma points
    Jul 16, 2015 @ 13:55
    Keith Donnell
    0

    @Biagio We no longer have the code in our project, as we removed the promotional functionality that caused the order balance to be $0. However, we just needed to enable and configure the cash provider, and when we loaded the payment screen, we bypassed credit card info if balance <= $0 (and display the order summary with something like "Click continue to complete your order"). Then when that page was submitted, we would again check the balance - if $0, then use the cash provider.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 20, 2015 @ 22:32
    Rusty Swayne
    0

    Awesome! Thanks for letting me know you got it.

Please Sign in or register to post replies

Write your reply to:

Draft