Closed branb closed 5 years ago
In a stock Magento, I found this object to be created in opcheckout.js:
Our plugin needs to know when the customer has clicked the "Continue" button of some sort to start tokenization of the credit card, for instance.
Maybe you can work around that and trigger payone.exec somewhere else?
Thanks for your reply.
Ok, that sounds doable.
Can you give me a simple outline of what the payone object needs to do it's job?
How do I tell it where the data from the form (input fields, there is no real form...) is located and how does it map / read the input fields?
Is payone.exec all that needs to be executed? How do I check if it succeeded?
As far as I've understood it, I'd have to do:
From what I see (I'm no JS expert), payone.exec handles everything, provided the environment is as it expects it to be (which might be the tricky part). It collects the credit card data from the iFrames and writes the token back.
Following https://github.com/PAYONE-GmbH/magento-1/blob/master/js/payone/core/creditcard.js#L40 we, however, somewhat rely on payment.save() from the classic one page checkout, so I'm not entirely sure what else is needed to emulate this environment.
Allright. Thx so far, I'll give it a try
We've taken over an already running Magento 1.9.3.6 Shop, which has a custom onepage checkout solution. I'm still in the process of figuring out if the whole module is custom coded or just an adjustment of an existing module.
Right now, there seems to be no "payment" object in the DOM, which the payone module references at one point with this code:
which is found in the template file
app/design/frontend/base/default/template/payone/core/checkout/onepage/init.phtml
Obviously, this expects a payment object to exist already, but this is not the case in our checkout module. Do you or anyone else reading this have any experience with that case?
We are offering other payments on checkout, e.g. BillPay, Bank Transfer, PayPal etc., and these don't seem to depend on the payment object to exist.