payme-generator
v1.0.1
Published
A generator of payme.sk payment links
Readme
payme-generator
A generator of payme.sk payment links
let fromUrl = new PayMeLink("https://payme.sk/?V=1&IBAN=SK9181800000007000155733&AM=0.01&CC=EUR&DT=20250421&PI=%2FVS0123456789%2FSS0123456789%2FKS1234&MSG=DO+NOT+SEND+ANY+MONEY+HERE")
let fromParsedParams = new PayMeLink({
V: '1',
IBAN: 'SK9181800000007000155733',
AM: 0.01,
CC: 'EUR',
DT: '2025-04-21',
PI: '/VS0123456789/SS0123456789/KS1234',
MSG: 'DO NOT SEND ANY MONEY HERE',
CN: null
})
let empty = new PayMeLink()
console.log(empty.setIBAN('SK9181800000007000155733').setAmount(0.01).setMessage('DO NOT SEND ANY MONEY HERE').getLink())For full documentation of the format, please refer to: https://www.payme.sk/docs/PaymentLinkStandard_v1_2.pdf
[!WARNING] Really don't send any money to this bank account (
SK9181800000007000155733) This bank account is only used as a preview. Please replace with your own Bank Account
Documentation
Constructor Overloads
constructor(input: PayMeParams)- Creates a
PayMeLinkinstance from an object containing the link parameters. - Parameters:
input(PayMeParams): Object containing the payment parameters.
- Example:
const payMeLink = new PayMeLink({ V: "1", IBAN: "SK9181800000007000155733", AM: 100, CC: "EUR", });
- Creates a
constructor(input: string | URL)- Creates a
PayMeLinkinstance from a URL string orURLobject. - Parameters:
input(string | URL): URL containing the payment parameters.
- Example:
const payMeLink = new PayMeLink("https://payme.sk/?V=1&IBAN=SK9181800000007000155733&AM=100&CC=EUR");
- Creates a
constructor()- Creates a clean
PayMeLinkinstance with default values. - Example:
const payMeLink = new PayMeLink();
- Creates a clean
Methods
get params(): PayMeParams- Retrieves the current parameters of the
PayMeLinkinstance. - Returns:
- (PayMeParams): Object containing the payment parameters.
- Example:
const params = payMeLink.params;
- Retrieves the current parameters of the
setVersion(version: PayMeSupportedVersions): PayMeLink- Sets the version of the PayMe link.
- Parameters:
version(PayMeSupportedVersions): The version to set.
- Returns:
- (PayMeLink): The updated
PayMeLinkinstance.
- (PayMeLink): The updated
- Example:
payMeLink.setVersion("1");
setIBAN(iban: string): PayMeLink- Sets the IBAN (account number) for the PayMe link.
- Parameters:
iban(string): The IBAN to set.
- Returns:
- (PayMeLink): The updated
PayMeLinkinstance.
- (PayMeLink): The updated
- Example:
payMeLink.setIBAN("SK9181800000007000155733");
setAmount(amount: number): PayMeLink- Sets the amount for the PayMe link.
- Parameters:
amount(number): The amount to set (must be positive and less than 9,999,999).
- Returns:
- (PayMeLink): The updated
PayMeLinkinstance.
- (PayMeLink): The updated
- Example:
payMeLink.setAmount(100);
setCurrency(currency: CurrencyCode): PayMeLink- Sets the currency for the PayMe link.
- Parameters:
currency(CurrencyCode): The currency code to set.
- Returns:
- (PayMeLink): The updated
PayMeLinkinstance.
- (PayMeLink): The updated
- Example:
payMeLink.setCurrency("EUR");
setDueDate(dueDate: string): PayMeLink- Sets the due date for the PayMe link.
- Parameters:
dueDate(string): The due date in any native Date class supported format.
- Returns:
- (PayMeLink): The updated
PayMeLinkinstance.
- (PayMeLink): The updated
- Example:
payMeLink.setDueDate("2025-04-21");
setPaymentIdentifier(paymentIdentifier: string): PayMeLink- Sets the payment identifier for the PayMe link.
- Parameters:
paymentIdentifier(string): The payment identifier (max 35 characters).
- Returns:
- (PayMeLink): The updated
PayMeLinkinstance.
- (PayMeLink): The updated
- Example:
payMeLink.setPaymentIdentifier("/VS12345/SS67890/KS1234");
setMessage(message: string): PayMeLink- Sets the message for the PayMe link.
- Parameters:
message(string): The message for the beneficiary (max 140 characters).
- Returns:
- (PayMeLink): The updated
PayMeLinkinstance.
- (PayMeLink): The updated
- Example:
payMeLink.setMessage("Payment for invoice #123");
setCreditorName(creditorName: string): PayMeLink- Sets the creditor name for the PayMe link.
- Parameters:
creditorName(string): The creditor name (max 70 characters).
- Returns:
- (PayMeLink): The updated
PayMeLinkinstance.
- (PayMeLink): The updated
- Example:
payMeLink.setCreditorName("John Doe");
getLink(): string- Generates the PayMe link as a URL string.
- Returns:
- (string): The PayMe link URL.
- Example:
const link = payMeLink.getLink();
getPayBySquare(): string- Generates the contents of a Pay BySquare QR code.
- Returns:
- (string): The QR code contents.
- Example:
const qrCodeContent = payMeLink.getPayBySquare();
toString(): string- Converts the
PayMeLinkinstance to a URL string. - Returns:
- (string): The PayMe link URL.
- Example:
const linkString = payMeLink.toString();
- Converts the
