Guest checkout using Java SDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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();
applicationContext
.brandName(brandName)
.landingPage(landingPage)
.returnUrl(returnUrl)
.cancelUrl(cancelUrl)
.userAction(userAction);
return applicationContext;
}
Here is my createOrder logic:
public Order createOrder(OrderCreate orderCreate) {
Order order;
OrderRequest orderRequest = new OrderRequest();
orderRequest.checkoutPaymentIntent(CAPTURE_PAYMENT_INTENT);
orderRequest.applicationContext(applicationContext);
List<PurchaseUnitRequest> purchaseUnitRequests = new ArrayList<>();
PurchaseUnitRequest purchaseUnitRequest =
new PurchaseUnitRequest()
.referenceId(orderCreate.getReferenceId())
.description(orderCreate.getDescription())
.customId(orderCreate.getCustomId())
.amountWithBreakdown(
new AmountWithBreakdown() .currencyCode(orderCreate.getAmount().getCurrency()) .value(orderCreate.getAmount().getValue().toString())
);
purchaseUnitRequests.add(purchaseUnitRequest);
orderRequest.purchaseUnits(purchaseUnitRequests);
OrdersCreateRequest request = new OrdersCreateRequest().requestBody(orderRequest);
request.prefer(REQUEST_PREFERENCE);
try {
HttpResponse<Order> response = this.payPalHttpClient.execute(request);
order = response.result();
log.info("Order ID: {}", 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:
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:
Is this at all possible using the Java checkout SDK? Is there some extra configuration that I need to set that I'm missing?
Thanks!
- Labels:
-
REST SDK

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- shopify says to ask to allow subscriptions so I am asking in Sandbox Environment
- PayPal Checkout support is disabled in REST APIs
- Sandbox is redirecting to /error?flowlogging_id=f699185f64292&code=BUSINESS_NAME_NOT_FOUND in Sandbox Environment
- PayPal checkout for this store is currently experiencing problems. Please try another payment method in PayPal Payments Standard
- Need help centering PayPal Checkout buttons - SOLVED! in PayPal Payments Standard