-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept source as permitted attribute importing orders #3066
Accept source as permitted attribute importing orders #3066
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtapia the changes in file core/spec/lib/spree/core/importer/order_spec.rb
are only formatting, I think this creates confusion in PRs that include code changes. I think it would be better to remove these changes from this PR.
It seems to me that the code you added in orders_controller.rb
is not covered by new specs, can you please add some? As usual, thank you for your work!
@spaghetticode I just added a test, please let me know what do you think |
@jtapia I think the tests don't verify that the payment source is correctly saved. They only test that the controller action returns a 201 or a 404. Also, I ran the tests commeting the code you added in Spree::Api::OrdersController and they still pass, so I'm a bit puzzled 🤔... did not investigate more though. |
@spaghetticode please check again the test case, it's returning:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtapia it looks good I left a few comments, it's only minor improvements 👍
@spaghetticode please let me know what do you think, thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtapia looks good to me , thank you 👍
@spaghetticode should we remove the |
@jtapia let's wait for somebody from the core team to chime in for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This is a great addition. But:
We need a way to allow other payment sources than credit cards as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks 👏
Description
Sending the
source
data insidepayments
payload tospree/api/orders#create
is returning an error:ActiveRecord::RecordInvalid: Validation failed: Source can't be blank