xini/silverstripe-silvershop-stripe

Logged in member cannot process a real credit card (test ones okay)

Closed this issue · 8 comments

When a member creates a new account during the checkout process, the credit card (using a real one) transaction fails with the words, “An unspecified payment error occurred. Please check the payment messages.”
Unspecified error

However, if the user was to proceed as a Guest then the credit card (again the real one) transaction goes through.

In the logs is the error message, “The credit card number is required at vendor/omnipay/common/src/Common/CreditCard.php:246“.

The failed Purchase Request does not reach Stripe as nothing appears under failed payments in the Stripe Dashboard.

When the member uses one of Stripe’s test cards, it works fine.

The difference between the test credit card’s purchase request (SilverStripe\Omnipay\Model\Message\PurchaseRequest) and the real credit card is that the CardReference and the CardReference under Parameters is set to null with the real credit card.

This error also occurs in my live sites.

Can someone please see if they can repeat this error? It is when I use a real credit card that the error occurs.

xini commented

Hi Anthony,
Thanks for reporting this. I'll set up a test site to test this.
Can you confirm that the stripe API is not set to your test account when you use the real credit card?
Cheers

I use the real credit card in the test environment & production with the same outcome. I do have the Stripe API setup for the dev environment.

xini commented

If I understand you correctly, the Stripe API is set to use the Stripe test environment? In that case real cards don't work. Only the test numbers from (https://stripe.com/docs/testing#cards) work when the Stripe API is set to test.

Thanks re the test environment (was not aware of this). Please note that I get the same error in production. This only occurs when creating a new member during the checkout process. Guests go through fine.

xini commented

Thanks. Can you send me your CheckoutPage steps config and any other relevant information regarding handling of users etc?

xini commented

I have setup a test site and tested the following cases, all using the Silverstripe live environment:

  • Stripe test API, create user, test card
  • Stripe test API, existing user, test card
  • Stripe test API, guest, test card
  • Stripe live API, create user, real card
  • Stripe live API, existing user, real card
  • Stripe live API, guest, real card

All 6 test cases worked without issues.

Maybe you are doing something in a custom checkout step that messes with the payment?

I have a second website, with a similar setup, which uses xini/silverstripe-silvershop-stripe and have today processed, in production, my credit card successfully on this. I compared the setup to the website with the error and noted a number of dev-master versions. Have replaced all Omnipay & Stripe libraries with stable versions. A credit card was successfully processed, when logged in as a new member. So, problem solved! Sorry, if I wasted your time. Thanks. Will close.

xini commented

no worries.