{"id":49244977,"url":"https://github.com/paypal/ruleshub","last_synced_at":"2026-04-24T21:04:42.576Z","repository":{"id":351382618,"uuid":"1089752670","full_name":"paypal/ruleshub","owner":"paypal","description":"Ruleshub is a comprehensive collection of AI-optimized rules and guidelines for popular APIs and platforms.","archived":false,"fork":false,"pushed_at":"2026-04-14T18:33:08.000Z","size":1235,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T20:24:48.044Z","etag":null,"topics":["ai-rules","chatgpt","checkout","claude-code","cursor","cursor-rules","llm","mcp","migration-guides","paypal","paypal-checkout"],"latest_commit_sha":null,"homepage":"https://developer.paypal.com/home/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paypal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-04T19:05:40.000Z","updated_at":"2026-04-14T18:33:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/paypal/ruleshub","commit_stats":null,"previous_names":["paypal/ruleshub"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/paypal/ruleshub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fruleshub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fruleshub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fruleshub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fruleshub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paypal","download_url":"https://codeload.github.com/paypal/ruleshub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paypal%2Fruleshub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32240614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-rules","chatgpt","checkout","claude-code","cursor","cursor-rules","llm","mcp","migration-guides","paypal","paypal-checkout"],"created_at":"2026-04-24T21:04:40.159Z","updated_at":"2026-04-24T21:04:42.570Z","avatar_url":"https://github.com/paypal.png","language":"JavaScript","funding_links":["https://developer.paypal.com/","https://developer.paypal.com/api/rest/"],"categories":[],"sub_categories":[],"readme":"# RulesHub (Beta)\n\nA comprehensive collection of AI-optimized rules and guidelines for integrating, upgrading popular APIs and platforms. These rules are designed to work seamlessly with AI code assistants like Cursor IDE and Claude Code to provide intelligent, context-aware code suggestions for new integrations, upgrades, and migrations.\n\n## Table of Contents\n\n- [Available Rule Packs](#available-rule-packs)\n  - [PayPal Standard Checkout](#paypal-standard-checkout)\n  - [PayPal Expanded Checkout](#paypal-expanded-checkout)\n  - [PayPal Enterprise Checkout](#paypal-enterprise-checkout)\n  - [PayPal BNPL US (Pay Later)](#paypal-bnpl-us-pay-later)\n  - [PayPal NVP/SOAP to REST API Upgrade](#paypal-nvpsoap-to-rest-api-upgrade)\n  - [PayPal v5 to v6 Web SDK Upgrade](#paypal-v5-to-v6-web-sdk-upgrade)\n  - [PayPal v4 to v6 Web SDK Upgrade](#paypal-v4-to-v6-web-sdk-upgrade)\n- [How to Use](#how-to-use)\n  - [Method 1: RulesHub CLI](#method-1-ruleshub-cli)\n  - [Method 2: Direct Copy](#method-2-direct-copy)\n  - [Method 3: Git Submodule](#method-3-git-submodule)\n  - [Method 4: Reference in Existing Files](#method-4-reference-in-existing-files)\n- [Key Benefits](#key-benefits)\n  - [Intelligent Code Detection](#intelligent-code-detection)\n  - [Comprehensive Coverage](#comprehensive-coverage)\n  - [AI-Optimized Design](#ai-optimized-design)\n- [Scenarios](#scenarios)\n  - [Scenario 1: Starting a New Integration](#scenario-1-starting-a-new-integration)\n  - [Scenario 2: Legacy Code Upgrade](#scenario-2-legacy-code-upgrade)\n  - [Scenario 3: Code Review and Security Audit](#scenario-3-code-review-and-security-audit)\n- [Customization](#customization)\n  - [Adding Your Own Rules](#adding-your-own-rules)\n  - [Environment-Specific Adaptations](#environment-specific-adaptations)\n- [Security First](#security-first)\n- [Feedback](#feedback)\n- [Contributing](#contributing)\n  - [Contribution Guidelines](#contribution-guidelines)\n- [Resources](#resources)\n- [License](#license)\n\n## Available Rule Packs\n\n### PayPal Standard Checkout\n\n**Location**: `paypal-checkout/standard-checkout/`\n\nBuild a new PayPal checkout integration with Smart Payment Buttons, or enhance an existing one.\n\n**Features:**\n\n- PayPal branded checkout button integration\n- Server-side order creation and capture\n- Multi-language support (Node.js, Python, PHP, Java, .NET, Ruby)\n- Security best practices and PCI compliance\n- Sandbox testing and debugging patterns\n\n### PayPal Expanded Checkout\n\n**Location**: `paypal-checkout/expanded-checkout/`\n\nBuild or enhance an expanded checkout integration with advanced card fields and additional payment methods.\n\n**Features:**\n\n- Advanced card field integration (hosted fields)\n- 3D Secure authentication support\n- Custom card form styling and validation\n- Multi-payment method support\n- PCI-compliant card processing patterns\n\n### PayPal Enterprise Checkout\n\n**Location**: `paypal-checkout/enterprise-checkout/`\n\nBuild or enhance an enterprise-level checkout integration for platforms and marketplaces.\n\n**Features:**\n\n- Braintree Direct and Multiparty integration\n- Platform and marketplace payment flows\n- Vault and recurring payment patterns\n- Advanced fraud protection and risk management\n- PCI Level 1 compliance guidance\n\n### PayPal BNPL US (Pay Later)\n\n**Location**: `paypal-bnpl-us/`\n\nAdd Buy Now Pay Later capabilities to new or existing PayPal integrations for US merchants.\n\n**Features:**\n\n- Pay Later messaging and button integration\n- Pay in 4 and Pay Monthly options\n- Upstream messaging placement guidance\n- Eligibility and merchant configuration\n\n### PayPal NVP/SOAP to REST API Upgrade\n\n**Location**: `upgrade-nvp-soap-to-rest/`\n\nUpgrade from PayPal legacy APIs (NVP/SOAP) to modern REST APIs, or start a new REST API integration from scratch.\n\n**Features:**\n\n- Automatic legacy code pattern detection\n- REST API endpoint mappings with official documentation links\n- Multi-language support (Node.js, Python, PHP, Java, .NET, Ruby)\n- Security best practices and vulnerability detection\n- Side-by-side code transformation examples\n- Webhook implementation patterns\n- Environment configuration templates\n\n### PayPal v5 to v6 Web SDK Upgrade\n\n**Location**: `upgrade-to-v6/v5-to-v6-upgrade/`\n\nUpgrade from PayPal v5 Web SDK to v6, or start a new v6 Web SDK integration with the latest patterns and features.\n\n**Features:**\n\n- **Interactive Upgrade Detection**: Analysis of existing v5 implementations\n- **Pattern-Based Conversion**: Detection and transformation of v5 patterns to v6\n- **Save Payment/Vault Operations**: Implementation of payment method storage and reuse\n- **Payment Methods**: Support for Venmo, Pay Later, and Credit messaging\n- **Security Implementation**: Server-side token generation and credential management\n- **TypeScript Support**: TypeScript definitions and type-safe implementations\n- **Error Handling**: Debug IDs and operational patterns\n- **Upgrade Strategies**: Parallel testing and phased rollout approaches\n\n### PayPal v4 to v6 Web SDK Upgrade\n\n**Location**: `upgrade-to-v6/v4-to-v6-upgrade/`\n\nUpgrade from PayPal checkout.js v4 to v6 Web SDK, or start a new v6 Web SDK integration.\n\n**Features:**\n\n- **Terminology Mapping**: Complete v4 to v6 button label and funding source mapping\n- **Pattern-Based Conversion**: Detection and transformation of v4 patterns to v6\n- **Component Migration**: Checkout.js to web components migration\n- **Payment Methods**: Venmo, Pay Later, and additional funding sources\n- **Server Integration**: Updated server-side order and capture flows\n- **Error Handling**: Debug IDs and v6 error patterns\n\n## How to Use\n\n### Method 1: RulesHub CLI\n\nInteractive CLI that copies the rule pack you need into your project -- whether you're starting a new integration or upgrading an existing one.\n\n**Setup (one-time):**\n\n```bash\n# Clone the repo\ngit clone https://github.com/paypal/ruleshub.git\n\n# Link it globally\ncd ruleshub\nnpm link\n\n# Then from any project folder:\ncd your-project\nruleshub\n\nor \n\nnpm install git+https://github.com/paypal/ruleshub.git\n```\n\nThe CLI will prompt you to:\n1. Select a rule pack\n2. Select a target (Cursor IDE or Claude Code)\n\nFiles are copied to the appropriate location automatically.\n\n![Terminal installation 1](cli-interactive.png)\n\nYou can also use flags for non-interactive mode:\n\n```bash\nruleshub --pack 4 --target 1\n```\n![Terminal Installation 2](cli-flags.png)\n\n### Method 2: Direct Copy\nCopy the relevant rules file to your project:\n\n```bash\n# Choose the appropriate rule pack for your project\ncp [rule-pack-folder]/rules.md your-project/.cursor/rules/CURSOR.mdc  # For Cursor IDE\ncp [rule-pack-folder]/rules.md your-project/CLAUDE.md     # For Claude Code\n```\n\n### Method 3: Git Submodule\nAdd RulesHub as a submodule to your project:\n\n```bash\ncd your-project\ngit submodule add https://github.com/paypal/ruleshub.git rules\n```\n\n### Method 4: Reference in Existing Files\nAdd references in your existing `CURSOR.mdc` or `CLAUDE.md`:\n\n```markdown\n# PayPal Rules\nApply patterns from RulesHub/[rule-pack-folder]/rules.md\n```\n\n## Key Benefits\n\n### Intelligent Code Detection\n\n- **Pattern Recognition**: AI assistants detect legacy code patterns (NVP/SOAP calls, v5 SDK implementations) and guide new integrations\n- **Context-Aware Suggestions**: Integration and upgrade suggestions based on code context\n- **Security Scanning**: Detection of security vulnerabilities and practices\n- **Setup Analysis**: Detection of current PayPal integration patterns through code analysis\n\n### Comprehensive Coverage\n\n- **Multi-Language Support**: Rules work across JavaScript, TypeScript, Python, PHP, Java, .NET, and more\n- **Integration \u0026 Upgrade Paths**: From new integrations to upgrades, authentication to webhooks, various aspects covered\n- **Payment Methods**: Support for save payments, Venmo, Pay Later, and credit messaging\n- **Best Practices**: Industry-standard security and performance practices included\n\n### AI-Optimized Design\n\n- **Cursor IDE Integration**: Integration with Cursor's AI capabilities\n- **Claude Code Compatible**: Works with Claude Code's context understanding\n- **Documentation**: Includes links to official API documentation and examples\n- **Integration \u0026 Upgrade Support**: Enables new integrations, parallel testing, and phased rollouts\n- **TypeScript Definitions**: Type safety and IntelliSense support\n\n## Scenarios\n\n### Scenario 1: Starting a New Integration\n\nWhen beginning a new PayPal integration (checkout, BNPL, payments), AI assistants will:\n\n- Guide you through the latest API patterns (REST APIs, v6 SDK)\n- Provide configuration templates and code examples\n- Include error handling and security best practices\n- Recommend current practices for checkout, Pay Later, and vaulting\n- Support multi-language implementations (Node.js, Python, PHP, Java, .NET, Ruby)\n\n### Scenario 2: Legacy Code Upgrade\n\nWhen working with existing legacy code:\n\n- Detect outdated patterns (NVP/SOAP, v5 SDK)\n- Suggest equivalents (REST APIs, v6 SDK)\n- Provide step-by-step upgrade guidance\n- Support backward compatibility during transition\n- Support parallel testing strategies\n\n### Scenario 3: Code Review and Security Audit\n\nDuring development and review:\n\n- Flag potential security issues\n- Suggest performance optimizations\n- Recommend latest API versions and patterns (v6 SDK, REST APIs)\n- Support compliance with platform guidelines\n- Validate error handling and debug patterns\n\n## Customization\n\n### Adding Your Own Rules\nEach rule pack folder can be extended with project-specific rules:\n\n```markdown\n## Custom Project Rules\n- Your specific business logic patterns\n- Internal coding standards\n- Company-specific security requirements\n- Custom payment flow implementations\n- Environment-specific SDK configurations\n```\n\n### Environment-Specific Adaptations\nModify rules for different deployment environments:\n\n```markdown\n## Development Environment\n- Enable verbose logging\n- Use sandbox/test endpoints\n- Include debugging information\n- Enable PayPal Debug IDs for troubleshooting\n- Use development SDK configurations\n\n## Production Environment\n- Minimize sensitive data logging\n- Use production endpoints\n- Enhanced security validation\n- Implement proper error handling\n```\n\n## Security First\n\nAll rule packs prioritize security:\n\n- **Credential Management**: Environment variable recommendations\n- **HTTPS Enforcement**: Secure communication patterns only\n- **Data Protection**: No logging of sensitive information\n- **Vulnerability Detection**: Automatic flagging of security issues\n- **Compliance**: Platform-specific compliance requirements\n- **Server-Side Token Generation**: Client token patterns\n- **Webhook Signature Verification**: Webhook security implementation\n\n## Feedback\n\nWe'd love to hear about your experience with RulesHub.\n\n- **PayPal Documentation** - Official guides and API references: https://developer.paypal.com/\n\n## Contributing\n\nHelp improve RulesHub by:\n\n1. **Testing Rules**: Use the rules in your projects and provide feedback\n2. **Documenting Gaps**: Report missing patterns or edge cases\n3. **Adding New Upgrades**: Contribute rules for other platforms\n4. **Improving Examples**: Enhance code examples and documentation\n\n### Contribution Guidelines\n- Test all rules thoroughly before submitting\n- Include comprehensive documentation\n- Follow existing file structure and naming conventions\n- Ensure security best practices are maintained\n\n## Resources\n\n- **API Documentation**: Links to official platform documentation\n  - [PayPal REST APIs](https://developer.paypal.com/api/rest/)\n  - [PayPal v6 Web SDK](https://docs.paypal.ai/payments/methods/paypal/sdk/js/v6/paypal-checkout)\n  - [PayPal Vault/Save Payments](https://docs.paypal.ai/payments/save/sdk/paypal/js-sdk-v6-vault)\n- **Upgrade Guides**: Platform-specific upgrade resources\n- **Community Support**: Developer community forums and support\n- **Best Practices**: Industry-standard implementation patterns\n- **TypeScript Definitions**: Official type definitions for v6 SDK\n\n## License\n\nSee [LICENSE](LICENSE) for details.\n\n---\n\n\u003e **Note**: Start with sandbox/test environments when using these rule packs. Validate all implementations against your specific business requirements before deploying to production.\n\u003e \n\u003e **New to PayPal?** Use the checkout and BNPL rule packs to build your integration from scratch with best practices built in. **Upgrading?** Use the migration and upgrade rule packs to move from legacy APIs or older SDKs to the latest versions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaypal%2Fruleshub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaypal%2Fruleshub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaypal%2Fruleshub/lists"}