Customizing the Secure Smart Link

Smart Link URLs that use Smart Tokens require SSL-encrypted connections. Smart Tokens contain encoded information from the order, such as consumer name, address, mobile number, email, DOB, and language preferences (if provided). Smart Tokens can be configured to move consumers directly into specific payment flows and to expire after a specified number of seconds. Merchants can also encode the Smart Token with customized redirect URLs for scenarios like successful payments, abandoned payments, expired Smart Links, errors, etc.

The encrypted Smart Link URL (i.e., secure_smart_link) returned in the /create_order, /find_orders, and /get_smart_token API responses contains all the consumer data passed in with the order and will display all payment types configured for the merchant site. To enforce specific flows or define specific redirect URLs, use the /get_smart_token call to customize the behavior of the Smart Link. Use the following parameters to update and configure the Smart Token.

NameDescriptionTypeRequired?
flow_debitIndicates whether to include a debit card payment flow in the UI.boolO
flow_creditIndicates whether to include a credit card payment flow in the UI.boolO
flow_achIndicates whether to include the bank account payment flow in the UI.boolO
flow_retailerIndicates whether to include the cash payment flow in the UI.boolO
flow_apple_payIndicates whether to include the Apple Pay payment flow in the UI.boolO
flow_google_payIndicates whether to include the Google Pay payment flow in the UI.boolO
flow_paypalIndicates whether to include the PayPal payment flow in the UI.boolO
flow_venmoIndicates whether to include the Venmo payment flow in the UI.boolO
flow_pin4Indicates whether to include the Pin4 disbursement flow in the UI.boolO
flow_cash_appIndicates whether to include the Cash App payment flow in the UIboolO
flow_push_debitIndicates whether to include the debit disbursement flow in the UI.boolO
flow_push_achIndicates whether to include the bank account disbursement flow in the UI.boolO
flow_push_paypalIndicates whether to include the PayPal disbursement flow in the UI.boolO
flow_secure_allIndicates whether to display all payment types available for your Merchant site.boolO
flow_edit_scheduleGives the consumer the ability to cancel the Autopay schedule associated with the order.boolO
flow_tokenizeIndicates whether to include the payment method tokenization flow in the UI.boolO
flow_hide_saved_payment_methodsWhen set to true, this setting hides existing, previously tokenized payment methods for all actions (i.e., pay, withdrawal, tokenize, and auto_pay). When set to false, this setting shows all previously tokenized payment methods for all actions. When unset or nil, the Embedded Client will hide saved payment methods for the tokenize action and show saved payment methods for the pay and withdrawal actions.boolO
link_lifetime_secondsDefines the number of seconds the Smart Link (i.e., secure_smart_link) will be active and accessible before expiring. In the event of expiration, the merchant will need to regenerate the smart token by making another /get_smart_token call.numO
short_order_urlIf set to true, PayNearMe returns a shortened Order Tracking URL in the response.stringO
flow_pay_urlThe URL that displays after a successful payment is made.stringO
flow_no_pay_urlThe URL that displays when no payment is made.stringO
flow_add_urlThe URL that displays after a payment method has been captured, tokenized, and successfully added to a consumer’s account.stringO
flow_no_add_urlThe URL that displays when a payment type is not captured and tokenized.stringO
flow_return_urlThe URL that displays when the payment or tokenization flow completes.stringO
flow_expired_urlThe URL that displays when the consumer attempts to access an expired Smart Link URL.stringO
flow_error_urlThe URL that displays when an error occurs in the payment or tokenization flow.stringO
flow_venmo_return_urlThe URL that displays after completing a Venmo payment.stringO
flow_show_all_ppasIndicates whether to show all payment methods created for the order, regardless of which browser the consumer used to tokenize the payment methods (i.e., removes cookie restrictions enforced by the different browsers).boolO
flow_trustlyIndicates whether to include a Guaranteed ACH method via Trustly.boolO
ext_customer_enrollment_dateRecords the date of the consumer's first transaction with the client in YYYY-MM-DD format. This field is required for Guaranteed ACH payments.stringO
ext_customer_date_of_birth_piiRecords the consumer's birth date in YYYY-MM-DD format. NOTE: Parameters suffixed with _pii contain personal identifying information (PII). PayNearMe encrypts parameter values containing PII before storing and only returns specific and/or redacted information in the response. This field is required for Guaranteed ACH payments.stringO
ext_customer_tax_id_piiRecords the consumer’s Social Security Number or other Tax ID. NOTE: Parameters suffixed with _pii contain personal identifying information (PII). PayNearMe encrypts parameter values containing PII before storing and only returns specific and/or redacted information in the response. This field is required for Guaranteed ACH payments.stringO
flow_bank_oauth_redirect_urlIndicates the URL where consumers should be redirected to when logging into native bank applications that use OAuth login authorization flows. Rather than having to remember and type in a password in a new browser window, OAuth logins enable consumers to log in via the banking app on their phone using saved passwords or biometric authentication (like FaceID or fingerprints). For the Embedded Client, this link should redirect players back to the “Complete Your Payment Details” screen.stringO
flow_trustly_reconnectIdentifies the payment method the client wants to reauthorize for a Guaranteed ACH payments. This parameter should only be included when a bank revokes a previously authorized payment method. See Handling an Expired Bank Authorization for more information.stringO

