Closed CupNoodles closed 3 years ago
FWIW, I've used the new web-payments SDK for https://github.com/CupNoodles/ti-ext-squaregiftcards and can confirm that it works, integrates just fine etc.
@sampoyigi I may be able to make a PR that ports us to the new js SDK, but I'm wondering if you have a preference between creating a new omnipay gateway and folding that into payregister, or dropping omnipay for this and just making payregister compatible with the new SDK.
That would be valuable. Omniway appears to be slowing down as we must wait for the maintainer to merge and tag releases, so we might as well switch to native SDK. So yup let's drop omnipay and simply use the SDK.
As it turns out I was able to update my own https://github.com/CupNoodles/ti-ext-squarebyweight/tree/modal-custom just by switching over the javascript, since the deprecation notice is about the js SDK and not the API. That one isn't a drop-in replacement since our theme uses modal dialogs for payment, but it shouldn't be too difficult for me to make one for payregister that works with orange theme out of the box, while bypassing any conversation about omnipay.
@CupNoodles Any progress?
Yeah sorry, forked it at https://github.com/CupNoodles/ti-ext-payregister/commit/7653c7643a4f50be3432203301a326db295cc326 and it works, but I decided I didn't like the outcome so I haven't PRed it - will make a better one when I get a moment.
Basically the square SDK tutorials are into using only the async/await paradigm and avoiding jQuery callbacks, which I tried to do but then couldn't figure out a way to hook into the submitCheckoutForm
event without being in jQuery anyway, so now it's sort of a mishmash of styles that it doesn't need to be. Next crack at it will keep it as similar as possible to the other payregister js files.
I've made a PR for a more minimally invasive version of process.square.js at https://github.com/tastyigniter/ti-ext-payregister/pull/31
It's my first PR into any thing on the TI project so please let me know if I'm missing some testing steps, code standards, etc.
Done!
What happened?
Using payregister extension with sandbox credentials only with Cash on Delivery and Square payment methods enabled, clicking the square payment method shows this in the console:
What did you expect to happen?
It seems to be using the
sampoyigi/onmipay-square
package as opposed to thetransportersio/omnipay-square
listed on https://github.com/thephpleague/omnipay, but neither seems to have been updated to the new SDK.Version
3.0.5
What browser are you seeing the problem on?
No response
Relevant log output
No response