Ping Payments Links: Flow

The Ping Payments™ Links flow assumes that your backend has access to the Ping Payments Links API and the Ping Payments API. This flow requires the customer to enter their details and details through the Ping Payments Checkout Form.

Ping Payments Links also allows you to create invoices, rather than payment links. Invoices are delivered to you as .pdfs. You can choose to either print out these .pdfs and have them delivered by mail.







Using the Payment Links Flow

This describes a typical happy path case.

In this scenario, we are the providers of frontend and backend services, and it's our business to help OUR customers make sales to THEIR customers. We're using Ping Payments Links as a service for handling payments.

We also represent a Tenant in the Ping Payments ecosystem.

Note that we'll be working with both the Ping Payments API and the Ping Payment Links API.



Making a Purchase

We start off just as a prospective customer, or the payer, visits the market stall of one of your clients, or the payee, at a local fair.

📘

Purchase

  1. Payer selects a product and initiates a purchase
  2. Payee enters purchase into our user interface on their mobile device
  3. Our user interface posts a new purchase to our frontend



Preparing the Payment Link

We've done a good job designing out frontend, so it doesn't include any more logic than it has to. All it has to do is to hand over responsibility for the purchase to our backend,

📘

Frontend

Receives the purchase and passes it on as a request to our backend



Now, our backend starts preparing for the payment.

📘

Backend

  1. Receives the purchase request from our frontend and saves the information
  2. Creates a new payment order
  3. Posts the new payment order to the Ping Payments API

Notes:

  • The header of the request to the Ping Payments API contains your tenant_id
  • The body of the request includes a currency.

Create a payment order with the Payment Order endpoint of the Ping Payments API.



The payment order reaches the Ping Payments API.

📘

Ping Payments API

  1. Receives the request from our backend
  2. Saves the payment order
  3. Sends a response to back to our backend

Note:

  • A successful response from the Ping Payments API contains the payment_order_id of the new payment order.

🚧

Ping Payments recommends that you persist payment order IDs in your backend




It's time for our backend to create the Payment Link.

📘

Backend

  1. Receives the response from the Ping Payments API and saves the payment_order_id
  2. Creates a new payment_link object
  3. Posts the new payment_link object to the Ping Payment Links API

Notes:

  • Always include the payment order ID of the Payment Order
  • Make sure to include one or more payment methods in the payment link object, in the payment_provider_methods list

Create a payment_link with the Payment Link endpoint.


🚧

Ping Payments recommends that you Include a valid status_callback_url in the payment link object



Creating the Payment Link

We've handed over the payment link object to the Ping Payment Links API. It's time to process our payment link object.

📘

Ping Payment Links API

  1. Receives the request
  2. Saves the payment_link, connecting it to the payment order matching the payment order ID
  3. Creates a payment
  4. Connects the payment to the payment order and payment link
  5. Sends a response to back to our backend

Note:

  • The response contains a payment link ID and a URL for the payment link


Now, our payment link object has become an actual http link, or URL.

📘

Backend

  1. Receives the response from the Ping Payment Links API and saves the payment link ID and the payment link URL
  2. Initiate distribution of payment link


Distributing Payment Link

At this point, we have three options for the distribution of payment links:

  • Send the payment link to the end customer ourselves, by a method of our own choice
  • Use the invoice endpoint of the Ping Payment Links API to request a .pdf file with an invoice, and send that file to the customer
  • We can use the distribution endpoint of the Ping Payment Links API to send out the payment link through SMS, email or both.

How the payment link reaches the payer is up to our backend.

📘

Backend

Distributes payment link using one of the available options



The payer is about to receive the payment link.

📘

Payer

  1. Recieves payment link
  2. Clicks the payment link and is redirected to the Ping Payments Checkout form
  3. Reviews pre-filled information

    If any information is incorrect
    ● Payer corrects values

  4. Payer chooses payment method and enters any required payment information, such as a credit card number
  5. Payer clicks pay


Finishing Payment

From here on out, the process can very greatly. Perhaps the payer has choosen to pay through Swish, for which Ping Payments provides more documentation here. Perhaps the payment is deposited in a Ping Payments Deposit account. There are many options, and those options are beyond the scope of this Ping Payment Links document.


The payment went well, and the payer receives confirmation of a successful purchase.

📘

Payer

Once the PAYMENT has been fulfilled the payer receives a receipt, and the purchase is completed.