- Issue created by @skyredwang
- Status changed to Needs review
about 1 year ago 5:01pm 3 April 2024 - Status changed to Needs work
about 1 year ago 11:05am 8 April 2024 - 🇵🇪Peru krystalcode
Some feedback:
$profile = $payment_method->getBillingProfile(); // skip handling payment methods for anonymous users for now. if (!$profile || $profile->getOwner()->isAnonymous()) { throw new PaymentGatewayException('Updating payment method for anonymous users has not been implemented.'); }
Why are you fetching the profile to check ownership? The payment method has a direct owner since it implements `EntityOwnerInterface`, we should be checking for that.
'expirationMonth' => $payment_method->card_exp_month, 'expirationYear' => $payment_method->card_exp_year,
Have you tested this? Without the `->value` at the end you'll be getting a `FieldItemListInterface` object.
- Status changed to Needs review
about 1 year ago 11:35am 8 April 2024 - 🇨🇳China skyredwang Shanghai
Why are you fetching the profile to check ownership?
This is documented as in the comment
// skip handling payment methods for anonymous users for now.
The attached patch corrected the access of the fields.
- Status changed to Needs work
about 1 year ago 11:46am 8 April 2024 - 🇵🇪Peru krystalcode
Yes, the point I was making is that you should not fetch the profile to get the user, the payment method itself has an owner:
if ($payment_method->getOwner()->isAnonymous()) { ... }
Also check if the $user actually exists. That prevents errors when there are dead references.
- Status changed to Needs review
about 1 year ago 1:13pm 8 April 2024 - 🇵🇪Peru krystalcode
- Removed the check for anonymous user; after review, since we have the vaulted shopper ID even if it's an anonymous user then we should be safe to update it here. It would be the responsibility of Drupal Commerce whether to expose editing payment methods for anonymous users or not. If that is done, then it can be updated in BlueSnap.
- Made some coding standards improvements. -
krystalcode →
committed a6a48385 on 8.x-1.x
Issue #3437928 Added support for updating CC payment methods
-
krystalcode →
committed a6a48385 on 8.x-1.x
- 🇵🇪Peru krystalcode
The commit contains the following compared to the last patch.
- Fixed bug that was sending the data in the wrong format.
- Fixed bug that was deleting shopper names and billing info.This is now better tested and working as expected. A release will be made after running this and other pending issues on production for some time.
- Status changed to Active
about 1 year ago 8:11pm 17 April 2024 - Status changed to Fixed
about 1 year ago 8:12pm 17 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.