Skip to content

Send digital product automatically on successful order #97

Closed Locked Answered by Steffo99
scarereeperr asked this question in Q&A
Discussion options

You must be logged in to vote

You should be able to add code for your use case in this function:

greed/worker.py

Lines 697 to 710 in 3cfe025

def __order_transaction(self, order, value):
# Create a new transaction and add it to the session
transaction = db.Transaction(user=self.user,
value=value,
order_id=order.order_id)
self.session.add(transaction)
# Commit all the changes
self.session.commit()
# Update the user's credit
self.user.recalculate_credit()
# Commit all the changes
self.session.commit()
# Notify admins about new transation
self.__order_notify_admins(order=order)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@scarereeperr

This comment was marked as off-topic.

@Steffo99

This comment was marked as off-topic.

@Steffo99
Comment options

Answer selected by Steffo99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
feature A request for a new feature.
2 participants
Converted from issue

This discussion was converted from issue #96 on March 12, 2021 09:27.