Skip to content
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

Implement new Square checkout flow #101

Merged
merged 15 commits into from
Oct 18, 2023
Merged

Implement new Square checkout flow #101

merged 15 commits into from
Oct 18, 2023

Conversation

binaryf0x
Copy link

Replaces the inline credit card form with a system for creating real Square payment links, similar to the Paypal integration. The ability to specify an arbitrary payment amount has been removed. Payment completion is signaled via a webhook. For auditing purposes all valid webhook calls are logged.

@admin.display(description='Artist')
def clickable_artist(self, obj):
return format_html('<a href="{}">{}</a>',
reverse('admin:artshow_artist_change',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is reverse doing here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverse takes a reference to a route and generates a (relative) URL which will resolve to the route. In this example it will generate a URL which links to the admin page for editing the given artist. In this case I think Django now supports this particular case as a built-in feature: https://docs.djangoproject.com/en/4.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display_links

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, that's not what list_display_links does.

Base automatically changed from remove_paypal to main October 16, 2023 01:41
@binaryf0x binaryf0x merged commit 396c723 into main Oct 18, 2023
1 check passed
@binaryf0x binaryf0x deleted the update_square branch October 18, 2023 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants