Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseManaged Payments
Use Payment Links
Build a checkout page
Build an advanced integration
Build an in-app integration
Payment methods
Add payment methods
    Overview
    Payment method integration options
    Manage default payment methods in the Dashboard
    Payment method types
    Cards
    Pay with Stripe balance
    Crypto
    Bank debits
    Bank redirects
      Bancontact
      BLIK
      EPS
      FPX
      iDEAL
      Przelewy24
        Accept a payment
      SOFORT
      TWINT
      Wero
    Bank transfers
    Credit transfers (Sources)
    Buy now, pay later
    Real-time payments
    Vouchers
    Wallets
    Enable local payment methods by country
    Custom payment methods
Manage payment methods
Faster checkout with Link
Payment interfaces
Payment Links
Checkout
Web Elements
In-app Elements
Payment scenarios
Handle multiple currencies
Custom payment flows
Flexible acquiring
Orchestration
In-person payments
Terminal
Beyond payments
Incorporate your company
Crypto
Financial Connections
Climate
Understand fraud
Radar fraud protection
Manage disputes
Verify identities
HomePaymentsAdd payment methodsBank redirectsPrzelewy24

Accept a Przelewy24 payment

Learn how to accept Przelewy24 (P24), the most popular payment method in Poland.

Caution

The content of this section refers to a Legacy product. You should use the Accept a payment guide for the most recent integration path instead. While Stripe still supports this product, this support might end if the product is deprecated.

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 Stripe
Server-side

First, you need a Stripe account. Register now.

Use our official libraries for access to the Stripe API from your application:

Command Line
Ruby
Python
PHP
Java
Node
Go
.NET
No results
# Available as a gem sudo gem install stripe
Gemfile
Ruby
Python
PHP
Java
Node
Go
.NET
No results
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

Create a PaymentIntent
Server-side

A PaymentIntent represents your intent to collect payment from a customer and tracks the lifecycle of the payment process.

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.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=1099 \ -d currency=pln \ -d "payment_method_types[]"=p24

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.

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_descriptor}, where /OPT/X/////P24-XXX-XXX-XXX is a unique reference for the payment generated by Przelewy24.

Collect payment method details
Client-side

Collect payment information on the client with Stripe Elements. Elements is a set of prebuilt UI components for collecting payment details.

A Stripe Element contains an iframe that securely sends the payment information to Stripe over an HTTPS connection. The checkout page address must also start with https:// rather than http:// for your integration to work.

You can test your integration without using HTTPS. Enable it when you’re ready to accept live payments.

Set up Stripe Elements

Stripe Elements is automatically available as a feature of Stripe.js. Include the Stripe.js script on your payment page by adding it to the head of your HTML file. Always load Stripe.js directly from js.stripe.com to remain PCI compliant. Do not include the script in a bundle or host a copy of it yourself.

checkout.html
<head> <title>Checkout</title> <script src="https://js.stripe.com/basil/stripe.js"></script> </head>

Create an instance of Elements with the following JavaScript on your checkout page:

const stripe = Stripe(
'pk_test_TYooMQauvdEDq54NiTphI7jx'
); const elements = stripe.elements();

Add and configure an p24Bank Element

Elements needs a place to live in your payment form. Create empty DOM nodes (containers) with unique IDs in your payment form and then pass those IDs to Elements.

checkout.html
HTML
CSS
No results
<form id="payment-form"> <div class="form-row"> <label for="accountholder-name"> Name </label> <input id="accountholder-name" name="accountholder-name"> </div> <div class="form-row"> <label for="accountholder-email"> Email </label> <input id="accountholder-email" name="accountholder-email"> </div> <div class="form-row"> <!-- Using a label with a for attribute that matches the ID of the Element container enables the Element to automatically gain focus when the customer clicks on the label. --> <label for="p24-bank-element"> P24 Bank </label> <div id="p24-bank-element"> <!-- A Stripe Element will be inserted here. --> </div> </div> <button>Submit Payment</button> <!-- Used to display form errors. --> <div id="error-message" role="alert"></div> </form>

When the form above has loaded, create an instance of an p24Bank Element and mount it to the Element container created above:

const options = { // Custom styling can be passed to options when creating an Element style: { base: { padding: '10px 12px', color: '#32325d', fontSize: '16px', '::placeholder': { color: '#aab7c4' }, }, }, }; // Create an instance of the p24Bank Element const p24Bank = elements.create('p24Bank', options); // Add an instance of the p24Bank Element into // the `p24-bank-element` <div> p24Bank.mount('#p24-bank-element');

Elements are completely customizable. You can style Elements to match the look and feel of your site, providing a seamless checkout experience for your customers. It’s also possible to style various input states (for example, when the Element has focus).

Submit the payment to Stripe
Client-side

Rather than sending the entire PaymentIntent object to the client, use its client secret. This is different from your API keys that authenticate Stripe API requests. The client secret should be handled carefully because it can complete the charge. Do not log it, embed it in URLs, or expose it to anyone but the customer.

Use stripe.confirmP24Payment to handle the redirect away from your page and to complete the payment. Add a return_url to this function to indicate where Stripe should redirect the user after they complete the payment on their bank’s website or mobile application.

client.js
const form = document.getElementById('payment-form'); const accountholderName = document.getElementById('accountholder-name'); const accountholderEmail = document.getElementById('accountholder-email'); form.addEventListener('submit', (event) => { event.preventDefault(); // Redirects away from the client const {error} = await stripe.confirmP24Payment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { p24: p24Bank, billing_details: { name: accountholderName.value, email: accountholderEmail.value, }, }, payment_method_options: { p24: { // To be able to pass the `tos_shown_and_accepted` parameter, you must // ensure that the P24 regulations and information obligation consent // text is clearly visible to the customer. See // stripe.com/docs/payments/p24/accept-a-payment#requirements // for directions. tos_shown_and_accepted: true, } }, return_url: 'https://example.com/checkout/complete', } ); });

When your customer submits a payment, Stripe redirects them to the return_url and includes the following URL query parameters. The return page can use them to get the status of the PaymentIntent so it can display the payment status to the customer.

When you specify the return_url, you can also append your own query parameters for use on the return page.

ParameterDescription
payment_intentThe unique identifier for the PaymentIntent.
payment_intent_client_secretThe client secret of the PaymentIntent object. For subscription integrations, this client_secret is also exposed on the Invoice object through confirmation_secret

When the customer is redirected back to your site, you can use the payment_intent_client_secret to query for the PaymentIntent and display the transaction status to your customer.

You can find details about the bank account the customer used to complete the payment on the resulting Charge under the payment_method_details property.

{ "charges": { "data": [ { "payment_method_details": { "p24": { "bank": "inteligo", "reference": "P24 123-456-789", "verified_name": "JENNY ROSEN" }, "type": "p24" }, "id": "src_16xhynE8WzK49JbAs9M21jaR", "object": "source", "amount": 1099,

Test your integration

Select any bank in the P24 bank list with your test API keys. After confirming the payment, you’re redirected to a test page with options to succeed or fail the payment. You can test the successful payment case by authenticating the payment on the redirect page. The PaymentIntent will transition from requires_action to succeeded.

To test the case where the user fails to authenticate, select any bank with your test API keys. On the redirect page, click Fail test payment. Your PaymentIntent will transition from requires_action to requires_payment_method.

OptionalHandle post-payment events
Server-side

OptionalHandle P24 Bank Element changes
Client-side

OptionalHandle P24 redirect manually
Server-side

OptionalStore the customer's bank preference
Client-side

Przelewy24 requirements

Przelewy24 requires customers to agree to their Terms of Service to successfully authorize the transaction. This means that the customer will first be redirected to a Przelewy24 page where they can accept these terms. To skip the intermediate page, you are required to present the Przelewy24 terms on your website, and collect consent on their behalf. When you have done that, you will be able to set the p24[tos_shown_and_accepted] payment method option.

RequirementDetails

Present a hyperlinked Przelewy24 Terms of Service standard wording with hyperlinks.

The following text should be clearly visible to the customer, with hyperlinks included:

  • Standard wording in Polish (hyperlinked): Oświadczam, że zapoznałem się z regulaminem i obowiązkiem informacyjnym serwisu Przelewy24.
  • Standard wording in English (hyperlinked): I declare that I have familiarized myself with the regulations and information obligation of the Przelewy24 service.

Bank values

Bank nameValue
Alior Bankalior_bank
Bank Millenniumbank_millennium
Bank Nowy BFG S.A.bank_nowy_bfg_sa
Bank Pekaobank_pekao_sa
Bank Pocztowyetransfer_pocztowy24
Banki Spółdzielczebanki_spbdzielcze
BLIKblik
BNP Paribasbnp_paribas
BOŚ (Bank Ochrony Środowiska)boz
Citi Handlowyciti_handlowy
Credit Agricolecredit_agricole
ING Bank Śląskiing
Inteligointeligo
mBankmbank_mtransfer
Nest Banknest_przelew
PKO Bank Polskipbac_z_ipko
Plus Bankplus_bank
Santander Bank Polskasantander_przelew24
Toyota Banktoyota_bank
VeloBankvelobank
Volkswagen Bankvolkswagen_bank
Was this page helpful?
YesNo
  • Need help? Contact Support.
  • Join our early access program.
  • Check out our changelog.
  • Questions? Contact Sales.
  • LLM? Read llms.txt.
  • Powered by Markdoc