Payment integration
The KASKO framework supports multiple payment providers through a pluggable payment handler system. This guide covers how to configure and use payment components in your webapp.
Supported Payment Methods
free
No payment required (free products)
Immediate
distributor_web
Distributor-handled payments
Immediate
stripe_intents
Stripe card payments with 3D Secure
Form-based
stripe_sepa
SEPA Direct Debit via Stripe
Form-based
stripe_bancontact
Bancontact via Stripe
Redirect
paypal
PayPal via Braintree
Popup
paypal_direct
Direct PayPal integration
Redirect
postfinance
Swiss PostFinance
Redirect
slimpay
SlimPay SEPA processor
Redirect
twikey
Direct bank transfer via Twikey
Redirect
Payment Components
form-payment
The main payment form container that renders available payment methods as radio buttons. The user selects their preferred method, and the appropriate payment UI (card form, SEPA form, etc.) is displayed.
Available payment methods are determined by backend configuration, not by component config. The component only accepts content_key for labeling the payment method options.
Only include content keys for payment methods that are enabled for your product.
When a user selects a payment method, the value is stored in the payment_method input field (e.g., creditcard/stripe_intents, sepa/stripe_sepa, paypal/paypal). You can also pre-select a payment method using default_values:
form-button-payment
The payment submission button. This triggers the payment flow when clicked.
Example Payment Screen
Payment Request Configuration
In the manifest, you must enable the payment request type:
Payment Flow Types
Form-based (Stripe Card, SEPA)
Payment form loads and mounts Stripe Elements
User enters card/IBAN details
User clicks payment button
Framework creates payment method with Stripe
If 3D Secure is required, user is redirected for authentication
Payment is completed and user proceeds to success screen
Popup-based (PayPal)
User clicks PayPal button
PayPal popup window opens
User logs in and authorizes payment
Popup closes and returns payment token
Payment is completed
Redirect-based (PostFinance, SlimPay, Twikey)
User clicks payment button
User is redirected to external payment provider
User completes payment on provider's site
User is redirected back to webapp
Framework verifies payment status
Payment-Related Flags
These flags are available in JsonLogic for conditional logic:
is_3d_secure
boolean
3D Secure authentication is in progress
payment_back
boolean
User returned from payment redirect
payment_tbd
boolean
Payment is pending/to be determined
payment_fail
boolean
Payment has failed
payment_success
boolean
Payment completed successfully
Example usage:
Error Handling
Payment errors are displayed through the error-list component. Each payment method has specific error codes.
Stripe Card Errors
incomplete_number
form.cc_number.errors.incomplete_number
Card number is incomplete
incomplete_expiry
form.cc_expiry.errors.incomplete_expiry
Expiry date is incomplete
incomplete_cvc
form.cc_cvc.errors.incomplete_cvc
CVC is incomplete
invalid_number
form.cc_number.errors.invalid_number
Card number is invalid
invalid_expiry_month
form.cc_expiry.errors.invalid_expiry_month
Expiry month is invalid
invalid_cvc
form.cc_cvc.errors.invalid_cvc
CVC is invalid
card_declined
form.cc_number.errors.card_declined
Card was declined
expired_card
form.cc_number.errors.expired_card
Card has expired
balance_insufficient
form.cc_number.errors.balance_insufficient
Insufficient balance
Stripe SEPA Errors
incomplete_iban
form.iban.errors.incomplete_iban
IBAN is incomplete
invalid_iban
form.iban.errors.invalid_iban
IBAN is invalid
invalid_iban_country_code
form.iban.errors.invalid_iban_country_code
Invalid country code
invalid_owner_name
form.account_holder.errors.invalid_owner_name
Invalid account holder name
PayPal Errors
PAYPAL_POPUP_CLOSED
form.paypal.errors.popup_closed
User closed the PayPal popup
PAYPAL_POPUP_OPEN_FAILED
form.paypal.errors.popup_failed
Failed to open popup (blocked?)
PAYPAL_FLOW_FAILED
form.paypal.errors.flow_failed
PayPal authorization failed
Content Keys for Payment
Standard content keys for payment screens:
Required Requests
For the success screen, you typically want to ensure payment has completed:
See the required requests guide for more information.
Last updated