Closed whoisgina closed 1 year ago
Thanks, @whoisgina! We'll submit an update to correct this following some testing on our end. Huge thanks for the thorough and thoughtful ticket!
You're welcome, thanks for supporting this @benlobach! I did make an edit above to correct something, though I'm sure you would've figured it out in context anyways.
Yes, thank you! We're moving the variables to $customerId as well to clean up the function. Thanks, again!
@whoisgina - we just released version 4.0.3 with these changes baked in. Thanks again for bringing this to our attention!
Describe the bug Saving payment sources is failing with the error
Setting unknown property: craft\commerce\models\PaymentSource::userId
.To Reproduce Submit a payment form with the
savePaymentSource
parameter set to true. I've also got Accept.js and CIM enabled on the gateway, if that's relevant!Expected behavior The payment source is saved to the customer's profile for later use.
Additional context I was able to get this to work by changing
userId: $userId
tocustomerID: $userId
in Gateway.php here! I think they did some renaming at some point.Similarly, though not relevant here I think, is that
getAllPaymentSourcesByUserId()
here is deprecated in favor ofgetAllPaymentSourcesByCustomerId()
.