Hi,

I'm a developer working with a client who is adding Commerce using iATS to their existing Drupal 7 web site.

I'm using the "iATS Payments: Credit Card Payments" method.

I'm getting a "REJECT:40" error.

The credit card I'm using I tested while logged in to iATS on their web site and using the virtual terminal. The credit card processed without problem. So it isn't in fact a credit card problem.

Any ideas about where in the set-up I've got a problem?

Below is an export of the rule (of course I've changed the values for the client ID, the password, and the Post key)

{ "commerce_payment_iats_credit_card" : {
    "LABEL" : "iATS Payments: Credit card payment",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "TAGS" : [ "Commerce Payment" ],
    "REQUIRES" : [ "commerce_payment" ],
    "ON" : { "commerce_payment_methods" : [] },
    "DO" : [
      { "commerce_payment_enable_iats_credit_card" : {
          "commerce_order" : [ "commerce-order" ],
          "payment_method" : { "value" : {
              "method_id" : "iats_credit_card",
              "settings" : {
                "agent_code" : "3ABC80",
                "agent_password" : "blahagentpassword",
                "direct_post" : {
                  "enable_direct_post" : 1,
                  "process_key" : "blahbalhprocesskey"
                },
                "server" : "NA",
                "log" : { "request" : "request", "response" : "response" },
                "detailed_failure_message" : 1,
                "invoice_prefix" : "I-",
                "credit_card" : { "card_types" : {
                    "visa" : "visa",
                    "mastercard" : "mastercard",
                    "amex" : "amex",
                    "discover" : 0
                  }
                }
              }
            }
          }
        }
      }
    ]
  }
} 

(And FYI, I didn't use the installation profile. The site is an existing Drupal 7 site, so I did a manual Commerce install. I thought I'd try to get it to work on a fresh install with your install profile before coming here and posting a help request. But alas, as per the other issue, I ran into a segfault (after solving some of the other issues).
Thanks much for your help.

Shai

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Shai created an issue. See original summary.

Greg Boggs’s picture

The iATS test account returns accept and reject codes based on the Dollar amount you're sending for payment. A payment for $1 should go through. See:

http://home.iatspayments.com/developers/encrypted-swipe/testing

Shai’s picture

Greg, thanks.

I can't get a transaction to go through. And let me repeat that the specific credit card processed without any problem when using the iats virtual terminal.

Here is info provided at iATS (transaction ID and other private info has been doctored):

A123D6C7	1.00	VISA	John Smith	4***********8143		02/11/2016 14:21:31	REJ:40
Comment	   DrupalModule|7|iats_credit_card|commerce_payment_iats_credit_card|PA25D9CE

Here is information provided by Drupal:

I need help figuring out the next step in troubleshooting. I tried with "Direct Post" turned both on and off.

Thanks in advance.

Shai’s picture

FileSize
15.08 KB

Here is information provided by commerce:

Commerce failed transaction info

Greg Boggs’s picture

Hi Shai,

Can you follow up with iATS support on this issue? They can see the cause of the rejection on their side.

~Greg

Shai’s picture

Hi Greg,

I called iATS. They say that the expiration date is not coming through. See screen shot from their terminal report.

On the Drupal Commerce site, the fields for month and year are displaying. The message below comes from Drupal Watchdog. There I see that the expiry month is missing from that message.

iats terminal information

Personal info the message below has been changed.
MESSAGE iATS API response from iATS Credit card payment: <pre>Array ( [IATS_AccountNumber] =&gt; 5822 [IATS_MOP] =&gt; MC [IATS_PaymentType] =&gt; CreditCard [IATS_Result] =&gt; REJECT: 40 [IATS_TransID] =&gt; B45A5000 [IATS_Address] =&gt; 1003 Blue St. [IATS_City] =&gt; Pittsburgh [IATS_Comment] =&gt; DrupalModule|7|iats_credit_card|commerce_payment_iats_credit_card|PA50E9CE [IATS_Country] =&gt; US [IATS_EMail] =&gt; [IATS_Title] =&gt; [IATS_FirstName] =&gt; John [IATS_LastName] =&gt; Smith [IATS_Phone] =&gt; [IATS_Fax] =&gt; [IATS_Phone2] =&gt; [IATS_State] =&gt; PA [IATS_ZipCode] =&gt; 13456 [IATS_Amount] =&gt; 1.00 [IATS_Payment_AgencyCodeHash] =&gt; F26C383384902C6FAAE3blahblahblahblahbalh [IATS_ExpiryMonth] =&gt; [IATS_ExpiryYear] =&gt; 20 [IATS_Payment_SubCode] =&gt; 80 [IATS_Invoice] =&gt; I-7 [IATS_Item1] =&gt; [IATS_Item2] =&gt; [IATS_Item3] =&gt; [IATS_Item4] =&gt; [IATS_Item5] =&gt; [IATS_Item6] =&gt; )

Thanks for sticking with me on this one.

Shai

Greg Boggs’s picture

This isn't something we've seen before.

Can you confirm whether or not you're using DPM? DPM is a completely different payment process because DPM submits the form directly to iATS while a regular CC payment form submits the form to Drupal. Also, have you done any form alters or overrides of your payment form?

If you aren't doing DPM, can you try using it again, and make sure your form is refreshed such that the form submits the post action directly to iATS rather than to Drupal. iATS should see completely different behavior between DPM and regular payments.

Shai’s picture

Hi Greg,

Yes. I'm using DPM.

But I've made progress. I just tried switching the theme to Bartik and it processed my test donation with no problem. Hurray.

The theme we are using is a Bootstrap-based third party theme called Creatrix.

Have you previously run into any problems with Bootstrap based themes?

Any suggestions on next steps to troubleshoot the theme to get it working with commerce_iats would be most helpful.

Shai

Greg Boggs’s picture

I'll give a test with Creatrix a try. Do you have any modifications in template.php?

Greg Boggs’s picture

Hrm, given that Creatrix makes it difficult to obtain their software, it's unlikely I can help you trouble-shoot the theme.

http://themeforest.net/item/creatrix-multipurpose-creative-online-shop/6...

But, the most likely place to look for strange code is template.php. Specifically, you're looking for any form_alter or preprocess that would unset this variable: $default_form['credit_card']['exp_month’];

~Greg

Shai’s picture

Hi Greg,

Thanks so much. I looked in template.php for both the Creatrix module and the SuperHero module (Creatrix is a sub-theme of Superhero) and I didn't see any form_alters or anything else that seemed suspicious.

Via your Drupal.org contact I've sent you Dropbox links to access a copy of what's actually installed.

Thanks much,

Shai

Shai’s picture

Greg,

Since Creatrix is based on Bootstrap, but a lot more complicated than Bootstrap, etc... I decided to install plain Bootstrip using Drupal's Bootstrap module and test a transaction with Bootstrap installed as the theme. Drupal's Bootstrap module by default uses a CDN version of Bootstrap. So this is recent (3.3.5) though vanilla version of Bootstrap. I didn't change any of the defaults that came set with Drupal's bootstrap module for Drupal 7.

The transaction did not go through. The iats journal is showing a missing expiration date, just as it did with Creatrix. The logged watchdog message is also the same as when using Creatrix that I pasted in my previous comment: the expiration month is missing.

So I think this is progress to know the problem is likely how commerce_iats plays with Bootstrap and not specifically Creatrix.

Shai

Greg Boggs’s picture

Thanks Shai,
That makes testing much easier.

Shai’s picture

Hi Greg,

Do you think you'll be able to look at it today?

Thanks,

Shai

Greg Boggs’s picture

Hi Shai,

Thanks for your patience on this issue. Your bug is important to iATS and to us, and I'm working on resolving it. I'll have a better update for you shortly.

~Greg

Greg Boggs’s picture

FileSize
0 bytes

Hi Shai,

This patch will resolve the issue. You can patch the module today to fix the issue, or wait until Drupal.org issues the next release of the dev version of commerce_iats for download.

The issue was that bootstrap completely rewrites the checkout form for Drupal Commerce. The DPM form is a custom built payment form that submits directly to iATS and the markup has to be exactly right for it to work. Fortunately, the fix is super easy.

~Greg

Greg Boggs’s picture

FileSize
767 bytes

Attaching correctly this time.

  • Greg Boggs committed 8cfc0be on 7.x-2.x
    Issue #2665540 by Greg Boggs, Shai: Getting Reject:40 Error
    
Greg Boggs’s picture

Title: Getting Reject:40 Error » DPM payment fails with Bootstrap Theme
Category: Support request » Bug report
Status: Active » Fixed
Shai’s picture

@Greg,

I've tested and the fix works on our installation.

Thanks much,

Shai

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.