-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: allow redemption at requested prices #185
Conversation
@@ -499,7 +517,7 @@ def _create_redemption( | |||
All other exceptions raised during the creation of an enrollment. This should have already triggered | |||
the rollback of a pending transaction. | |||
""" | |||
quantity = -1 * self.price_for_content(content_key) | |||
quantity = -1 * content_price |
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.
IDK why we made a second call to get the price here - we already have it from calling is_redeemable()
further up in the body of redeem()
.
@@ -549,7 +567,25 @@ def _create_redemption( | |||
|
|||
return ledger_transaction | |||
|
|||
def is_redeemable(self, content_key): | |||
def validate_requested_price(self, content_key, requested_price_cents, canonical_price_cents): |
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.
borrowed from the enterprise-access implementation
0e0b1ef
to
5030bf0
Compare
Assignments (in enterprise-access) contain a field that represents the price of the content at the time of assignment. We need to allow for that price to be passed through to the transaction creation view. ENT-8035
5030bf0
to
e170a4e
Compare
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.
LGTM!
Assignments (in enterprise-access) contain a field that represents the price of the content at the time of assignment. We need to allow for that price to be passed through to the transaction creation view. ENT-8035
See updated API docs at http://localhost:18280/api/schema/redoc/#tag/transactions/operation/api_v2_subsidies_admin_transactions_create
Use curl/postman to make a request to create a new transaction for a price that's slightly different from the true price, e.g.
Merge checklist