Skip to content

feat: Add Mini Program payment bridge for WeChat Pay#13

Open
douglas-ou wants to merge 4 commits intomainfrom
add-miniprogram-payment-bridge
Open

feat: Add Mini Program payment bridge for WeChat Pay#13
douglas-ou wants to merge 4 commits intomainfrom
add-miniprogram-payment-bridge

Conversation

@douglas-ou
Copy link
Member

Summary

  • Add Mini Program payment bridge for WeChat Pay, enabling seamless payment flow in WeChat Mini Program environment
  • Add MiniProgramUpgradePrompt component to guide users to upgrade when payment is needed
  • Add wechat-payment-client-context module for handling WeChat payment orchestration
  • Refactor event registration flow to support Mini Program payment integration
  • Add comprehensive design documents and specifications

Changes

New Features

  • MiniProgramUpgradePrompt - Prompt users to upgrade when payment is required in Mini Program
  • wechat-payment-client-context - Client-side context for WeChat payment orchestration
  • wechat-prepare.ts - Server-side payment preparation logic

Components Updated

  • EventRegistrationForm - Support Mini Program payment flow
  • EventRegistrationModal - Integrate upgrade prompt
  • PaymentModal - Enhanced for Mini Program bridge integration

Documentation

  • openspec/changes/miniprogram-payment-bridge/ - Design docs, contracts, and specifications

Test Plan

  • Verify Mini Program upgrade prompt displays correctly
  • Test payment flow in WeChat Mini Program environment
  • Verify fallback behavior for non-Mini Program clients

- Introduced a shared WeChat payment preparation API for event ticket payments.
- Defined a Mini Program bridge channel with strict error handling and no fallback policy.
- Established a cross-repo bridge contract for compatibility between H5 and Mini Program shell.
- Updated event ticket order responses to include channelized payment payloads.
- Ensured backward compatibility during the transition phase.

This change aims to enhance payment reliability and streamline the payment process for Mini Program users.
- Implemented a new Mini Program upgrade prompt to handle payment bridge requirements.
- Enhanced the Event Registration Form and Modal to manage Mini Program upgrade messages.
- Integrated WeChat payment client context to facilitate channel selection and payment processing.
- Updated server routes to support new payment preparation logic and handle Mini Program bridge capabilities.

These changes improve user experience by providing clear upgrade prompts and ensuring compatibility with the Mini Program payment system.
- Introduced a new method to ensure the WeChat Mini Program bridge is properly initialized before requesting payments.
- Enhanced the Mini Program bridge interface to include detailed request and response handling for payment operations.
- Implemented a message listener for handling bridge responses, improving the reliability of payment requests.
- Updated the payment modal to utilize the new bridge methods, ensuring a seamless payment experience.

These changes enhance the robustness of the payment integration and improve error handling for Mini Program users.
- Created design documentation outlining the context, goals, and decisions for the Mini Program payment bridge integration.
- Added a proposal detailing the changes required for the shared WeChat payment preparation API and the introduction of the Mini Program bridge channel.
- Documented tasks for implementation, including server and frontend updates to support the new payment orchestration logic.
- Established a bridge contract for compatibility between H5 and Mini Program shell, including error code mappings and security requirements.
- Defined requirements for event ticket purchase and WeChat payment orchestration specifications to ensure proper channel selection and payload handling.

These additions provide a comprehensive framework for implementing the Mini Program payment bridge, enhancing payment reliability and user experience.
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.

1 participant