data-src=../../includes/paas-only.md

PayPal Website Payments Pro Hosted Solution payment method

data-variant=info
data-slots=text
PayPal has designated Website Payments Pro Hosted Solution as a legacy product.

PayPal's Website Payments Pro Hosted Solution allows merchants to accept credit cards, debit cards, and PayPal payments directly on their websites. The merchant must be based in the United Kingdom to create a new integration with this payment method. PayPal continues to support merchants with existing integrations outside the UK.

This payment method is applicable to Direct Payment and Express Checkout implementations of the Website Payments Pro Hosted Solution.

PayPal's product name for this payment method varies from country to country. PayPal Website Payments Pro Hosted Solution Integration Guide provides more information.

Website Payments Pro Hosted Solution workflow

The following diagram shows the workflow for placing an order when Website Payments Pro Hosted Solution is the selected payment method.

PayPal Website Payments Pro Hosted Solution sequence diagram

data-src=../../includes/graphql/payment-methods/hosted-pro-workflow.md

setPaymentMethodOnCart mutation

When you set the payment method for a Website Payments Pro Hosted Solution, you must set the code attribute to hosted_pro. In addition, the payload must contain a hosted_pro object, which defines the following attributes:

data-src=../../includes/graphql/payment-methods/hosted-pro-attributes.md

Example usage

The following example shows the setPaymentMethodOnCart mutation constructed for the Website Payments Pro Hosted Solution payment method.

Request:

mutation {
  setPaymentMethodOnCart(input: {
    cart_id: "H87OmEkvusP7ZPkd2634pQFxY4dKI3a4"
    payment_method: {
      code: "hosted_pro"
      hosted_pro: {
        cancel_url: "paypal/hostedpro/cancel"
        return_url: "paypal/hostedpro/return"
      }
    }
  })
  {
    cart {
      selected_payment_method {
        code
      }
    }
  }
}

Response:

{
  "data": {
    "setPaymentMethodOnCart": {
      "cart": {
        "selected_payment_method": {
          "code": "hosted_pro",
        }
      }
    }
  }
}