Hey Josef, I've never worked with a payment provider using cartridge that gives you tokens (I think I understand the concept though). After the javascript gives you the token I would just add it as a hidden field on the form.
Check out https://groups.google.com/forum/#!topic/mezzanine-users/DQX3K3jdojE for details on creating a custom order form. Besides that you would probably override and add the javascript too https://bitbucket.org/stephenmcd/cartridge/src/28b995b9e2e25e40d2f926c0b498affb58160f6e/cartridge/shop/templates/shop/billing_shipping.html?at=default . Good luck! On Fri, Aug 8, 2014 at 5:41 AM, Josef <[email protected]> wrote: > Hi Mario, > > How do you handle token creation? My understanding is that 2co.js is used > but form the checkout page, it only gets the token on submit (am I right?) > so the token is only available on the next page, but that means the process > is done. Instead, what should happen is that the token is used together > with the transaction details on submit, but I don't have the token yet > before going to SHOP_HANDLER_PAYMENT. > > How did you go about this? > > Thanks f > > > On Friday, August 8, 2014 2:44:36 PM UTC+8, Mario Gudelj wrote: > >> Hi Josef, >> >> I had to do this recently, and this is what I've found. >> >> Inside shop.views.py there's a view called checkout_steps >> >> The views.py also has this on top: >> >> payment_handler = handler(settings.SHOP_HANDLER_PAYMENT) >> >> If you don't set settings.SHOP_HANDLER_PAYMENT Mezza Gezza will use >> default processor. >> >> However, you can set this to for example SHOP_HANDLER_PAYMENT = >> 'cartridge.shop.payment.authorizenet.process' in your settings.py >> >> For 2chouckout you could create a file inside cartridge.shop.payment >> called two_checkout.py and create process() method in it with this >> signature: >> >> def process(request, order_form, order): >> # do your payment processing here >> >> The form and order data will be passed to your method automatically from >> checkout_steps view. >> >> For the rest of it follow auth.net code. It's pretty straight forward. >> >> Post again if you need further help. >> >> Cheers, >> >> Mario >> >> >> >> >> >> On Fri, Aug 8, 2014 at 3:59 PM, Stevo <[email protected]> wrote: >> >>> Hi Josef, >>> >>> Sorry I can't help you and I guess the others are busy, but I was >>> pointed to these links which were helpful: >>> http://effectivedjango.com/tutorial/getting-started.html >>> http://bscientific.org/blog/mezzanine-fabric-git-vagrant-joy/. >>> http://nerds.airbnb.com/testing-at-airbnb/. >>> http://www.rosslaird.com/blog/first-steps-with-mezzanine/ >>> Good luck with it. >>> Regards, >>> >>> On Thursday, August 7, 2014 6:48:37 PM UTC+10, Josef wrote: >>>> >>>> Hi all! >>>> >>>> I'm exploring 2checkout <https://github.com/2Checkout/2checkout-python> as >>>> the payment gateway for Cartridge. Could you point me to how I could go >>>> about this and navigate through the Mezzanine/Cartridge code? Where should >>>> I begin or how should I go about this? I still haven't wrapped my head >>>> around how to integrate them. >>>> >>>> I'm new to Django so please be gentle. :) >>>> >>>> Thanks, >>>> Josef >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Mezzanine Users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> >> Mario Gudelj >> M: 0415 193775 >> >> www.twoblokeswithapostie.com - Talk to us before you tell your clients: >> "No, Business Catalyst can't do that." >> > -- > You received this message because you are subscribed to the Google Groups > "Mezzanine Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
