Skip to content

PayPal/Venmo checkout flow — SDK buttons and wallet transaction support #428

@aron23

Description

@aron23

Context

Project: PayPal/Venmo Integration
Priority: P0 — buyer-facing payment flow

Goal

Add PayPal and Venmo as payment methods in the SDK, following the existing wallet payment pattern (Apple Pay, Google Pay). Buyer clicks PayPal/Venmo button → popup approval → capture → transactedObserver callback.

Architecture

  • PayPal JS SDK v6 loads inside secure-tags-lib messenger iframe (PCI isolation)
  • New button web components render PayPal/Venmo branded buttons
  • Eligibility check via sdkInstance.findEligibleMethods() determines button visibility
  • Venmo eligibility: US buyer + USD + merchant has Venmo enabled
  • Transaction flows through existing processWalletTransaction() messenger path
  • PayPal popup handles buyer auth; onApprove triggers capture via paypal-service

Repos Involved

  • payment-components — new button components, wallet type constants, messenger events, exports
  • secure-tags-lib — messenger iframe loads PayPal JS SDK v6, handles wallet auth, relays to WebSocket
  • tags-secure-socket — extend wallet_transaction.py to route PAYPAL/VENMO to paypal-service
  • paypal-service — order create, capture, client token endpoints (already exists)

Acceptance

  • PayPal button appears when merchant has PayPal onboarded and enabled
  • Venmo button appears when additionally eligible (US, USD, merchant toggle)
  • Clicking button opens PayPal popup, buyer approves, payment captures
  • transactedObserver fires with standard PayTheory transaction response
  • Cancel and error flows handled (popup closed, instrument declined, etc.)
  • Buttons do NOT appear if merchant hasn't completed PayPal onboarding
  • Amount conversion (cents → PayPal dollar string) handled correctly
  • Metadata passthrough (reference, invoiceId, accountCode) mapped to PayPal fields
  • Repo-level spec docs in payment-components and secure-tags-lib

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions