Accept a Multibanco payment
Learn how to accept the Multibanco payment method.
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.
Multibanco is a voucher-based payment method in Portugal. If your business is based in Europe or the United States, you can accept Multibanco payments from customers in Portugal using the Payment Intents API.
To complete a transaction, customers receive a voucher that includes Multibanco entity and reference numbers. Customers use these voucher details to make a payment outside your checkout flow through online banking or from an ATM.
Payment confirmation might be delayed by several days due to the initiation of a bank transfer when a customer pays for a Multibanco voucher. Bank transfers can encounter delays, particularly over weekends, contributing to the delay in payment confirmation.
Set up StripeServer-side
First, you need a Stripe account. Register now.
To access the Stripe API from your application, use our official libraries:
Create a PaymentIntentServer-side
Stripe uses a PaymentIntent object to represent your intent to collect payment from a customer, tracking state changes from Multibanco voucher creation to payment completion.
Create a PaymentIntent on your server with an amount and the eur
currency (Multibanco doesn’t support other currencies). If you already have an integration using the Payment Intents API, add multibanco
to the list of payment method types for your PaymentIntent.
Retrieve the client secret
The PaymentIntent includes a client secret that the client side uses to securely complete the payment process. You can use different approaches to pass the client secret to the client side.
Collect payment method detailsClient-side
Create a payment form on your client to collect the required billing details from the customer:
Field | Value |
---|---|
email | The full email address of the customer. |
<form id="payment-form"> <div class="form-row"> <label for="email"> Email </label> <input id="email" name="email" required /> </div> <!-- Used to display form errors. --> <div id="error-message" role="alert"></div> <button id="submit-button">Pay with Multibanco</button> </form>
Submit the payment to StripeClient-side
When a customer clicks to pay with Multibanco, use Stripe.js to submit the payment to Stripe. Stripe.js is our foundational JavaScript library for building payment flows.
Include the Stripe.js script on your checkout page by adding it to the head
of your HTML file.
<head> <title>Checkout</title> <script src="https://js.stripe.com/basil/stripe.js"></script> </head>
Create an instance of Stripe.js with the following JavaScript on your checkout page.
// Set your publishable key. Remember to switch to your live publishable key in production! // See your keys here: https://dashboard.stripe.com/apikeys const stripe = Stripe(
);'pk_test_TYooMQauvdEDq54NiTphI7jx'
Submit the customer’s billing details by calling by calling stripe.confirmMultibancoPayment with the client secret of the PaymentIntent object that you created.
After confirmation, Stripe automatically opens a modal to display the Multibanco voucher to your customer.
const form = document.getElementById('payment-form'); form.addEventListener('submit', async (event) => { event.preventDefault(); const result = await stripe.confirmMultibancoPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { billing_details: { email: document.getElementById('email').value, }, }, }); // Stripe.js will open a modal to display the Multibanco voucher to your customer // This async function finishes when the customer closes the modal if (result.error) { // Display error to your customer const errorMsg = document.getElementById('error-message'); errorMsg.innerText = result.error.message; } });
Note
stripe.
might take several seconds to complete. During that time, disable your form from being resubmitted and show a waiting indicator, such as a spinner. If you receive an error, display it to the customer, re-enable the form, and hide the waiting indicator.
When a Multibanco voucher is created successfully, the value of the returned PaymentIntent’s status
property is requires_
. Check the status of a PaymentIntent in the Dashboard or by inspecting the status property on the object. If the Multibanco voucher wasn’t created successfully, inspect the returned error
to determine the cause (for example, an invalid email format).
Stripe sends a payment_intent.requires_action event when a Multibanco voucher is created successfully. If you need to send an email with the voucher’s payment instructions link, you can locate the hosted_
at payment_intent.next_action.multibanco_display_details.hosted_voucher_url.
Handle post-payment eventsServer-side
Multibanco is a delayed notification payment method. A customer pays for a Multibanco voucher outside your checkout flow through online banking or from an ATM.
After a Multibanco payment completes, Stripe sends a payment_intent.succeeded event. Use the Dashboard or build a webhook handler to receive these events and run actions, such as sending an order confirmation email to your customer, logging the sale in a database, or initiating a shipping workflow.
Learn about Multibanco expiry.
Event | Description | Next steps |
---|---|---|
payment_ | The Multibanco voucher is created successfully. | Wait for the customer to pay for the Multibanco voucher. |
payment_ | The customer can no longer pay for the Multibanco voucher. | Wait for the initiated payment to succeed or fail. |
payment_ | The customer paid for the Multibanco voucher. | Fulfil the goods or services that the customer purchased. |
payment_ | The customer did not pay for the Multibanco voucher. | Contact the customer through email or push notification and request another payment method. |
Receive events and run business actions
Manually
Use the Stripe Dashboard to view all your Stripe payments, send email receipts, handle payouts, or retry failed payments.
View your test payments in the Dashboard.
Custom Code
Build a webhook handler to listen for events and build custom asynchronous payment flows. Test and debug your webhook integration locally with the Stripe CLI.
Learn how to build a custom webhook.
Test the integration
In a sandbox, set payment_
to the following values when you call stripe.confirmMultibancoPayment to test different scenarios.
Description | |
---|---|
| Simulates a Multibanco voucher that a customer pays. The Example: jenny@example.com |
| Simulates a Multibanco voucher that a customer pays immediately. The Example: succeed_immediately@example.com |
| Simulates a Multibanco voucher that expires immediately. The Example: expire_immediately@example.com |
| Simulates a Multibanco voucher that expires before a customer pays. The Example: expire_with_delay@example.com |
| Simulates a Multibanco voucher that never succeeds. The Example: fill_never@example.com |
Expiry
Multibanco vouchers expire at the expires_
UNIX timestamp in next_action.multibanco_display_details.expires_at, which is 7 days after you create the voucher. Customers can’t pay a Multibanco voucher after it expires. After expiry, the PaymentIntent’s status transitions from requires_
to processing
, and Stripe sends a payment_intent.processing event.
The PaymentIntent remains in the processing
status for a maximum buffer period of 4 days to allow for potential completed payment notification delays caused by bank-transfer delays. If the Multibanco payment doesn’t complete within the buffer period, the PaymentIntent’s status transitions to requires_
and Stripe sends a payment_intent.payment_failed event. If you receive the customer’s funds after the buffer period, Stripe automatically initiates a refund process for the mispaid amount.
Cancellation
You can cancel Multibanco vouchers using Cancel a PaymentIntent. After cancelation, Stripe sends a payment_intent.canceled event.
If a customer’s funds are received for a cancelled Multibanco voucher, Stripe automatically initiates a refund process for the mispaid amount.
Note
Cancelling a pending payment invalidates the original voucher instructions. When you cancel a pending Multibanco payment, inform your customer.
When you successfully reconfirm a PaymentIntent in status requires_
, Stripe creates new voucher instructions and a new hosted_
. You must provide them to your customer.
Refunds
Learn about Multibanco refunds.