Prood
PackagesPayment Providers

@prood/payment-easypay

Easypay payment provider for Portugal — Multibanco, MB WAY, and credit card.

@prood/payment-easypay implements the PaymentProvider interface for Easypay — a Portuguese payment gateway supporting Multibanco references, MB WAY, and credit card.

Installation

pnpm add @prood/payment-easypay

Usage

import { EasypayPaymentProvider } from '@prood/payment-easypay'

const provider = new EasypayPaymentProvider({
  accountId: process.env.EASYPAY_ACCOUNT_ID!,
  apiKey: process.env.EASYPAY_API_KEY!,
  baseUrl: process.env.EASYPAY_BASE_URL ?? 'https://api.prod.easypay.pt',
})

Configuration

FieldEnv varDescription
accountIdEASYPAY_ACCOUNT_IDEasypay account ID
apiKeyEASYPAY_API_KEYAPI key
baseUrlEASYPAY_BASE_URLAPI base URL

Environments

EnvironmentBase URL
Productionhttps://api.prod.easypay.pt
Sandboxhttps://api.test.easypay.pt

Payment methods

MethodFlowUI
MultibancoReference-basedEntity + reference displayed; customer pays at ATM/homebanking
MB WAYPush notificationPhone number input; customer confirms on phone
Credit cardRedirectRedirect to Easypay hosted payment page

Selecting a method

Pass metadata.method on createSession() (defaults to mb):

metadata.methodFlow
mbMultibanco reference (entity + reference)
mbwMB WAY push notification
ccRedirect to Easypay hosted card page
const session = await provider.createSession({
  amount: 29.99,
  currency: 'EUR',
  orderId: 'ord_456',
  metadata: { method: 'mb' },
})

Easypay confirms payments asynchronously via notifications. Use confirmSession() after redirect, but treat webhooks as the authoritative completion signal for reference payments.

Factory usage

import { getPaymentProvider } from '@prood/commerce'

const provider = await getPaymentProvider('easypay', orgId)

Payment flow

Drag to pan · Scroll to zoom

Webhook setup

Configure in Easypay merchant panel:

URL: https://checkout.example.com/api/webhooks/easypay/{orgId}

On this page