Background:
Doing a website for a client and I've never used authorize.net before as a processor, but I am very familiar with WordPress and WooCommerce.
What I did:
Accecpt.js Error:
Initially, my goal was to figure out why the processing time was so long and to do that, I was going to simply buy another test product and see what the console or debug log said while it was processing.
This time I used a different browser to see if it was equally slow. I chose Waterfox and went to the site and tried to buy the same test product. After clicking submit I got the error:
Accept.js Error: payment nonce is missing Accept.js Error: payment descriptor is missing
In the WooCommerce status Log it says:
11-29-2018 @ 03:12:41 - Accept.js Error: payment nonce is missing 11-29-2018 @ 03:12:41 - Accept.js Error: payment descriptor is missing 11-29-2018 @ 03:15:17 - Accept.js Error: payment nonce is missing 11-29-2018 @ 03:15:17 - Accept.js Error: payment descriptor is missing 11-29-2018 @ 03:24:45 - Accept.js Error: payment nonce is missing 11-29-2018 @ 03:24:45 - Accept.js Error: payment descriptor is missing 11-29-2018 @ 04:07:30 - Accept.js Request: Array ( [authData] => Array ( [clientKey] => **** [apiLoginID] => **** ) [cardData] => Array ( [cardNumber] => **************** [month] => * [year] => **** [cardCode] => *** ) )
(It had the last 4 of my card, and the year/month but I changed them to asterisks for this post)
And in the Waterfox Debugger:
ReferenceError: Accept is not defined [Learn More] a2ab3bcc-dc41-4c56-a422-7671017d496c.js:2:
the a2ab was a link to a page that said this:
/**handles:wc-authorize-net-cim**/
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_createClass=function(){function r(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,a){return t&&r(e.prototype,t),a&&r(e,a),e}}();function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(){var a=[].indexOf;jQuery(document).ready(function(r){return window.WC_Authorize_Net_CIM_Credit_Card_Accept_JS_Handler=function(){function e(){var a=this;_classCallCheck(this,e),this.params=window.wc_authorize_net_cim_params,void 0!==this.params&&this.params.accept_js_enabled&&(r(document.body).on("sv_wc_payment_form_valid_payment_data",function(e,t){return a.init(e,t)}),r(document.body).on("checkout_error",function(){return r("input[name=wc-authorize-net-cim-credit-card-payment-nonce]").val("")}),r(document.body).on("updated_checkout",function(){return a.handle_saved_payment_methods()}))}return _createClass(e,[{key:"init",value:function(e,t){if(this.payment_form=t.payment_form,this.errors=[],"authorize_net_cim_credit_card"===this.payment_form.id&&!this.payment_form.saved_payment_method_selected&&t.passed_validation)return!this.payment_form.payment_fields.find("input[name=wc-authorize-net-cim-credit-card-payment-nonce]").length||(!!this.has_nonce()||(this.dispatch_card(),!1))}},{key:"dispatch_card",value:function(){var e,t=this;return this.payment_form.block_ui(),e=this.get_request_data(),this.log_request(e),Accept.dispatchData(e,function(e){return t.handle_response(e)})}},{key:"get_request_data",value:function(){var e,t,a;return a=r.payment.cardExpiryVal(r("input[name=wc-authorize-net-cim-credit-card-expiry]").val()),t={authData:{clientKey:this.params.client_key,apiLoginID:this.params.login_id},cardData:{cardNumber:r("input[id=wc-authorize-net-cim-credit-card-account-number]").val().replace(/-|\s/g,""),month:a.month.toString(),year:a.year.toString()}},null!=(e=this.payment_form.payment_fields.find("input[id=wc-authorize-net-cim-credit-card-csc]").val())&&this.payment_form.csc_required&&(t.cardData.cardCode=e),t}},{key:"handle_response",value:function(e){var t,a,r,n;if(this.log_response(e),"Error"!==e.messages.resultCode)return this.set_nonce(e.opaqueData.dataValue,e.opaqueData.dataDescriptor),this.payment_form.form.submit();for(t=0,a=(n=e.messages.message).length;t<a;t++)r=n[t],this.handle_error(r.code,r.text);return this.payment_form.render_errors(this.errors),this.payment_form.unblock_ui()}},{key:"set_nonce",value:function(e,t){var a;return r("input[name=wc-authorize-net-cim-credit-card-payment-nonce]").val(e),r("input[name=wc-authorize-net-cim-credit-card-payment-descriptor]").val(t),a=r("input[id=wc-authorize-net-cim-credit-card-account-number]").val(),r("input[name=wc-authorize-net-cim-credit-card-card-type]").val(r.payment.cardType(a)),r("input[name=wc-authorize-net-cim-credit-card-last-four]").val(a.slice(-4))}},{key:"handle_error",value:function(e,t){switch(console.log("Authorize.Net CIM Error: "+t+" ("+e+")"),e){case"E_WC_05":t=this.payment_form.params.card_number_invalid;break;case"E_WC_06":case"E_WC_07":case"E_WC_08":case"E00073":t=this.payment_form.params.card_exp_date_invalid;break;case"E_WC_15":t=this.payment_form.params.cvv_length_invalid;break;default:t=this.params.general_error}if(a.call(this.errors,t)<0)return this.errors.push(t)}},{key:"has_nonce",value:function(){return r("input[name=wc-authorize-net-cim-credit-card-payment-nonce]").val()}},{key:"handle_saved_payment_methods",value:function(){var t;return t="js-sv-wc-payment-gateway-credit-card-form-csc",r("input.js-wc-authorize-net-cim-credit-card-payment-token").change(function(){var e;return e=r("#wc-authorize-net-cim-credit-card-credit-card-form"),r("input.js-wc-authorize-net-cim-credit-card-payment-token:checked").val()?(e.hide(),r("#wc-authorize-net-cim-credit-card-csc").removeClass(t)):(r("#wc-authorize-net-cim-credit-card-csc").addClass(t),e.show())})}},{key:"log_request",value:function(e){var t;return(t=this.clone_log_data(e)).cardData&&(t.cardData.cardNumber&&(t.cardData.cardNumber=t.cardData.cardNumber.replace(/\d(?=\d{4})/g,"*")),t.cardData.cardCode&&(t.cardData.cardCode=t.cardData.cardCode.replace(/[0-9]/g,"*"))),this.log_data(t,"request")}},{key:"log_response",value:function(e){return this.log_data(e,"response")}},{key:"clone_log_data",value:function(e){var t,a;if(null==e||"object"!==(void 0===e?"undefined":_typeof(e)))return e;for(t in a={},e)a[t]=this.clone_log_data(e[t]);return a}},{key:"log_data",value:function(e,t){var a;if(this.params.ajax_log)return a={action:"wc_"+this.payment_form.id+"_log_js_data",security:this.params.ajax_log_nonce,type:t,data:e},r.ajax({url:this.params.ajax_url,data:a})}}]),e}(),window.wc_authorize_net_cim_credit_card_accept_js_handler=new WC_Authorize_Net_CIM_Credit_Card_Accept_JS_Handler})}).call(void 0);
SyntaxError: expected expression, got '<' [Learn More] 16cccc12-23c7-48fb-9cd4-962219b619cc.js:2
the 16cccc was a link to a page that said this:
/**handles:wc-authorize-net-cim-accept-js**/ <HTML><HEAD> <TITLE>Access Denied</TITLE> </HEAD><BODY> <H1>Access Denied</H1> You don't have permission to access "http://js.authorize.net/v1/Accept.js" on this server.<P> Reference #18.55ef2e17.1543452988.a3018302 </BODY> </HTML>
The WooCommerce doc says you literally just need to create a client key, and then put the other credentials in and you're good to go. It worked yesterday... it took a while but it still went through.
Other Things I Tried:
I thought i'd post something here, but obviously my next step would probably be to contact woocommerce.
Any help would be greatly apprecitated.
Also, I did go and make a developer account.
โ11-28-2018 10:17 PM
Update:
It works if I turn off accept.js, but I still want to have it on.
โ11-29-2018 05:25 AM
How do you turn off Accept.js ? I'm having the same issue.
โ06-13-2019 02:01 PM