Jump to content

Stripe Payment Gateway Problem: Card number is not a valid credit card number


Recommended Posts

I have an issue with the WHMCS default Stripe Payment Gateway after upgrading to 7.5.1 and switching over to the built-in WHMCS Stripe Payment Gateway.

In the transaction logs, some clients (usually clients that have been with me for a long time, for over three years) encounter a "card number is not valid" error.

Quote

 

Invoice ID => 1000009
User ID => 3932
Amount => 179.00
The card number is not a valid credit card number.


 

When I look into the WHMCS database in the client table, I see that they do have a gateway ID that corresponds to the right customer token that I see in my Stripe Dashboard at Stripe's website. So this customer ID token information is correct.

However, when I go to see the Stripe logs, it shows that WHMCS is trying to submit the card information on file again, instead of submitting the customer token. In the case referenced above, the request body and response are shown below.

See that a credit card number (of just the last four digits) are posted "card": "number": "????".

Quote

 

**POST /v1/tokens**

> 2018/06/17 05:00:28
> Summary
> ID
> req_XXXXXXXXXXXXXXX
> Time
> 2018/06/17 05:00:28
> Method
> POST
> URL
> /v1/tokens
> Status
> 402
> IP address
> 00.00.000.00
> Version
> Source
> Stripe/v1 PhpBindings/3.23.0

 

**Request POST body**

Quote

> {
>   "card": {
>     "number": "0000",
>     "exp_month": "01",
>     "exp_year": "20",
>     "address_country": "US",
>     "name": "XXXXXX XXXX",
>     "address_line1": "XXXXXXXXXXXXXX",
>     "address_city": "XXXXXXXXXX",
>     "address_state": "XX",
>     "address_zip": "00000"
>   }
> }

**Response body**

Quote

> {
>   "error": {
>     "code": "invalid_number",
>     "doc_url": "https://stripe.com/docs/error-codes/invalid-number",
>     "message": "The card number is not a valid credit card number.",
>     "param": "number",
>     "type": "card_error"
>   }
> }

Why is this being sent to Stripe instead of the right information?

What a successful Request POST body should look like is something like the following at Stripe:

Quote

> {
>   "time_on_page": "83606",
>   "guid": "XXXXXXXXXXXXXXXXXXXXXXXXX",
>   "muid": "XXXXXXXXXXXXXXXXXXXXXXXXX",
>   "sid": "XXXXXXXXXXXXXXXXXXXXXXXXX",
>   "key": "pk_live_XXXXXXXXXXXXXXXXXXXXXXXXX",
>   "payment_user_agent": "stripe.js/XXXXXXX",
>   "card": {
>     "number": "**** **** **** 0111",
>     "cvc": "***",
>     "exp_month": "05",
>     "exp_year": "2020"
>   }
> }

Is there something missing in the client table in WHMCS that should be there for the customer record to be successfully processed?

Also, one other thing I should mention is that we were formerly using the Stripe Add-on by ServerPing, but switched over to WHMCS's built-in payment gateway with this WHMCS upgrade. And ServerPing put the Stripe customer ID token in the same way WHMCS does it, in the gateway ID field.

However, it currently appears that 80% of the customers of ours can transact just fine after we upgraded and switched over to WHMCS's Stripe payment gateway. However, about 20% of the customers encounter the error explained above.

It's really frustrating to see this happen and each time we need to reach out to the customer to ask them to entirely enter their credit card information again. And the customers are less than thrilled at having to enter their same credit card information again.

Any help or ideas would be very welcomed.

Link to comment
Share on other sites

I opened a ticket already.

I actually figured a workaround, though I don't know the technical back-end reason why it works, but I shared it with technical support. If anyone has the same or similar problem, then they can check with Support.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated