Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
9236481
Adding web3modal as a build package for now, changing multiple receiv…
mikulas-mrva May 20, 2022
5d62b24
removing wallet upload models and views, adding wallet connection js,…
mikulas-mrva May 22, 2022
01a04f1
Added SignedMessage model, view and serializer to send payment detail…
mikulas-mrva May 30, 2022
b106f91
Finished the FE code outline, added Permissions to allow POST and GET…
mikulas-mrva May 30, 2022
dcdb640
Switching to the correect way of signing a message with Metamask
mikulas-mrva May 31, 2022
7951816
Changing data signing to typed data
mikulas-mrva Jul 2, 2022
40f9028
Fixing data signing
mikulas-mrva Jul 3, 2022
f11ad3b
Confirming payments, deleting unused permissions module
mikulas-mrva Jul 4, 2022
f6d1579
Improving user flow of the payment process, displaying a message when…
mikulas-mrva Jul 7, 2022
6bf8d96
Missing migration
mikulas-mrva Jul 8, 2022
cba6705
Changing raw_message to text field to circumvent field length limitat…
mikulas-mrva Jul 8, 2022
c0bd7e0
Moving retry triggers from inline to js, adding transaction confirmat…
mikulas-mrva Jul 12, 2022
eefabbb
Handling user dialogue cancellations gracefully.
mikulas-mrva Jul 13, 2022
c958df3
Do not hide success message if the transaction was submitted successf…
mikulas-mrva Jul 14, 2022
0f531d0
chain_id should be larger than uint8 to accomodate all chains
mikulas-mrva Jul 14, 2022
1a6a8df
Fixing a typo, using signTypedData_v4 for signing
mikulas-mrva Jul 14, 2022
3760617
Network name should not be uppercase in _RPC_URL
mikulas-mrva Jul 14, 2022
24ad2d7
Extending chain id field
mikulas-mrva Jul 14, 2022
7fc5597
Bug fixes
mikulas-mrva Jul 14, 2022
5b125b6
Don't let the user pay for multiple order payments wwithin one order
mikulas-mrva Jul 14, 2022
964eacc
Disabling refunds
mikulas-mrva Jul 14, 2022
1e71c56
fixes:
mikulas-mrva Jul 14, 2022
e47ced1
Confirming ERC20 payments
mikulas-mrva Jul 14, 2022
12cb449
Don't confirm payments based on blocks that are too young
mikulas-mrva Jul 14, 2022
ead478f
Display transaction hash on refresh, display transaction details if t…
mikulas-mrva Jul 14, 2022
ba270eb
Add ERC20 balance check to prevent most failing transactions to be su…
mikulas-mrva Jul 15, 2022
39f197f
Automatically confirming payments, ignoring payments that didn't go t…
mikulas-mrva Jul 16, 2022
a4329ec
Preventing a payment to go through in case of insufficient balance er…
mikulas-mrva Jul 16, 2022
3746b18
Only display "please sign a message dialogue" in case it's about to p…
mikulas-mrva Jul 16, 2022
a6cfe42
Only display "please confirm a transaction" right before a transactio…
mikulas-mrva Jul 16, 2022
4e07d66
Optimizing "order_accepting_payments" criteria into a single db query
mikulas-mrva Jul 16, 2022
0d5bc6a
Fixing AttributeError: Manager isn't accessible via SignedMessage ins…
mikulas-mrva Jul 17, 2022
8117a5b
Using getReceipt in both ETH and DAI payment confirmation
mikulas-mrva Jul 17, 2022
64e6048
Using getReceipt in both ETH and DAI payment confirmation
mikulas-mrva Jul 17, 2022
58b1910
refactoring confirm_payments to use reeceieptsto check transaction st…
mikulas-mrva Jul 17, 2022
6a551ed
Refactoring js, splitting into multiple files
mikulas-mrva Aug 8, 2022
a12f5fa
Refactoring js, splitting into multiple files, fixes
mikulas-mrva Aug 9, 2022
a81c8d4
Periodic payment status change check should be running even if user r…
mikulas-mrva Aug 9, 2022
d016a4a
bugfixes
mikulas-mrva Aug 11, 2022
0d736ba
Deleting confirm_refunds.py management command as there are no refund…
mikulas-mrva Aug 23, 2022
5bc664d
Adding an endpoint that can access the status of an Order without aut…
mikulas-mrva Aug 29, 2022
14127b8
Updating Web3.js to a new version 1.7.5
mikulas-mrva Sep 6, 2022
9ec84db
Updating Web3Modal to a hotfixed version branched out from latest ver…
mikulas-mrva Sep 7, 2022
7bf5cc3
Adding *.infura.io to CSP
mikulas-mrva Sep 7, 2022
a3996a5
Fixing some CSP issues, adding signed message data to Order detail co…
mikulas-mrva Sep 7, 2022
9d2d8d3
Updating CSP and fixing javascript issues that require a double click…
mikulas-mrva Sep 12, 2022
9fdefbd
Handling missing providers gracefully, deleting a ton of debuggers;
mikulas-mrva Sep 12, 2022
e855d61
Bugfix: retrieving web3modal correctly
mikulas-mrva Sep 13, 2022
0085c61
Bugfix: retrieving web3modal correctly
mikulas-mrva Sep 13, 2022
d44866d
bugfixes
mikulas-mrva Sep 13, 2022
34c762b
bugfixes - two different kinds of provider
mikulas-mrva Sep 20, 2022
9cd0d30
adding loggers to confirm_payment mgmt commands
mikulas-mrva Sep 20, 2022
a52d961
adding loggers to confirm_payment mgmt commands, log level changed to…
mikulas-mrva Sep 20, 2022
847e251
Also checking for cancelled OrderPayments
mikulas-mrva Sep 20, 2022
e22c94e
ERC20ABIView should be public
mikulas-mrva Sep 20, 2022
acda5b8
Confirming DAI payments using the correct received address
mikulas-mrva Sep 20, 2022
e0eb0b3
Checking ERC20 contract address as well
mikulas-mrva Sep 20, 2022
3761064
Changing `url` template tag to `eventurl event`
mikulas-mrva Sep 20, 2022
da3860a
Changing `url` template tag to `eventurl event`
mikulas-mrva Sep 20, 2022
b06f143
Views should be compatible with multidomain as well as signel event p…
mikulas-mrva Sep 20, 2022
996d36d
Arbitrum DAI should have a checksum address
mikulas-mrva Sep 20, 2022
0afc1f1
All DAI addresses should be checksum addresses
mikulas-mrva Sep 20, 2022
6dedcf4
* code cleanup
mikulas-mrva Sep 29, 2022
cd57833
adding links to control.html list of payments
mikulas-mrva Sep 30, 2022
382e944
Adding payment data to exports
mikulas-mrva Sep 30, 2022
54c97b0
Fixing tests
mikulas-mrva Sep 30, 2022
e31a0a9
Linter complaints
mikulas-mrva Sep 30, 2022
d21ada1
Linter complaints
mikulas-mrva Sep 30, 2022
e5f1299
Removing Refunds from the exports logic, we don't support them anymore
mikulas-mrva Oct 11, 2022
f5060f4
Moving SAFETY_BLOCK_COUNT and PAYMENT_NOT_RECIEVED_RETRY_TIMEOUT valu…
mikulas-mrva Oct 11, 2022
366a1ba
Added a json validator for TOKEN_RATES field
mikulas-mrva Oct 11, 2022
49387f0
Removing an unused constant
mikulas-mrva Oct 11, 2022
4999c6a
Fixing a template bug
mikulas-mrva Nov 3, 2022
409c954
Rinkeby in Peace
mikulas-mrva Nov 3, 2022
3495877
safety_block_count can be None
mikulas-mrva Nov 3, 2022
9614138
Using Correct DAI contract
mikulas-mrva Nov 8, 2022
c7d9e2d
Adding Sepolia ETH to the config, not sure what the correct DAI contr…
mikulas-mrva Nov 8, 2022
82e5820
Putting Rinkeby back in place for Exports, added a DISABLED flag to p…
mikulas-mrva Nov 9, 2022
d320c79
Adding Token Rate at time of order to ETH payment export
mikulas-mrva Nov 9, 2022
8fe7659
Export token price in ether, not wei
mikulas-mrva Nov 10, 2022
79ab76c
Trying to fix infinite pip backtracking and adding python 3.10, 3.11 …
mikulas-mrva Dec 23, 2022
aaeb1ff
Fixinf dependency conflicts for Py<3.8
mikulas-mrva Dec 23, 2022
7fc5dcb
Temporarily disabling pip check
mikulas-mrva Dec 23, 2022
9c8df85
Fixing tests, pinning web3 to a beta of v6 temporarily to resolve an …
mikulas-mrva Dec 23, 2022
ebc349b
do not hardcode deps of web3 in our setup
kvbik Jan 12, 2023
fdba023
correct method name in the python lib
kvbik Jan 20, 2023
8451d8e
new web3.py syntax
kvbik Jan 23, 2023
f1bca99
ci fix attempt
lassejaco Jan 27, 2023
e502718
trigger build
lassejaco Jan 27, 2023
51ecb0b
lint errors
lassejaco Jan 27, 2023
47940d5
no 3.11
lassejaco Jan 27, 2023
c612652
lint again
lassejaco Jan 27, 2023
c405232
web3modal
lassejaco Feb 21, 2023
40c2c48
Add arbitrum and optimism to rpc. Add better communication around cha…
lassejaco Feb 21, 2023
9b43c5f
Clean up, zksync progress, csp issue
lassejaco Feb 23, 2023
ca92998
Use webpack to streamline JS env and allow for automatic cache busting
lassejaco Mar 6, 2023
fead308
Streamline and document web3modal dev setup
lassejaco Mar 9, 2023
cb3f3d8
Allow user to disconnect wallet + warn if SC wallet
lassejaco Mar 12, 2023
bb92392
Fix gitignore not pushing JS build files. WalletConnect project id no…
lassejaco Mar 16, 2023
1384e2b
lint error
lassejaco Mar 17, 2023
f1e6df3
django deprecation warning
lassejaco Mar 17, 2023
7195e20
Adjust test
lassejaco Mar 17, 2023
88b7005
Update packages and related changes
lassejaco Mar 18, 2023
aa158fe
Revert to version 1 and upgrade packages again
lassejaco Mar 18, 2023
1fe3720
Updated error messaging, adjust page title for wallets that use it to…
lassejaco Mar 29, 2023
72beaec
Better loading UX
lassejaco Mar 30, 2023
12fd67f
EIP1271 basic implementation
lassejaco May 15, 2023
f44c2cf
Lint fixes
lassejaco May 15, 2023
dd65e55
Bugfix
lassejaco May 15, 2023
0016607
Safe fix and some WIP on EIP721 - not polished, just pushing so we ca…
lassejaco May 25, 2023
1b7b55e
Safe integration and typed signatures
lassejaco Jun 6, 2023
df943d8
Lint errors
lassejaco Jun 6, 2023
878b279
Temp test fix
lassejaco Jun 6, 2023
814481e
Modify model correctly
lassejaco Jun 6, 2023
4b2dd76
Fix transaction hash display error
lassejaco Jun 7, 2023
7bd2a23
Fix confirm payment bug when tx not found
lassejaco Jun 7, 2023
b556326
hotfix: getting proper values from settings (#240)
kvbik Jun 14, 2023
4457f85
WalletConnect v2. Fix DAI issue. Adjust network config and tests
lassejaco Jun 20, 2023
1a6bf7a
Update packages. Fix safe confirm payment for DAI payments.
lassejaco Jun 27, 2023
700cb3f
Update packages
lassejaco Jun 28, 2023
4d8a8a1
django error?
lassejaco Jun 29, 2023
8954563
more django
lassejaco Jun 29, 2023
d63390b
sanity check
lassejaco Jun 29, 2023
50a822f
Unique true again
lassejaco Jun 29, 2023
9b47a41
hotfix: getting proper values from settings
kvbik Jun 30, 2023
bc7cc8b
Merge branch 'inlining-checkout' into walletconnect-2.0
kvbik Jun 30, 2023
e576fb0
Merge pull request #1 from kvbik/walletconnect-2.0
lassejaco Jul 4, 2023
2dbd42d
tests fix?
lassejaco Jul 4, 2023
0f775d7
Clean up static files
lassejaco Jul 16, 2023
691fc34
remove console log
lassejaco Jul 16, 2023
2ca3407
pip version and missing build files
lassejaco Jul 16, 2023
9aac0da
another pip verison
lassejaco Jul 16, 2023
d615e56
specific pip version
lassejaco Jul 18, 2023
eba3321
Attempt to lock tox dependencies
lassejaco Jul 24, 2023
efc66a3
syntax err
lassejaco Jul 24, 2023
59a5c4f
apps.py for plugin being properly discovered
kvbik Jul 26, 2023
0cebf9a
Merge pull request #2 from kvbik/walletconnect-2.0
lassejaco Jul 26, 2023
a4f738e
fix balance check error
lassejaco Jul 27, 2023
fae5af1
passing all the arguments to super is a must
kvbik Aug 1, 2023
736b4c4
Merge pull request #3 from kvbik/walletconnect-2.0
lassejaco Aug 8, 2023
b565215
package updates
lassejaco Aug 11, 2023
68cdbf3
split long lines
kvbik Sep 27, 2023
f87ac71
version increase in setup.py as well
kvbik Sep 27, 2023
20df2f5
placeholder for a fancy JS for custom form field
kvbik Sep 27, 2023
1df601e
Catch all failsafe on confirm payment step
lassejaco Sep 27, 2023
03265ab
lint
lassejaco Sep 27, 2023
51dcf41
Revert "package updates"
lassejaco Sep 27, 2023
e6c6b6b
create select box via javascript
kvbik Sep 29, 2023
697565b
Merge branch 'walletconnect-2.0' of https://github.com/lassejaco/pret…
kvbik Sep 29, 2023
954914a
default currency_type_field.choices introduced
kvbik Oct 2, 2023
d3af1bd
linter fixes
kvbik Oct 2, 2023
0823c90
currency/network selector frontend
lassejaco Oct 2, 2023
93541c3
clean up some leftover comments
lassejaco Oct 3, 2023
66434df
Merge branch 'walletconnect-2.0' of https://github.com/lassejaco/pret…
kvbik Oct 3, 2023
52adc57
Merge pull request #4 from kvbik/walletconnect-2.0
lassejaco Oct 3, 2023
8a9725a
Fetch api price dynamically
lassejaco Oct 3, 2023
b2702d9
polygon zkevm
lassejaco Oct 10, 2023
1b203e1
less restrictive dependencies also upgrades
kvbik Oct 17, 2023
eff1df3
merge conflict
lassejaco Oct 22, 2023
30a5a02
Add another price api and fix tests
lassejaco Oct 23, 2023
6ef2c57
lint
lassejaco Oct 23, 2023
9dabb4d
revert accidental commit
lassejaco Oct 23, 2023
4bf13b6
snake case for web3 methods to work with latest
kvbik Oct 24, 2023
88311d6
line breaks removed to make html work
kvbik Oct 24, 2023
2784f6d
less restrictive dependencies also upgrades (#6)
kvbik Oct 24, 2023
a72e046
run integration tests
kvbik Oct 31, 2023
73f7b6c
needed for pytest to enable django settings
kvbik Oct 31, 2023
a30b692
use the secret
kvbik Oct 31, 2023
2850ec6
Merge pull request #7 from kvbik/run-integration-tests
lassejaco Nov 1, 2023
9509ad0
bump frontend deps
lassejaco Jan 23, 2024
121bcba
remove accidental dupe
lassejaco Jan 23, 2024
5a2366c
update build files
lassejaco Jan 23, 2024
ffdd034
Merge branch 'dynamic-prices' into version-fix
lassejaco Jan 26, 2024
7a425e0
Merge branch 'frontend-deps-bump' into version-fix
lassejaco Jan 26, 2024
0abd2e0
fix coingecko and integration test
lassejaco Jan 31, 2024
eb68b81
lint
lassejaco Jan 31, 2024
35dc1cf
lint again
lassejaco Jan 31, 2024
2b2fb85
lintlintlint
lassejaco Jan 31, 2024
c0d4d1c
move web3modal code out of static folder
lassejaco Jan 31, 2024
e4396a4
readme updates
lassejaco Feb 1, 2024
39084f7
remove traces of multi-receiver mode from readme
lassejaco Feb 1, 2024
0ffe4d6
README updates
lassejaco Feb 8, 2024
d4715b5
README update
lassejaco Mar 10, 2024
2568f09
cleanup, delete uses of obsolete eth_account methods
devin-ai-integration[bot] Jan 17, 2025
efcc86f
refactor: replace ethereum tests with daimo pay tests
devin-ai-integration[bot] Jan 17, 2025
78eba0c
refactor: migrate from Ethereum to Daimo Pay provider
devin-ai-integration[bot] Jan 17, 2025
69d31f3
daimo pay
dcposch Jan 20, 2025
f600672
daimo pay: validate payment
dcposch Jan 20, 2025
5dcc311
daimo pay: show admin src/dest tx
dcposch Jan 21, 2025
4766d5b
email-based refund
dcposch Jan 21, 2025
9ce1bbe
email refund links
dcposch Feb 4, 2025
ead3d29
fix dep versions
andrewliu08 Jan 20, 2025
e0a9a14
docs: better readme
dcposch Feb 4, 2025
4dc5f30
doc: README
dcposch Feb 10, 2025
353027b
version 5.0.0-dev
dcposch Feb 17, 2025
4bee4a5
make DAIMO_PAY_REFUND_EOA_PRIVATE_KEY optional
dcposch Feb 22, 2025
5c6d33a
new payment fetch format
dcposch Feb 23, 2025
89f64a7
remove webhooks
dcposch Feb 23, 2025
dee2cb8
check in bundle
dcposch Feb 23, 2025
6e21ec0
v5.1.0-dev
dcposch Feb 23, 2025
9ad17f6
upgrade to @daimo/pay 1.4.0
dcposch Mar 3, 2025
16e8558
support pay-after-approval
dcposch Mar 17, 2025
773fef3
upgrade to @daimo/pay 1.5.1
dcposch Mar 17, 2025
4bed2c1
always create payment on the payment screen
dcposch Mar 19, 2025
292e369
version 5.2.0-dev
dcposch Mar 19, 2025
e197695
add order info to payment metadata
dcposch Apr 3, 2025
3430390
upgrade: @daimo/pay v1.6.3
dcposch Apr 3, 2025
b97ddf2
pay metadata: get correct cart ID
dcposch Apr 4, 2025
c695665
pay: disable external-chain payments
dcposch Apr 15, 2025
f3312af
5.2.1: support confirmation text
dcposch Jun 3, 2025
47dcae8
5.2.2: better modal, fix Place Order
dcposch Jun 5, 2025
c3019bd
5.2.3: fix submit, "Pay with crypto"
dcposch Jun 6, 2025
e2e444e
5.2.4: upgrade web3py
dcposch Jun 6, 2025
b17b5c5
5.2.5: update refund email copy
dcposch Jun 6, 2025
a9f658e
5.2.6: update refund email sender
dcposch Jun 6, 2025
af036a5
5.2.7: peanut.me, disable Solana
dcposch Jun 9, 2025
32b339f
5.2.8: fix checkout styling
dcposch Jun 10, 2025
977a4f0
5.3.0: support ZKP2P
dcposch Jun 12, 2025
ea13499
5.4.0: upgrade Daimo Pay, better links
dcposch Jun 20, 2025
23237f5
5.4.1: latest @daimo/pay
dcposch Jun 20, 2025
a5f3bdc
5.5.0: @daimo/pay v1.14.4
dcposch Jul 30, 2025
27d7108
pay: 1.16.9
dcposch Sep 5, 2025
d38e5df
release: 5.5.1, @daimo/pay 1.17.2
dcposch Sep 15, 2025
3f8756c
release: 5.6.0
dcposch Sep 17, 2025
98bdf7e
5.6.1: remove Binance
dcposch Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 30 additions & 21 deletions .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,47 @@ jobs:
toxenv: py37-integration
- python-version: 3.8
toxenv: py38-core
- python-version: 3.8
toxenv: lint
- python-version: 3.8
toxenv: py38-integration
- python-version: 3.9
toxenv: py39-core
- python-version: 3.9
toxenv: py39-integration
- python-version: 3.8
toxenv: lint

- python-version: "3.10"
toxenv: py310-core
- python-version: "3.10"
toxenv: py310-integration
# - python-version: "3.11"
# toxenv: py311-core
# - python-version: "3.11"
# toxenv: py311-integration

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip wheel setuptools
pip install -e .[dev]
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip==23.1.2 wheel==0.40.0 setuptools==68.0.0
pip install -e .[dev] --use-deprecated=legacy-resolver

- name: Pip Check
run: pip check
- name: Pip Check
run: pip check

- name: ${{ matrix.toxenv }}
run: tox
env:
TOXENV: ${{ matrix.toxenv }}
- name: ${{ matrix.toxenv }}
run: tox
env:
WEB3_PROVIDER_URI: ${{ secrets.WEB3_PROVIDER_URI }}
TOXENV: ${{ matrix.toxenv }}
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ __pycache__/
# C extensions
*.so

# Dev Pretix config
pretix.cfg

# Distribution / packaging
.Python
env/
Expand Down Expand Up @@ -71,4 +74,11 @@ data/
.vscode
/.idea

venv
venv

node_modules
.DS_Store

# Check in bundle
!pretix_eth/static/daimo_pay_inject/dist/
pretix_eth/static/daimo_pay_inject/dist/meta.json
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Copyright 2019 Victor(https://github.com/vic-en)
Copyright 2025 contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
134 changes: 43 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,50 @@
# Pretix Ethereum Payment Provider

## **Warning**

**!! This plugin is not ready for 3rd party production use *yet*. If you want
to use it you must really understand the code !! PRs to make it production
ready and more eyes on this code are most welcome!**
**[Demo](https://www.loom.com/share/8c71876a9d5348f6a07a8d7e687368b6?sid=5b19c2a2-7502-4cf2-9afe-a865fd04e003)**

## What is this

This is a plugin for [pretix](https://github.com/pretix/pretix). This plugin
supports both Ethereum and DAI.
This is a payment plugin for [Pretix](https://github.com/pretix/pretix) to accept crypto payments from any chain and any coin.

Key features:
- Accept payments in all liquid tokens on major chains, using Daimo Pay.
- Clean 1:1 pricing for stablecoin payments. If a ticket costs $100, user transfers exactly 100.00 USDC, USDT, or DAI on any efficient chain.
- Support for all major EVM rollups + Polygon.
- Automatic bridging and forwarding to a single destination address.
- Built-in refund support, using Peanut Protocol.

## Event Setup Instructions

1. Under the event, go to Settings > Plugins > Payment Providers, enable provider.

2. Under Settings > Payments, enable payment method.

3. Configure the following required settings:
- `DAIMO_PAY_API_KEY` - API key from pay.daimo.com
- `DAIMO_PAY_RECIPIENT_ADDRESS` - Address to receive payments (in DAI on Optimism)
- `DAIMO_PAY_REFUND_EOA_PRIVATE_KEY` - Private key for automated refunds (must be funded with ETH and DAI on Optimism)

## Development Setup

You'll need Python 3.10 and Node >20.

1. Clone this repository
2. Create and activate a virtual environment
3. Run `pip install -e .[dev]`
4. Setup database: `make devmigrate`
5. Start dev server: `make devserver`
6. Build Daimo Pay checkout: `cd pretix_eth/static/daimo_pay_inject && npm i && npm run build`

You can also use `npm run dev` on that last step to run a watcher.

Finally, go to `http://localhost:8000`. Use `admin@localhost`, password `admin`. Create an org, an event, and follow the event setup instructions above.

You should now have a working development Pretix instance.


## History

It started with [ligi](https://ligi) suggesting [pretix for Ethereum
It started with [ligi](https://github.com/ligi) suggesting [pretix for Ethereum
Magicians](https://ethereum-magicians.org/t/charging-for-tickets-participant-numbers-event-ticketing-for-council-of-paris-2019/2321/2).

Then it was used for Ethereum Magicians in Paris (shout out to
Expand All @@ -30,9 +61,8 @@ vanished from the project after cashing in the bounty money and left the plugin
in a non-working state.

Then the idea came up to use this plugin for DevCon5 and the plugin was forked
to this repo and [ligi](https://ligi.de), [david
sanders](https://github.com/davesque), [piper
meriam](https://github.com/pipermerriam), [rami](https://github.com/raphaelm),
to this repo and [david sanders](https://github.com/davesque), [piper
merriam](https://github.com/pipermerriam), [rami](https://github.com/raphaelm),
[Pedro Gomes](https://github.com/pedrouid), and [Jamie
Pitts](https://github.com/jpitts) brought it to a state where it is usable for
DevCon5 (still a lot of work to be done to make this a good plugin). Currently,
Expand All @@ -44,84 +74,6 @@ issue](https://github.com/esPass/pretix-eth-payment-plugin/pull/49)
For DEVcon6 the plugin was extended with some more features like [Layer2 support by Rahul](https://github.com/rahul-kothari). Layer2 will play a significant [role in Ethereum](https://ethereum-magicians.org/t/a-rollup-centric-ethereum-roadmap/4698). Unfortunately DEVcon6 was delayed due to covid - but we where able to use and this way test via the [LisCon](https://liscon.org) ticket sale. As far as we know this was the first event ever offering a Layer2 payment option.
In the process tooling like [Web3Modal](https://github.com/Web3Modal/web3modal/) / [Checkout](https://github.com/Web3Modal/web3modal-checkout) that we depend on was improved.

### Recently added features

* L2s added!
* A panel was added in the web admin interface to upload a list of addresses to
be associated with each ticket order.
* During the checkout process, an address is chosen for each order from the
list of remaining addresses created by the address upload process.
* A payment confirmation management command was added that confirms pending
payments based on the address assigned to them during checkout. See the
`confirm_payments` section below for details.

## Development setup

1. Clone this repository, e.g. to `local/pretix-eth-payment-plugin`.
1. Create and activate a virtual environment.
1. Execute `pip install -e .[dev]` within the `pretix-eth-payment-plugin` repo
directory.
1. Setup a local database by running `make devmigrate`.
1. Fire up a local dev server by running `make devserver`.
1. Visit http://localhost:8000/control/login in a browser windows and enter
username `admin@localhost` and password `admin` to log in.
1. Enter "Admin mode" by clicking the "Admin mode" text in the upper-right
corner of the admin interface to create a test organization and event.
1. Follow instructions in [Event Setup Instructions](#event-setup-instructions)
For Devconnect IST an effort was made to improve the plugin in a variety of ways: WalletConnect support, single receiver mode (accept payments using just one wallet), more networks, automatic ETH rate fetching, improved UI and messaging, and smart contract wallet support. All of these features made it into this version of the plugin, except for smart contract wallet support - issues processing transactions stemming from sc wallets meant that we ultimately had to turn away sc wallet payments altogether.

## Event Setup Instructions
1. Under the event, go to Settings -> Plugins -> Payment Providers -> click on Enable under "Pretix Ethereum Payment Provider"
2. Next, under Settings, go to Payments -> "ETH or DAI" -> Settings -> click on "enable payment method".
3. Next, scroll down and set the values for the following:
- "TOKEN_RATE" - This is a JSON e.g.
```
{"ETH_RATE": 4000, "DAI_RATE": 1}
```
i.e. `KEY` = `<CRYPTO_SMBOL>_RATE` and `VALUE` = value of 1 unit in your fiat currency e.g. USD, EUR etc. For USD, above example says 1 ETH = 4000$. If EUR was chosen, then this says 1 ETH = 4000EUR.
- Select the networks you want under the "Networks" option - Choose from Ethereum Mainnet, Optimism, Arbitrum and their testnets.
- "NETWORK_RPC_URLS" - This is a JSON e.g.
```
{
"L1_RPC_URL": "https://mainnet.infura.io/v3/somekeyhere",
"Rinkeby_RPC_URL": "...",
"RinkebyArbitrum_RPC_URL": "..."
}
```
i.e. `KEY` = `<Network ID>_RPC_URL` and `VALUE` = RPC URL. Network IDs can be found [in tokens.py](pretix_eth/network/tokens.py)
4. Under Event, go to Settings -> Upload Wallet Addresses - upload some ethereum addresses


You can now play with the event by clicking on the "Go to Shop" button at the top left (next to the event name)

## Automatic payment confirmation with the `confirm_payments` command

This plugin includes a [django management
command](https://docs.djangoproject.com/en/2.2/howto/custom-management-commands/#module-django.core.management)
that can be used to automatically confirm orders from the Ethereum address
associated with each order across all events. By default, this command will perform a dry run
which only displays payment records that would be modified and why but without
actually modifying them.

Here's an example invocation of this command:
```bash
python -mpretix confirm_payments \
--no-dry-run
```
Note that this doesn't require you to pass any event slug, since it runs for all events at once. It inspects the address that was associated with each order (at
the time the ticket was reserved) to determine if sufficient payments were made
for the order. It may check for an ethereum payment or some kind of token
payment depending on what was chosen during the checkout process. It checks using the RPC URLs that were configured in the admin settings while setting up the event. If no rpc urls were set, then the command gives yet another chance to type in a rpc url (like infura). The `--no-dry-run` flag directs the command to
update order statuses based on the checks that are performed. Without this
flag, the command will only display how records would be modified.

For more details about the `confirm_payments` command and its options, the
command may be invoked with `--help`:
```bash
python -mpretix confirm_payments --help
```

## License

Copyright 2019 Victor (https://github.com/vic-en)

Released under the terms of the Apache License 2.0
Finally, for Devconnect 2025, the plugin was rewritten to use [Daimo Pay](https://pay.daimo.com), providing any-chain checkout and automatic refunds. See [DIP-64](https://forum.devcon.org/t/dip-64-universal-checkout-for-devcon-nect/5346).
22 changes: 1 addition & 21 deletions pretix_eth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy


class PluginApp(AppConfig):
name = 'pretix_eth'
verbose_name = 'Pretix Ethereum Payment Provider'

class PretixPluginMeta:
name = ugettext_lazy('Pretix Ethereum Payment Provider')
author = 'Pretix Ethereum Payment Plugin Contributors'
category = 'PAYMENT'
description = ugettext_lazy('An ethereum payment provider plugin for pretix software')
visible = True
version = '2.0.6-dev'

def ready(self):
from . import signals # NOQA


default_app_config = 'pretix_eth.PluginApp'
__version__ = "5.6.1-dev"
20 changes: 20 additions & 0 deletions pretix_eth/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _

from . import __version__


class EthApp(AppConfig):
name = 'pretix_eth'
verbose_name = 'Pretix Ethereum Payment Provider'

class PretixPluginMeta:
name = _('Pretix Ethereum Payment Provider')
author = 'Pretix Ethereum Payment Plugin Contributors'
category = 'PAYMENT'
description = _('An ethereum payment provider plugin for pretix software')
visible = True
version = __version__

def ready(self):
from . import signals # NOQA
Loading