Last updated: October 14, 2026
The SDK ships PayPal-branded buttons you drop into your layout: PayPalButton, PayLaterButton, and PayPalCreditButton, all part of the payment-buttons module. Use these because they carry PayPal's wordmark, brand colors, typography through the PayPalOpen font, and accessibility.
Before you begin
Complete Install and set up.
Declare the button in your layout. It renders without an order or session:
<com.paypal.android.paymentbuttons.PayPalButton
android:id="@+id/payPalButton"
android:layout_width="match_parent"
android:layout_height="wrap_content" />Or create it programmatically with PayPalButton(context).
Set these in code or through the XML attribute. The PayPalButton class supports color, label, shape, and size.
| Property (code) | XML attribute | Values | Default |
|---|---|---|---|
color | paypal_color | PayPalButtonColor: GOLD, BLUE, WHITE, BLACK, SILVER | GOLD |
label | paypal_label | PayPalButtonLabel: PAYPAL (wordmark only), CHECKOUT, BUY_NOW, PAY | PAYPAL |
shape | payment_button_shape | PaymentButtonShape: ROUNDED, PILL, RECTANGLE | ROUNDED (or your Material theme's shape) |
size | payment_button_size | PaymentButtonSize (defaults to MEDIUM) | MEDIUM |
customCornerRadius | none | Float (dp), an alternative to shape that you cannot combine with it | none |
payPalButton.color = PayPalButtonColor.GOLD
payPalButton.label = PayPalButtonLabel.CHECKOUT
payPalButton.shape = PaymentButtonShape.PILLNotes:
GOLD color is the recommended default. PayPal's research shows it converts best. The BLUE color is the preferred alternative. The WHITE, BLACK, and SILVER colors are secondary.WHITE color renders with an outline for contrast.PayLaterButton or PayPalCreditButton. The PayLaterButton class shares the color enum (PayPalButtonColor) with PayPalButton and also exposes a paylater_color XML attribute. The PayPalCreditButton class has its own distinct enum, PayPalCreditButtonColor (DARK_BLUE, BLACK, GOLD, WHITE).Attach a click listener and start checkout from it:
payPalButton.setOnClickListener { beginCheckout() }The beginCheckout() method prepares the session, creates the order, and calls start().
The PayPalButton and PayPalCreditButton classes set their own content description so screen readers announce them correctly. The PayLaterButton class does not set one, so add your own through android:contentDescription if you use it. The module ships English strings only today. Make sure your layout gives the button an adequate touch target and sufficient contrast against its background.