Configuring for One Payment Type

To drop a consumer into a specific payment flow, perform the /get_smart_token call and specify the flow in the request. This call will respond with a regenerated Smart Token that is encrypted with both the order information and the specified payment flow.

curl -X POST https:// www.paynearme-sandbox.com/json-api/get_smart_token -L\
  -d flow_ach=true \
  -d flow_pay_url=www.successpayurl.com \ 
  -d site_customer_identifier=987654321 \
  -d site_identifier=S2155373459 \
  -d timestamp=1631051815 \
  -d version=2.0 \
  -d signature=2d4a97a97d06ec3bb4a72ab52ff45bd9
{
  "status": "ok",
  "orders": [
    {
      "pnm_order_identifier": "85089038072",
      "site_order_identifier": "5579365601",
      "secure_smart_token": "SA0tAlfH7jy3g2H4g04lT!Qk61bpU8eOyk6uNfDoKgtVZTJSuICycRWXjqtFjjOi!2EldKvsVjiCWlyMCyg4EuNy5B0aQW3wNwrASmVlNWc=",
      "secure_smart_link": "https://www.paynearme-sandbox.com/ssl/SA0tAlfH7jy3g2H4g04lT!Qk61bpU8eOyk6uNfDoKgtVZTJSuICycRWXjqtFjjOi!2EldKvsVjiCWlyMCyg4EuNy5B0aQW3wNwrASmVlNWc=",
      "order_tracking_url": "https://www.paynearme-sandbox.com/85089038072/ch?pay_url=www.successpayurl.com"
    }
  ]
}

Notice that both the secure_smart_link and the order_tracking_url values are returned with this call. Both URLs will display the same UI; however, the Smart Link URL (i.e., secure_smart_link value) encrypts the order information, payment flows, and return URLs within the Smart Token, preloads all relevant consumer data (e.g., name, address, saved payment types, etc.) into the payment form, and—if configured—will expire after a specified number of seconds. The order_tracking_url displays specified payment flow codes and the return URLs in cleartext within the Smart Link URL.

The Smart Link URL returned in the call above was configured to only accept payments via bank accounts. For new payment types, when the consumer clicks the link, PayNearMe will display a screen like the following.

If the consumer has a saved bank account, PayNearMe displays the following screen after the Smart Link is clicked.

Configuring for Multiple Payment Types

Rather than offer consumers all payment types at once, you can encode the Smart Link to only display your preferred payment types. Use this feature for promotional events or as a method of risk mitigation for specific customers who may have too many returns or chargebacks associated with certain payment types. Like the call for the single payment type configuration, this call regenerates the Smart Token to encrypt additional parameters.

curl -X POST https://www.paynearme-sandbox.com/json-api/get_smart_token -L \
  -d flow_google_pay=true \
  -d flow_debit=true \
  -d flow_credit=true \
  -d flow_ach=true \
  -d flow_retailer=true \
  -d flow_pay_url=www.successpayurl.com \ 
  -d pnm_order_identifier=987654321 \
  -d site_identifier=S2155373459 \
  -d timestamp=1631133464 \
  -d version=3.0 \
  -d signature=1d526cce620a78b64da951f110cb011a
{
  "status": "ok",
  "orders": [
    {
      "pnm_order_identifier": "87221295581",
      "secure_smart_token": "edlGTjhOj8jKxNYVpugNJ!Dt7hfImBiL4LyQcaIDR0k9akbJ5FyQPNwf0cQRZhDT$Ho83W4UQC0qyPnPzyh40gQjlm7GGzk41VF7NgyRHcLSR2q2fg2fBg==",
      "secure_smart_link": "https://www.paynearme-sandbox.com/ssl/edlGTjhOj8jKxNYVpugNJ!Dt7hfImBiL4LyQcaIDR0k9akbJ5FyQPNwf0cQRZhDT$Ho83W4UQC0qyPnPzyh40gQjlm7GGzk41VF7NgyRHcLSR2q2fg2fBg==",
      "order_tracking_url": "https://www.paynearme-sandbox.com/87221295581/regp?pay_url=www.successpayurl.com"
    }
  ]
}

When a consumer clicks the encrypted Smart Link generated above (i.e., the value in the secure_smart_link parameter), the following screen displays.