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
Core: option to create payments with REST API #342
Conversation
Refer to this link for build results (access rights to CI server needed): |
aebfa31
to
8bd3362
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
8bd3362
to
f2d3dc2
Compare
Refer to this link for build results (access rights to CI server needed): |
f2d3dc2
to
6297e1a
Compare
Refer to this link for build results (access rights to CI server needed): |
This should mention it's about the REST API, not just "API". Also, it's missing tests. |
Are payments currently retrievable via the API? |
like @akx said, add tests please |
@akx payments are not currently retrievable via the REST API |
6297e1a
to
3690ecf
Compare
Refer to this link for build results (access rights to CI server needed): |
3690ecf
to
f407f80
Compare
Refer to this link for build results (access rights to CI server needed): |
data["payment_identifier"], | ||
data.get("description", "") | ||
) | ||
return Response({'status': 'order is now fully paid'}) |
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.
I think a return code of 201 ("Created") would be more appropriate here?
f407f80
to
51c7cbc
Compare
Refer to this link for build results (access rights to CI server needed): |
@tulimaki Now that you have a simple serializer for payments, it should be trivial to add something like |
51c7cbc
to
9f11d51
Compare
Payments is now available via REST API. Since Payment didn't have currency I added currency property for it. I guess that it's OK. |
Refer to this link for build results (access rights to CI server needed): |
9f11d51
to
751df2b
Compare
Refer to this link for build results (access rights to CI server needed): |
751df2b
to
24e0435
Compare
retest this please |
|
||
@property | ||
def currency(self): | ||
return self.amount.currency |
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.
What's the point of this? Why can't the API user just use payment.amount.currency
(or payment.foreign_amount.currency
)?
* Add create_payment detail route to OrderViewSet * add set_fully_paid detail route to OrderViewSet * Add PaymentSerializer with amount_value, payment_identifier and description as fields. Refs SHOOP-2117 / SHOOP-1973
24e0435
to
6bb7215
Compare
This is cool now. Thanks, @tulimaki! :) |
Core: option to create payments with REST API
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
currency, payment_identifier and description as fields.
Refs SHOOP-2117 / SHOOP-1973