Accept a Przelewy24 payment
Learn how to accept Przelewy24 (P24), the most popular payment method in Poland.
Caution
We recommend that you follow the Accept a payment guide unless you need to use manual server-side confirmation, or your integration requires presenting payment methods separately. If you’ve already integrated with Elements, see the Payment Element migration guide.
Przelewy24 is a single use payment method where customers are required to authenticate their payment. Customers pay with Przelewy24 by redirecting from your website, authorizing the payment, then returning to your website where you get immediate notification on whether the payment succeeded or failed.
Set up StripeServer-sideClient-side
First, you need a Stripe account. Register now.
Server-side 
This integration requires endpoints on your server that talk to the Stripe API. Use the official libraries for access to the Stripe API from your server:
Client-side 
The Stripe Android SDK is open source and fully documented.
To install the SDK, add stripe-android
to the dependencies
block of your app/build.gradle file:
Note
For details on the latest SDK release and past versions, see the Releases page on GitHub. To receive notifications when a new release is published, watch releases for the repository.
Configure the SDK with your Stripe publishable key so that it can make requests to the Stripe API, such as in your Application
subclass:
Note
Stripe samples also use OkHttp and GSON to make HTTP requests to a server.
Create a PaymentIntentServer-sideClient-side
A PaymentIntent represents your intent to collect payment from a customer and tracks the lifecycle of the payment process.
Server-side
Create a PaymentIntent
on your server and specify the amount
to collect, and eur
or pln
as the currency. If you have an existing Payment Intents integration, add p24
to the list of payment method types.
Instead of passing the entire PaymentIntent object to your app, return its client secret. The PaymentIntent’s client secret is a unique key that lets you confirm the payment and update payment details on the client, without allowing manipulation of sensitive information, like the payment amount.
Client-side
On the client, request a PaymentIntent from your server and store its client secret.
Statement descriptors with Przelewy24
You can set a custom statement descriptor before confirming the PaymentIntent. For Przelewy24, the statement descriptor is limited to 14 characters. It is visible on your customer’s bank records within the payment’s description, with the format /OPT/X/////P24-XXX-XXX-XXX {statement_
, where /OPT/X/////P24-XXX-XXX-XXX
is a unique reference for the payment generated by Przelewy24.
Collect payment method detailsClient-side
In your app, collect your customer’s email address. Create a PaymentMethodCreateParams
with the billing details.
Submit the payment to StripeClient-side
Retrieve the client secret from the PaymentIntent you created and call PaymentLauncher confirm. This presents a webview where the customer can complete the payment. Upon completion, onPaymentResult
is called with the result of the payment.