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
Metamask & WalletConnect support #26
Conversation
Still need to work out some details about how to submit the Transaction Hash to the Pretix order |
I've spent some time resolving some merge conflicts with master. Still need to think about the flow for paying with Metamask and WalletConnect. Previously the plugin would request the user to input their sender address and use that to monitor for outgoing transactions that matched the receiving address Now we have moved this logic until after the order is completed. The user only needs to select the currency which wants to pay with (either ETH or DAI) then after finalizing the order, it gets to the Right after successful connection we make a transaction requests with the provided amount calculated from There is still one issue. We didn't know how to pass the transaction hash from the client-side to the pretix plugin on the backend programatically. Should it be made into a separate form? Is there an API endpoint that could be used to update the order? You can find the client-side logic for the transaction request . on Please let me know if this was clear, I would like to help get this merged asap |
@@ -2,6 +2,6 @@ | |||
|
|||
<p>{% blocktrans trimmed %} | |||
After you submitted your order, we will provide you with {{ currency }} address to deposit an equivalent ethereum amount. | |||
Please note that we will only give a ticket provided you deposit from {{ from }}. | |||
Please note that we will only give a ticket provided you deposit from your address you provided. |
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.
Maybe better as:
from the address you provided
const BigNumber = window.BigNumber; | ||
|
||
const TOKEN_TRANSFER = "0xa9059cbb"; | ||
const DAI_TOKEN_ADDRESS = "0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359"; |
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.
Am I correct that this moves us from the POA DAI network to the one on mainnet (no problems with thus, just want to be sure I understand).
|
||
def json_rpc_request(method, params): | ||
try: | ||
payload = { "id": 1337, "jsonrpc": "2.0", "method": method, "params": params } |
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'll come through and cleanup this file with a pattern that lets us test it in a follow up PR so assuming this code works right now I don't see any need to do much cleanup on it since I'll rework most of it.
pretix_eth/payment.py
Outdated
return bool( | ||
(self.settings.DAI or self.settings.ETH) and super().is_allowed(request) | ||
) | ||
return bool( |
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.
These lines need to indented one more level.
return None | ||
|
||
def check_txn_confirmation(txn_hash, from_address, to_address, currency, amount, timestamp): | ||
from_address = from_addres.lower() |
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.
Check this failing CI run: https://circleci.com/gh/esPass/pretix-eth-payment-plugin/22
This file currently has a number of simple errors like mispelled variable names.
Replaced by #32 |
Fix #3