• Docs

    PayPal Commerce Platform for Business

    • Overview
    • Get started
    • Accept Payments
    • Make Payments
    • Test and Go Live

    PayPal Commerce Platform for Marketplaces and Platforms

    • Overview
    • Get Started
    • Onboard Sellers
    • Accept Payments
    • Make Payments
    • Manage Risk
    • Streamline Operations
    • Test and Go Live

    PayPal Commerce Platform for Enterprise

    • Overview
    • Accept Payments with Braintree
    • Make Payments with Hyperwallet
    • Manage Risk with Simility

    Docs Catalog

    • See All Docs
  • APIs
  • Tools

    Reference

    • Design Guidelines
    • Glossary

    Developer Tools

    • Sandbox
    • PayPal Demo
    • API Executor
    • API Status
    • Test Credit Card Generator

    Regional Codes

    • Currency Codes
    • Country Codes
    • State and Province Codes
    • Locale Codes
  • Support
  • PayPal.com
  • PayPal Checkout
    • Overview
    • Basic Integration
    • Integration Features
      • Shipping Changes
      • Alternative Payment Methods
      • Standard Card Fields
      • Handle Funding Failures
      • Show Cancellation Page
      • Handle Errors
      • Customize the Buttons
      • Standalone Buttons
      • Authorize and Capture
      • Refund Transaction
      • Send funds to another account
      • Add Webhooks
      • Search Transactions
      • Handle Disputes
      • Use Radio Buttons
      • Validate User Input
      • Show Confirmation Page
      • Update Order Details
    • Best Practices
      • Integrate Smart Payment Buttons
      • Feature PayPal Prominently
      • Implement the Pay Now Experience
      • Allow for Order Completion Two or Fewer Steps
      • Accept PayPal in All Purchase Flows
      • Pass Accurate Billing and Shipping Information
      • Provide Clear Error Messaging and Resolution Paths
      • Void Authorizations and Orders When Needed
    • Troubleshoot
      • Performance
      • Browser Support
      • Internet Explorer
    • Reference
      • Customize SDK Script
      • Call Orders API from your Server
        • Set Up Server-Side SDK
        • Set Up Transaction
        • Set Up Authorization
        • Get Transaction Details
        • Capture Transaction
        • Create Authorization
        • Capture an Authorization
        • Negative Testing
      • Upgrade Your Checkout Integration
      • Orders API Reference
      • Payments API Reference

Show a Cancellation Page

When a buyer cancels a payment, they typically return to the parent page. You can instead use the onCancel function to show a cancellation page or return to the shopping cart:

paypal.Buttons({
  onCancel: function (data) {
    // Show a cancel page, or return to cart
  }
}).render('#paypal-button-container');

Developer

  • Docs Catalog
  • APIs
  • Engineering Blog
  • About Us

Support

  • FAQ
  • Help Center
  • Technical Support
  • Community
  • Contact Sales

Tools

  • PayPal Demo
  • API Executor
  • API Status
  • Sandbox
  • GitHub
  • Partner Directory
  • PSD2 Compliance

Family

  • PayPal
  • Braintree
  • Hyperwallet
  • Simility
  • Privacy
  • Legal
  • Contact

© 2020 PayPal

Popular Search Queries
  • sandbox
  • client id and secret
  • IPN (Instant Payment Notifications)
  • refund payments
  • buttons
PayPal Help
FAQ's

FAQ's

Forum

Tech Support Community

PayPal Community
  • Test Credit Card numbers for use on PayPal sandbox
  • Merchant Security Upgrade Testing
  • Inserting company logo in payment page
  • Checkout as Guest Option Turned on, but option not available to customers
  • Create specific paypal button for 3 types of payment options