What are advised actions and advice codes?
When you create a payment via Primer, the request is sent to your chosen processor based on your payment workflows. If the payment is not successful, some processors surface the advice code from the underlying payment method or card networks (e.g. Mastercard’s Merchant Advice Code), enabling you to identify the best course of action for this transaction. Where possible, Primer exposes this underlying advice code, and maps it to a unified advice action so that you can reason about them in a single way across all your payments.Why are advised actions important?
The advised actions and underlying advice codes can be used to determine:- Whether the payment can be safely retried
Some card networks such as Visa/Mastercard charges additional fees whenever the retry limit is exceeded - The best course of action to maximize the chances of recovery
e.g. Retry now, retry later, or use another payment method
Primer’s unified advised action
Whenever possible, Primer exposes the unified advised action through this field:
Here are all the valid values for the unified advised action:
These fields are returned in the output of the Payments App in Workflows, as well as the API response and the payment status webhook. For example:
JSON
Payment method advice code
Where possible, Primer also exposes the advice code and message from the payment method or card network. These are unified across all processors to facilitate analysis on all your payments.
These fields are returned in the output of the Payments App in Workflows, as well as the API response and the payment status webhook. For example:
JSON
Supported card networks and processors
The unified advised action and raw advice code are available for the following card networks:- Mastercard - using the Merchant Advice Code (MAC)
- Visa - using the Visa decline category code
- Stripe
- Braintree
- Adyen
Please reach out to us directly via our Service Desk if you need support for additional card networks, payment methods, or processors.
Card network advice codes
Mastercard Merchant Advice Code (MAC)
Merchant Advice Codes (MACs) were introduced by Mastercard to recommend the best course of action to take for each declined payment. Here is the list of MACs, with how they map to Primer’s advised action:Visa decline category codes
Unlike Mastercard and their MAC, Visa does not expose a dedicated advice code. Instead, Visa categorizes their decline code into four categories, each with their overarching advice. Primer exposes the category code ("1" to "4") as the advice code.