Forums / Addon Payment Modules / zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Views: 5,237

Results 1 to 20 of 20
6 Feb 2020, 9:47 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

One of my clients, who uses the subject payment method, received the following communication:

Dear Payeezy Merchant,

Payeezy.JS/Payments.JS Version 1 is being sunset and all merchants using this version must upgrade to Version 2.

Two new forms have been created to assist with the migration effort. The first link contains a request for Integration Support for Payment.js v2. The second link includes a request for support decommissioning a payment.js/payeezy.js deployment upon completion of code and testing of their new implementation.

Does the zc156c version of the payment method still use the v1 interface?

7 Feb 2020, 10:26 PM
#2
elslozzo avatar

elslozzo

New Zenner

Join Date:
Feb 2008
Location:
Edmonton, AB
Posts:
60
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

One of my clients did too. This could be a high priority item since I don't see any open-source v2 plugins/implementations anywhere, including on payeezy's github. Did you (or anyone) "request PaymentJS Integration" yet? Maybe they send some php files?

7 Feb 2020, 10:34 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

ElSlozzo:

One of my clients did too. This could be a high priority item since I don't see any open-source v2 plugins/implementations anywhere, including on payeezy's github. Did you (or anyone) "request PaymentJS Integration" yet? Maybe they send some php files?
Assuming that *you *is me, I haven't seen any integrations; that's why I asked.

12 Feb 2020, 5:03 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

The module built-in to v1.5.6 is for Payments.js Version 1

Preliminary research into converting to v2 led to the choice to stop officially maintaining the module.
It has been removed from v1.5.7 in https://github.com/zencart/zencart/pull/2948

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Feb 2020, 10:03 PM
#5
elslozzo avatar

elslozzo

New Zenner

Join Date:
Feb 2008
Location:
Edmonton, AB
Posts:
60
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

For those interested this is the "sample PHP code" they have for using the payment API https://github.com/GBSEcom/paymentJS_php_integration.

The code includes js and css, not only in the repo but also in the iframes it injects on the checkout form. A file named field.css was even brought in and reset a bunch of my form elements. Also, it comes with its own required submit button. So from what I can tell, entering your payment details and proceeding to your own custom zen-cart confirm-your-order page isn't compatible with this version(?).

18 Apr 2020, 1:39 PM
#6
elslozzo avatar

elslozzo

New Zenner

Join Date:
Feb 2008
Location:
Edmonton, AB
Posts:
60
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Hello, just checking back in to see if anyone worked on this?

I have a working development version - however since the card processing results come in via a separate endpoint I had to work around the usual Zen Cart payment flow process. The accepted or declined transaction result comes in on a backend endpoint which needs to update the customer's transaction. This versus the usual Zen Cart flow of having the customer's payment go through a more rigid step-by-step process where you can use session variables and redirect if there's an issue.

I need to process and complete the Zen Cart order after results come into my endpoint from payeezy. This would be instead of the usual Zen Cart order processing flow in includes/modules/pages/checkout_process.php which uses methods like $payment_class->after_process() and ```
$payment_class->after_order_create()


I looked, can't find - docs in regards to payment modules. I have reviewed quite a few other payment modules to learn what's up while developing this solution but since there's no official docs for payment modules (I'm aware of) I can't feel 100% confident. (Maybe even though everything is fine). Bonus points if you know of a payment module that does this that I haven't reviewed. For example, I think the core ipn_main_handler.php has a similar process.

Question for the forum, which I may start a new thread with:
**Are there payment module *developer* docs?** I've just been reviewing and adapting other payment modules to get to my solution.

Also ,can anyone bullet point me what steps they know are required in the checkout process? I have been using includes/modules/pages/checkout_process.php as the guide as to what happens post-checkout for processing an order. This functionality has largely moved to my payment module class's **after_process() **function.

 For example:
- Upon successful transaction, new classes are created for the processing; order_total, order, payment, and shipping classes
- Need to run $payment_class->after_process() to update the order status history (and in my case save the results from Payeezy)
- Need to run $order->create_add_products()
- Next run $order->send_order_email($insert_id, 2);
- Empty out the customer's cart if the transaction was successful
- Save the "order_summary" so it can be used on the checkout success page  (Zen Cart saves this in session variables but that isn't an option here since results are processed outside of the customer's session)

Maybe it's simpler than I thought or maybe I'm missing something obvious. Any reply to this post is greatly appreciated. Sometimes it helps to just lay it all out anyway.
18 Apr 2020, 11:38 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

The "paypal.php" module ("PayPal Standard") works that way. It waits for PayPal to submit the postback IPN after the order is saved. You can use much of that module's structure as an example. And create your own payeezy2_handler.php. (Note that the ipn_main_handler.php also has a whole lot more code in it so that it can also support postbacks from PayPal Pro and Express Checkout, so you won't need all of that.)

Changes to normal workflow:

  • instead of before_process actually waiting for and verifying the payment was successful, it must assume the payment request was sent.
  • instead of setting order_status to "Processing" (meaning "paid and now in fulfillment stage"), it should use "Pending" (meaning not paid)
  • instead of after_process recording any payment confirmation details, that must be done in the postback handler
  • the postback handler would also update the order_status. It could also optionally notify the admin by sending the admin an email.

Most everything else operates as usual. Customer confirmation email still sends even though payment isn't confirmed. Cart still gets emptied. Basically let checkout_process.php do all its usual stuff -- unlikely any legit need to alter it or clone it anywhere.

No, there are no dev docs for this.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Apr 2020, 8:42 PM
#8
portraitartist avatar

portraitartist

New Zenner

Join Date:
Mar 2006
Posts:
86
Plugin Contributions:
0

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Is there any other payment module to replace Payeezy gateway(First Data) to accept credit card payments?
I am not very versed in coding so I hope there is one maintained by ZenCart.
Thank you for your time.

Our New Zen cart: https://www.EmbroideryPortraits.com/Gifts/
https://www.vodmochka.com/Embroidery_Designs
All critics and suggestions are welcome!

25 Apr 2020, 2:53 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

If you want to continue to use your FirstData account, the First Data Hosted Checkout Pages (firstdata_hco) module still works.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

1 May 2020, 2:03 AM
#11
adkinsdm avatar

adkinsdm

New Zenner

Join Date:
Feb 2011
Posts:
12
Plugin Contributions:
0

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Be careful of that Hosted Checkout process - I tried that first (before using the js version) and had a lot of trouble with customers never getting sent back. So they'd click again - and again - and again. Ended up having to do a fair handful of refunds and annoyed my customers in the process because they never got their product. The Payeezy developer support said it wasn't the first time he'd heard of that problem but he had no suggestions other than switch to using the js module. Now, that was about 2 years ago so it might work better now, but watch your admin and your Payeezy account carefully when you first enable it.

1 May 2020, 3:18 AM
#12
portraitartist avatar

portraitartist

New Zenner

Join Date:
Mar 2006
Posts:
86
Plugin Contributions:
0

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

adkinsdm:

Be careful of that Hosted Checkout process - I tried that first (before using the js version) and had a lot of trouble with customers never getting sent back. So they'd click again - and again - and again. Ended up having to do a fair handful of refunds and annoyed my customers in the process because they never got their product. The Payeezy developer support said it wasn't the first time he'd heard of that problem but he had no suggestions other than switch to using the js module. Now, that was about 2 years ago so it might work better now, but watch your admin and your Payeezy account carefully when you first enable it.
Thank you for the feedback. I used the js version from the start. It worked quite well until a couple of weeks ago, when an error come up if someone wanted to pay with a credit card. The payeezy customer service referred me to the ZenCart support to implement the new version. Since the new version is not supported by ZenCart, I am looking for a reliable. simple, affordable credit card processor. Fortunately PayPal is working, but I want to be able to offer the credit card option. I am looking into the SQUARE payment processor right now.

Our New Zen cart: https://www.EmbroideryPortraits.com/Gifts/
https://www.vodmochka.com/Embroidery_Designs
All critics and suggestions are welcome!

10 May 2020, 6:41 PM
#13
elslozzo avatar

elslozzo

New Zenner

Join Date:
Feb 2008
Location:
Edmonton, AB
Posts:
60
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Hi all,
I put together a version that will work with the new version of the PaymentsJS API. I extracted and tidies the results and put it into something that looks like a Zen Cart plugin. Any feedback no matter how small would be appreciated. Code reviews more than welcome:

https://github.com/ScotteSolutionsLtd/payeezyjsv2

14 May 2020, 5:53 AM
#14
fpbear avatar

fpbear

New Zenner

Join Date:
Jun 2008
Posts:
25
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Hi Scott, thanks much for developing the Payeezy 2 module. I'm trying to install but the file:

/includes/languages/english/modules/payment/payeezyjsv2.php

is missing from github.

Also I am not clear on the directory where auth.php and webhook.php is to be installed. Do these go in the root of the zencart / top level directory?

*Add the following line in your template's footer for pages that will have the credit card form:

require DIR_WS_MODULES . 'payment/payeezyjsv2/footer.inc';*

What is the simplest way to identify these template file(s) that need this include? Sometimes it is confusing to navigate the zencart template structure without being intimately familiar with zencart.

14 May 2020, 1:02 PM
#15
elslozzo avatar

elslozzo

New Zenner

Join Date:
Feb 2008
Location:
Edmonton, AB
Posts:
60
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Hi fpbear,
Sorry about the missing language file, that is now in the right place. I updated the github repo.

Yes auth.php and webhook.php go in the site root. Webhook.php will be the webhook you register with payeezy.

The lines in the *footer.inc *file need to load javascript in the footer of the pages that will have the credit card form. The file tpl_checkout_confirmation_default.php is the most likely candidate for the include. Put the line to include the footer.inc file near the bottom of that file. Hope that helps.

23 May 2020, 6:50 PM
#16
fpbear avatar

fpbear

New Zenner

Join Date:
Jun 2008
Posts:
25
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

ElSlozzo:

Hi fpbear,
Sorry about the missing language file, that is now in the right place. I updated the github repo.

Yes auth.php and webhook.php go in the site root. Webhook.php will be the webhook you register with payeezy.

The lines in the *footer.inc *file need to load javascript in the footer of the pages that will have the credit card form. The file tpl_checkout_confirmation_default.php is the most likely candidate for the include. Put the line to include the footer.inc file near the bottom of that file. Hope that helps.

Thanks ElSlozzo. Since I already had a Payeezy merchant account for the DrByte Payeezy module, I updated the webhook field in the existing merchant settings on the Payeezy developer site (hopefully that is sufficient for their registration process). But when I enable the payeezyjsv2 module, the billing address (address contents) and payment method (entire box) disappears from checkout_payment step. When I disable payeezyjsv2, the checkout payment page looks normal again. I am using the themeforest Alto premium multipurpose responsive theme template. Could this be due to interaction between the payment module and template design? Does the payeezyjsv2 module contain page rendering elements? I included the line for footer.inc but that did not make a difference.

26 May 2020, 4:47 PM
#17
elslozzo avatar

elslozzo

New Zenner

Join Date:
Feb 2008
Location:
Edmonton, AB
Posts:
60
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

The fields don't appear if their javascript isn't included. The fields are dependent on that JS being in the footer. That is the reason for the PHP include I put in the instructions.

One thing I'll have to add to the readme; check line #138 in the file includes/modules/payment/payeezyjsv2/client.js. The form I'm using here is #checkout_confirmation but yours may be different. If it is, edit the selector here and put in the one you're using.

As for their registration process, I had to call eventually after emailing [email protected] approximately 1100 times to get the account setup. I found that calling them is MUCH more productive, I probably won't ever email them again, just call.

In fact I setup a brand new gmail address because my emails to them kept bouncing back saying "User unknown". :blink:

They also have an online form to get the V2 processing setup: https://docs.firstdata.com/req/paymentjs so you could potentially start here however I found out after calling in (from 2 different people) that it doesn't even work.

Thanks for trying the module and I'll keep a closer eye on this thread in case you/anyone has more questions!

4 Jun 2020, 7:06 AM
#18
fpbear avatar

fpbear

New Zenner

Join Date:
Jun 2008
Posts:
25
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Thanks, still trying to make it work, I have 3 questions,

  1. On our site the checkout sequence is:
    Step 2 of 3: index.php?main_page=checkout_payment
    Step 3 of 3: index.php?main_page=checkout_confirmation
    The billing address and payment method disappears on Step 2 of 3, checkout_payment, when the module is enabled. Do I still need to edit line #138?

  2. I put this at the very end of template_checkout_payment_default.php:

<?php require DIR_WS_MODULES . 'payment/payeezyjsv2/footer.inc'; ?>

Is this the correct syntax to include the footer to allow the js to execute? That's what I put there originally.

  1. We had previously registered a live merchant account that we were using with the DrByte Payeezy module. On the Payeezy developer site I noticed that there is a webhook field that was blank, so I simply updated this field to reflect the webhook address. Is this sufficient to transition over to v2 on their backend, or do we still have to go through a separate v2 processing setup? I remember how difficult it was to get them to do the setup properly the first time around, so trying to avoid having to involve their tech support people again, if we can re-use our existing live merchant configuration.
5 Jun 2020, 2:13 PM
#19
elslozzo avatar

elslozzo

New Zenner

Join Date:
Feb 2008
Location:
Edmonton, AB
Posts:
60
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Hi fpbear,
On point 3 - ugh, I know. It is excessively painful. Hopefully if you get all setup what you can setup before involving them it'll be less painful. Yes, that is where you can add the webhook address but - you still have to call them and wait 1-3 business days to activate it :'( It won't work until *they *do it.

On point 1 - In theory yes, though I didn't test it, and thanks for reminding me I'm going to go back and update that.

If you change the return value of the in_special_checkout() function to **false, **around line #279 of payeezyjsv2.php, the payeezy payment form **should **show on step 2 before confirmation (step 3). But again this is untested and may require other alterations, such as changing the form name in the client.js file (line #138) and including the necessary javascript (using that line of PHP) in the step 2 template (checkout_payment).

When in_special_checkout() returns true which is the default, payment is captured on step 3. I had to roll with it this way because of them saying the API would be shut off soon and I needed it dealt with. Now I can go back and add the option to capture payment on step 2 or 3. Will post here when done.

On point 2 - Yes.

9 Jun 2020, 4:22 PM
#20
elslozzo avatar

elslozzo

New Zenner

Join Date:
Feb 2008
Location:
Edmonton, AB
Posts:
60
Plugin Contributions:
1

Re: zc156c/payeezyjszc: Payments.js Version 1 being sunsetted

Hi fpbear (or anyone using this module),
I have updated the module on Github, however it will require some real world testing. You can now change what template the credit card form goes on, so you can have it on checkout_confirmation OR checkout_payment. Make sure you uninstall the old version first or the new one won't install properly. It can be uninstalled before or after uploading the files as the uninstall procedure is the same, but make sure you do it.

Download from Github; https://github.com/ScotteSolutionsLtd/payeezyjsv2/archive/master.zip

Github
https://github.com/ScotteSolutionsLtd/payeezyjsv2