-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated Coinify api * Fixed small bug, added payment intents to admin page * Updated a few things after testing against coinify sandbox * use respones not .json() * Add user email to payment intent * Update src/shop/models.py * Update src/shop/views.py * Remove old callback endpoint * Update src/shop/views.py * Update src/shop/models.py * Remove unused property * Update src/shop/coinify.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update src/shop/views.py * maybe fix CI * remove broken linter, remove unused import * use apt to install deps * use sudo * libffi7 not found in apt * Added Coinify Payment Intent import to backoffice * Update src/backoffice/templates/includes/coinify_payment_intent_list_table.html * Add class list-group-item-action to Coinify dashboard payment intent link --------- Co-authored-by: Thomas Steen Rasmussen <tykling@bornhack.org> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a4a4dd5
commit 81ea920
Showing
22 changed files
with
432 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +0,0 @@ | ||
|
||
[submodule "src/vendor/coinify"] | ||
path = src/vendor/coinify | ||
url = https://github.com/tykling/python-sdk | ||
branch = python3-support | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% extends 'base.html' %} | ||
{% load bornhack %} | ||
|
||
{% block title %} | ||
Coinify Payment Intent List | Backoffice | {{ block.super }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="card"> | ||
<div class="card-header"><h3 class="card-title">Coinify Invoice List - BackOffice</h3></div> | ||
<div class="card-body"> | ||
<p>A list of coinify payment intents imported from their system via CSV files.</p> | ||
{% if not object_list %} | ||
<p class="lead">No Coinify Payment Intents found. Go import a CSV!</p> | ||
{% else %} | ||
<p> | ||
<a class="btn btn-secondary" href="{% url 'backoffice:coinify_dashboard' camp_slug=camp.slug %}"><i class="fas fa-undo"></i> Coinify Dashboard</a> | ||
<a class="btn btn-secondary" href="{% url 'backoffice:index' camp_slug=camp.slug %}"><i class="fas fa-undo"></i> Backoffice</a> | ||
{% include "includes/coinify_payment_intent_list_table.html" %} | ||
</p> | ||
{% endif %} | ||
<p> | ||
<a class="btn btn-secondary" href="{% url 'backoffice:coinify_dashboard' camp_slug=camp.slug %}"><i class="fas fa-undo"></i> Coinify Dashboard</a> | ||
<a class="btn btn-secondary" href="{% url 'backoffice:index' camp_slug=camp.slug %}"><i class="fas fa-undo"></i> Backoffice</a> | ||
</p> | ||
</div> | ||
</div> | ||
{% endblock content %} |
33 changes: 33 additions & 0 deletions
33
src/backoffice/templates/includes/coinify_payment_intent_list_table.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% load bornhack %} | ||
<table class="table table-striped table-hover datatable"> | ||
<thead> | ||
<tr> | ||
{% thh "coinify_id" "ID" %} | ||
{% thh "coinify_created" "Created" %} | ||
{% thh "requested_amount" %} | ||
{% thh "amount" %} | ||
{% thh "state (state_reason)" %} | ||
{% thh "reference_type" %} | ||
{% thh "original_order_id" %} | ||
{% thh "Shop order" %} | ||
{% thh "api_payment_intent" %} | ||
{% thh "created" "Imported" "The date this Coinify payment intent was imported" %} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for ci in object_list %} | ||
<tr> | ||
<td>{{ ci.coinify_id }}</td> | ||
<td data-order="{{ ci.coinify_created|sortable }}">{{ ci.coinify_created }}</td> | ||
<td data-order="{{ ci.requested_amount }}">{{ ci.requested_amount }} {{ ci.requested_currency }}</td> | ||
<td data-order="{{ ci.amount }}">{{ ci.amount }} {{ ci.currency }}</td> | ||
<td>{{ ci.state }} ({{ ci.state_reason }})</td> | ||
<td>{{ ci.reference_type }}</td> | ||
<td>{{ ci.original_order_id }}</td> | ||
<td>{{ ci.order }}</td> | ||
<td>{{ ci.api_payment_intent }}</td> | ||
<td data-order="{{ ci.created|sortable }}">{{ ci.created }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Generated by Django 4.2.16 on 2025-02-16 10:44 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django_prometheus.models | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('shop', '0087_coinifyapipaymentintent'), | ||
('economy', '0041_alter_expense_responsible_team'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='CoinifyPaymentIntent', | ||
fields=[ | ||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('created', models.DateTimeField(auto_now_add=True)), | ||
('updated', models.DateTimeField(auto_now=True)), | ||
('coinify_id', models.UUIDField(help_text='Coinifys internal ID for this invoice')), | ||
('coinify_created', models.DateTimeField(help_text='Created datetime in Coinifys end')), | ||
('reference_type', models.CharField(help_text='Coinifys reference type', max_length=100)), | ||
('merchant_id', models.UUIDField(help_text="The Merchant ID in Coinify's system.")), | ||
('merchant_name', models.TextField(help_text="The Merchant name as set in Coinify's system.")), | ||
('subaccount_id', models.CharField(blank=True, help_text='Unique identifier of a created sub-account.', max_length=32, null=True)), | ||
('subaccount_name', models.TextField(blank=True, help_text='Name given when creating the sub-account.', null=True)), | ||
('state', models.CharField(help_text='Coinify intent state', max_length=100)), | ||
('state_reason', models.CharField(help_text='Coinify intent state reason', max_length=100)), | ||
('original_order_id', models.CharField(blank=True, help_text='Order id', max_length=100, null=True)), | ||
('customer_email', models.TextField()), | ||
('requested_amount', models.DecimalField(decimal_places=2, help_text='The requested amount', max_digits=12)), | ||
('requested_currency', models.CharField(help_text='The requested currency.', max_length=3)), | ||
('amount', models.DecimalField(decimal_places=2, help_text='The payment amount', max_digits=12, null=True)), | ||
('currency', models.CharField(blank=True, help_text='The payment currency.', max_length=3, null=True)), | ||
('api_payment_intent', models.ForeignKey(blank=True, help_text='The original api payment intent', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='economy_coinify_payment_intents', to='shop.coinifyapipaymentintent')), | ||
('order', models.ForeignKey(blank=True, help_text='The Order this payment intent is for', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='economy_coinify_payment_intents', to='shop.order')), | ||
], | ||
options={ | ||
'ordering': ['-coinify_created'], | ||
'get_latest_by': ['coinify_created'], | ||
}, | ||
bases=(django_prometheus.models.ExportModelOperationsMixin('coinify_payment_intent'), models.Model), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.