On this page
No Headings
Last updated: September 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 rather than building your own: they carry PayPal's wordmark, brand colors, typography through the PayPalOpen font, and accessibility. This guide covers adding, styling, and wiring a button.
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. PayPalButton 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 cannot be combined with it | none |
payPalButton.color = PayPalButtonColor.GOLD
payPalButton.label = PayPalButtonLabel.CHECKOUT
payPalButton.shape = PaymentButtonShape.PILLNotes:
GOLD is the recommended default. PayPal's research shows it converts best. BLUE is the preferred alternative. WHITE, BLACK, and SILVER are secondary.WHITE renders with an outline for contrast.PayLaterButton or PayPalCreditButton. PayLaterButton shares PayPalButton's color enum (PayPalButtonColor) and also exposes a paylater_color XML attribute. PayPalCreditButton has its own distinct enum, PayPalCreditButtonColor (DARK_BLUE, BLACK, GOLD, WHITE).Attach a click listener and start checkout from it:
payPalButton.setOnClickListener { beginCheckout() }beginCheckout() prepares the session, creates the order, and calls start().
PayPalButton and PayPalCreditButton set their own content description so screen readers announce them correctly. PayLaterButton does not set one, so add your own through android:contentDescription if you use it. The module ships English strings only today, with no localized string resources. Make sure your layout gives the button an adequate touch target and sufficient contrast against its background.