Skip to main content

Payment Links

This guide explains two different options how to implement Payment Link in your invoice, email or any other place where you encourage your customers to pay for your goods or services.

Most common example here is PDF invoice and payment link inside it, which buyer could press and make a payment.

High level steps:

  1. Inside the invoice as a payment link you add link from your system which identifies specific invoice. For example: https://yoursystem.com/invoice-123
  2. After customer opens this link, your system checks if this invoice is paid or not:
    • a. If not paid, then your system creates a transaction using POST Create Transaction endpoint and redirects customer to URL provided in API response (example below). There your customer will be able to select preferred payment method and make the payment.
    "other": [
    {
    "name": "redirect",
    "url": "https://payment.maksekeskus.ee/pay.html?trx=fb907584-f352-4b5d-8b5f-e41b7e15d25d"
    },
    ]
    • b. If invoice is already paid - your system displays a message to the customer, that invoice is already paid and does not create transaction in our system.
  3. Your system receives transaction status notification as explained in Regular Payment Flow guide in Step 3: Transaction Status Handling and performs needed logic like marking invoice as paid and sending an order confirmation email to your customer.

After redirect to MakeCommerce system, buyer will see such view:

Payment Gateway

info

Above only high-level logic of use case is explained. To learn more, please read the guide on Regular Payment Flow when the customer is redirected to the MakeCommerce payment method selection page.

Keep in mind that transactions in the MakeCommerce system expire in 30 minutes after the last change of the transaction status. If customer has opened the link(according to step 2.a.) and not paid then the next time the link is pressed your system should create a new transaction.

warning

If you are Accounting/Invoicing SaaS platform and you would like to offer mentioned functionality for your users, then you should implement the solution in a way, that your users would be able to enter their MakeCommerce API credentials and your platform would make requests on behalf of them.

MakeCommerce has the functionality to provide a static link which creates a new transaction every time the link is opened.

Example of the link: https://payment.maksekeskus.ee/pay/1/link.html?shopId=1ca58c6f-89c2-442f-950acd5fa3484397&amount=100&paymentId=abc123&locale=en&country=ee

URL GET parameters explanation:

  • shopId - shop identifier that MakeCommerce merchant receives after registration
  • amount - amount of transaction
  • paymentId - payment ID from your system
  • locale - payment selection window language, that customer can change
  • country - preselected payment methods according to country, that customer can change

You either could create the link yourself using information above or in MakeCommerce self-service Merchant Portal payment link generator:

Payment Link generator

Buyer view after redirect to MakeCommerce system:

Payment Gateway

warning

This approach has following limitations:

  • A transaction is created every time the URL is opened. Even if buyer pays but opens the same link again a new transaction will be created.
  • Since parameters are visible in URL the buyer could change the amount for example. Merchant should always check if received amount is the same as expected.

Option 2 is suitable when not many transactions are expected and validation of payment amount will mostly be done in MakeCommerce Merchant Portal. When more transactions are expected then option 1 is recommended.