Payment Initiation (PAIN)
SWIFT Credit
SWIFT Credit
SWIFTCreditPaymentInitiation
If want to learn more about SWIFT, please refer to the Official SWIFT website.
The SWIFTCreditPaymentInitiation
class is used to generate SWIFT Credit Payment v3 Initiation messages (pain.001.001.03). These are primarily used to send cross-border payments.
It can either be created from a base ISO20022 class or created competely independantly via the SWIFTCreditPaymentInitiationConfig
interface.
Constructor
Initializes a new SWIFTCreditPaymentInitiation
instance with the provided configuration.
Methods
serialize(): string
Serializes the payment initiation to an XML string.
This method generates the complete XML representation of the SWIFT Credit Payment Initiation message.
toString(): string
Alias for serialize()
.
Validation
The class includes built-in validation to ensure the payment initiation data meets the required standards:
- Validates that the
messageId
does not exceed 35 characters. - Ensures all creditors have complete addresses (including country).
- Additional validations can be added as needed.