Skip to content

t523: feat(paypal): PayPal PPCP integration review compliance #725

@superdav42

Description

@superdav42

Summary

PayPal reviewed our PPCP integration and provided specific feedback requiring changes before partnership approval. This task covers the 5 code changes needed in this repo.

Changes Required

  1. Disconnect disclaimer — Update confirm dialog to use PayPal's required wording: "Disconnecting your PayPal account will prevent you from offering PayPal services and products on your website. Do you wish to continue?"

  2. Onboarding failure UI — Display PayPal's required error messages when payments_receivable or email_confirmed is false after OAuth onboarding.

  3. Block checkout for invalid merchant status — Remove paypal-rest from active gateways when merchant can't receive payments.

  4. Add payee.merchant_id to orders — Include payee.merchant_id in purchase_units when using OAuth mode.

  5. Log PayPal-Debug-Id headers — Capture and log the PayPal-Debug-Id response header from API calls for review submission.

Files Affected

  • inc/gateways/class-paypal-rest-gateway.php
  • inc/gateways/class-paypal-oauth-handler.php

Acceptance Criteria

  • Disconnect dialog shows PayPal's exact required disclaimer text
  • Settings page shows error banner when payments_receivable=false
  • Settings page shows error banner when email_confirmed=false
  • PayPal gateway hidden from checkout when merchant status is invalid
  • Orders include payee.merchant_id in purchase_units when merchant_id is set
  • PayPal-Debug-Id logged from every API response
  • All existing PayPal tests still pass

aidevops.sh v3.5.541 plugin for OpenCode v1.3.12 with claude-opus-4-6 spent 22m and 617 tokens on this as a headless worker.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions