Skip to content

stripe internal unused

2024-04-16 -- Currently unused Stripe implementation using PaymentElement.

(I.e. embedded in the website rather than re-directing to external Stripe page). This is possibly the better way to do things long term, but for now the external stripe page is easier to implement and will look more trustworthy.

LOAD_STRIPE_SCRIPT = f'const stripePromise = loadStripe('{STRIPE_PUBLIC_KEY}');' module-attribute

RETURN_URL_BASE = get_base_url(frontend_or_backend='frontend') module-attribute

STRIPE_PUBLIC_KEY = settings.STRIPE_PUBLIC_KEY module-attribute

PaymentElement

Bases: Component

Stripe payment element component that can be placed inside the StripeElement to present payment collection form.

This is for the PaymentElement approach

library = '@stripe/react-stripe-js' class-attribute instance-attribute

tag = 'PaymentElement' class-attribute instance-attribute

PaymentState

Bases: State

The payment page state.

This is for the PaymentElement approach

amount = 1000 class-attribute instance-attribute

client_secret = '' class-attribute instance-attribute

submit_disabled = True class-attribute instance-attribute

create_payment_intent()

The client secret for the payment intent.

StripeElements

Bases: Component

Stripe Element to place PaymentElement inside.

This is for the PaymentElement approach (present within same page, technically more flexible)

library = '@stripe/react-stripe-js' class-attribute instance-attribute

options = {} class-attribute instance-attribute

tag = 'Elements' class-attribute instance-attribute

payment_element_layout()

The payment element layout.