• Resolved jaydisc

    (@jaydisc)


    This plugin is a godsend, thank you. We were spending so much time tweaking the order-pay, order-received endpoints to make the official Woo eWay plugin look and work well, but it still caused customer friction (abandoned carts).

    Anywho, when I first set it up, I got the “Account not PCI Certified” error, so I went and tracked down the encryption key for both my regular account and sandbox account, and all is working well.

    EXCEPT…

    When a card is entered on Customer Payment Page (after we make the order internally and send them a link), I get the “Account not PCI Certified” error messages there. It’s as if part of the plugin isn’t loading in that context?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jaydisc

    (@jaydisc)

    I’ve done some digging… It would appear that the Customer Payment Page, UNLIKE the Checkout page, dose NOT run the submit handler in WC’s checkout.js file.

    Therefore, checkout.js never triggers the “checkout_place_order_eway_payments” hook, and thus, EPG’s ecrypt.js, which binds processFields to that hook, never runs processFields, and the fields never get encrypted.

    I tried to directly bind ecrypt.js’s processFields to the submit event on the differently named form on the Customer Payment page, by adding this ~line 213:

    $('form#order_review').on("submit", processFields);

    But processFields and some other functions rely on the checkout variable, so I had to update that too. So, in the end, I inserted these lines from ~line 212:

    if (checkout.length == 0)
    	{
    		console.log('No checkout form. Switching to #order_review');
    		checkout = $('form#order_review');
    		checkout.on("submit", processFields);
    	}

    In situ:

    switch (eway_ecrypt_vars.mode) {
        case "woocommerce":
          checkout.on("checkout_place_order_eway_payments", processFields);
          $(document.body).on("checkout_error", resetEncryptedFields);
    	  
    	if (checkout.length == 0)
    	{
    		console.log('No checkout form. Switching to #order_review');
    		checkout = $('form#order_review');
    		checkout.on("submit", processFields);
    	}
    	  
          break;

    This now enables field encryption on the Customer Payment page, but I suspect there might be a more elegant way to do this?

    Plugin Author webaware

    (@webaware)

    G’day jaydisc,

    Well, I’ve never done that before: manually create a WooCommerce order and pay from a link in an email. Did not know about it! Thanks for the bug report ??

    I’ve fixed it in the dev version, which you can download and try here:

    https://www.dropbox.com/s/ghdjeyaouf8ibn1/eway-payment-gateway-5.0.0-dev.zip?dl=1

    NB: this includes a big code refactor, so best if you can try it on a staging server first. Otherwise, be ready to revert to 4.5.1 if you have problems. I hope to release 5.0.0 by early next week, if not sooner.

    Here’s what I changed for the fix for this bug:

    https://github.com/webaware/eway-payment-gateway/commit/dbea519644c904c40cbcc7255e73fcf08d178317

    cheers,
    Ross

    Thread Starter jaydisc

    (@jaydisc)

    Awesome. Thank you. Can I get the dev version from GitHub? I don’t seem to see branches or any tags ~ 5.x though. Is it just the latest master?

    That fix looks great. Much cleaner.

    Plugin Author webaware

    (@webaware)

    The branch is called refactor:

    https://github.com/webaware/eway-payment-gateway/tree/refactor

    I haven’t merged into master yet, likely to do that in the next few days sometime and then release.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘“Account not PCI Certified”, but only on Customer Payment Page’ is closed to new replies.