Simplified Integration: Server creates the Session, frontend only needs ID and secret
High Security: Sensitive information is configured on the server, frontend only holds temporary credentials
Centralized Management: Payment configuration, amount, currency and other information are managed uniformly on the server
1.
Server Creates Session: Merchant server calls UseePay API to create Checkout Session, obtaining checkoutSessionId and clientSecret
2.
Frontend Initialization: Frontend initializes SDK with publishable key and initializes Checkout with Session credentials
3.
Create Payment Element: Call createPaymentElement() to create payment form component
4.
Mount to Page: Mount payment element to specified DOM container
5.
Load Actions Object: Call loadActions() to get payment action methods
6.
User Action: User fills in payment information (card number, expiration date, etc.)
7.
Confirm Payment: Call actions.confirm() to submit payment
8.
3DS Verification (if required): SDK automatically handles 3D Secure verification flow
9.
Return Result: After payment completion, return result for frontend to handle accordingly
checkoutSessionId and clientSecret must be obtained from server
Each Session can only be used once, must recreate after payment completion
clientSecret has expiration time, need to recreate Session after expiration
Display loading state during payment process to avoid user repeated clicks
Provide clear error messages
Redirect or display success page promptly after successful payment
Do not close or refresh page during 3DS verification
Apple Pay: Only available on Safari browser and supported iOS devices
Google Pay: Requires user to be logged into Google account
Browser Requirements: Recommended to use modern browsers (Chrome 90+, Safari 14+, Firefox 88+)