Can't create payment method after entering wrong CC details

Created on 7 January 2022, almost 3 years ago
Updated 24 April 2024, 6 months ago

Problem/Motivation

1. An authenticated user adds a payment method for the first.
2. If the payment method details are correct, a Shopper is created on BlueSnap and is correctly associated with the User in both Drupal and BlueSnap.
3. If the payment method details are considered by BlueSnap to be incorrect, BlueSnap creates the Shopper and associates it with the Drupal User. It then returns a response to Drupal that there has been an error.
4. Drupal receives the response seeing that there has been an error, and aborts further processing before storing the remote ID in the `commerce_remote_id` user field. That results in the Drupal User to not become associated with the already created BlueSnap Shopper.
5. Next time the user tries to add a payment method, Drupal is not aware of an association with a BlueSnap Shopper. It therefore requests a new Shopper to be created. At that point, BlueSnap returns the reported error that there is already a Shopper for the User.

Steps to reproduce

  • Login as a user that has no existing payment methods yet.
  • Create a credit card payment method (Hosted Payment Fields gateway) using CC details that fail (https://developers.bluesnap.com/docs/test-credit-cards).
  • Observe the error message "We encountered an error processing your payment method. Please verify your details and try again."
  • Enter again CC details that succeed.
  • Observe the error message again and find in the logs the following message "Shopper retrieval service failure. Internal seller shopper ID: XXX is not unique for seller: XXX. (The internal seller shopper ID is one originally generated by the seller).".

Proposed resolution

See child issues.

Remaining tasks

See child issues.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇵🇪Peru krystalcode

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024