swopty Posted June 17, 2018 Share Posted June 17, 2018 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. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Peter Posted June 19, 2018 Share Posted June 19, 2018 Hi @swopty, This issue is likely one that we'd need to look closely in to. Could you open a support ticket with us, providing WHMCS Admin Area and FTP access details (To the ticket) and we'll be happy to troubleshoot this for you. Best Regards, Peter Technical Analyst I 0 Quote Link to comment Share on other sites More sharing options...
swopty Posted June 19, 2018 Author Share Posted June 19, 2018 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. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Peter Posted June 19, 2018 Share Posted June 19, 2018 Hi @swopty, I'm glad this was resolved for you. If you're happy to provide the ticket ID, I'd be happy to check and with your permission, provide the resolution so that others on the boards can see this in the future. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.