digital-pros / commerce-authorize

Authorize.net - Craft Commerce 2 Plugin
Other
3 stars 9 forks source link

Saving payment sources fails #32

Closed whoisgina closed 1 year ago

whoisgina commented 1 year ago

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 to customerID: $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 of getAllPaymentSourcesByCustomerId().

benlobach commented 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!

whoisgina commented 1 year ago

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.

benlobach commented 1 year ago

Yes, thank you! We're moving the variables to $customerId as well to clean up the function. Thanks, again!

benlobach commented 1 year ago

@whoisgina - we just released version 4.0.3 with these changes baked in. Thanks again for bringing this to our attention!