Showing results for 
Search instead for 
Did you mean: 

Guest checkout using Java SDK

Posted on



I want to know if there is a way to use guest checkout, i.e. allowing a user to pay with a credit/debit card without logging into(or signing up for) PayPal, by using the Java Checkout SDK.

I've integrated with PayPal using the Java checkout SDK.


Here is my ApplicationContext config:






    public ApplicationContext applicationContext() {
        ApplicationContext applicationContext = new ApplicationContext();

        return applicationContext;






Here is my createOrder logic:






public Order createOrder(OrderCreate orderCreate) {
        Order order;

        OrderRequest orderRequest = new OrderRequest();


        List<PurchaseUnitRequest> purchaseUnitRequests = new ArrayList<>();
        PurchaseUnitRequest purchaseUnitRequest =
                new PurchaseUnitRequest()
                            new AmountWithBreakdown()                      .currencyCode(orderCreate.getAmount().getCurrency())                         .value(orderCreate.getAmount().getValue().toString())


        OrdersCreateRequest request = new OrdersCreateRequest().requestBody(orderRequest);

        try {
            HttpResponse<Order> response = this.payPalHttpClient.execute(request);
            order = response.result();
  "Order ID: {}",;
        } catch (IOException ex) {
           //erro handling
        return order;






After creating an order and following the "Approve" hateoas link returned after creating an Order, it takes me to the following page:


Screenshot from 2021-08-03 10-10-36.png

Which doesn't allow me to make a credit/debit card payment without a PayPal account.


I know that by making use of PayPal's smart buttons you can setup a checkout button like this that allows you to make credit/debit card payments:

Screenshot from 2021-08-03 10-20-10.png


Is this at all possible using the Java checkout SDK? Is there some extra configuration that I need to set that I'm missing?


Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.