Affinipay

Affinipay is a direct merchant payment processor connection

Supported Features

  • Credit Card Transactions

Adding Merchant Credentials

To establish an API connection with Affinipay for a merchant who already has a relationship with them, you will need to provide the following credentials:

  • Affinipay Account ID
  • Affinipay API Secret Key

Please note that the Affinipay account ID will determine if the account can perform transactions in US or Canadian currency.

You may upload this via the Preczn Dashboard, merchant import or by updating the merchant connection via Update Connection Details endpoint. The values needed in the request would map as follows:

PATCH /v1/merchants/{merchantId}/connections/AffiniPay 

{
    "mid":"{affinipay_account_id}",
    "secret":"{affinipay_secret_key}"
}

Affinipay Custom Fields

Affinipay supports the concept of Custom Fields in their data object. Custom Fields will display on the Affinipay Payment Receipts.

Preczn maps the following transaction fields to the Affinipay Custom Fields. When data is included in the Preczn transaction request for these fields, it will be displayed on the Affinipay Payment Receipt:

Preczn Transaction FieldAffinipay Custom Field
invoiceInvoice
descriptionNotes

Additionally, keys and values that are included in Preczn Metadata object will also be included in the Affinipay Custom Fields and render on the invoice.

As an example:

Preczn MetaData Key / ValueAffinipay Custom Field Key /Value
"ContactID": "XYZ123""ContactID": "XYZ123"

Implementation Configuration and Best Practices

Every connection has nuisance and may require configuration directly with connection in order to ensure transactions follow smoothly.

Affinipay Account Configuration

To ensure recurring transactions can proceed smoothly, configure your Affinipay merchant account settings as follows:

  • Make sure the "required_payment_fields" do not include CVV, so it's not required for each transaction. This will ensure that recurring transactions that do not have CVV will process smoothly.
  • Set the "cvv_policy" to Optional to enable CVV validation when it is available, such as for primary transactions.

Additionally, please note that for assistance in making these recommended changes to your account settings, it's advisable to contact Affinipay support or reach out to your Affinipay representative.


FAQ

Can one AffiniPay connection process both USD and CAD?

No. The AffiniPay Account ID you supply determines whether the account transacts in US or Canadian currency. To process in a different currency, connect the merchant using the AffiniPay Account ID provisioned for that currency.

Why are recurring transactions failing when no CVV is sent?

AffiniPay account settings, not Preczn, enforce CVV. If required_payment_fields includes CVV, every charge must carry a CVV — and stored-credential/recurring transactions don't have one. Remove CVV from required_payment_fields and set cvv_policy to Optional, so CVV is still validated on transactions that include it. See Affinipay Account Configuration. AffiniPay support or your AffiniPay representative makes these changes.

How do I update a merchant's AffiniPay credentials after the connection exists?

Send the new Account ID and API Secret Key to the Update Connection Details endpoint as mid and secret, or update the connection from the Preczn Dashboard. See Adding Merchant Credentials.

Will my transaction metadata show up on the AffiniPay receipt?

Yes. Every key/value in the Preczn metadata object is passed through as an AffiniPay Custom Field and renders on the payment receipt. Preczn also maps invoice to Invoice and description to Notes. See Affinipay Custom Fields.

A transaction failed with "A payment token is required for this operation" — what does that mean?

That message comes from AffiniPay, not Preczn. Their response carries the code payment_token_required:

{
  "messages": [
    {
      "code": "payment_token_required",
      "level": "error",
      "message": "A payment token is required for this operation",
      "facility": "gateway"
    }
  ],
  "message": "A payment token is required for this operation",
  "code": "payment_token_required"
}

Preczn presents it in the transaction response as:

{
  "authorization": {
    "errors": ["A payment token is required for this operation"],
    "status": "E"
  }
}

A Preczn payment token (tkn_...) in your request is not the token this error refers to. Preczn submits card data directly to AffiniPay's Charges API, so you will see this error whether your request carried a tkn_ or raw card details — the payload is not the problem.

Check these in order:

  1. The API Secret Key on the connection is stale or belongs to a different AffiniPay application. This is the most common cause. A merchant with more than one AffiniPay app can end up with a secret key that no longer authorizes the Account ID in use. Re-pull both the Account ID and the API Secret Key from AffiniPay and update the connection — see Adding Merchant Credentials.
  2. The AffiniPay account may not be permitted to submit card data to the Charges API. If the credentials are confirmed current, ask AffiniPay whether the account is provisioned to accept card data on the API rather than through hosted fields only.
AffiniPay rejected my transaction and no processor transaction ID came back — what do I give their support team?

When AffiniPay rejects a charge, no transaction is created on their side, so there is no processor transaction ID to reference. Their rejection does carry a request-id that uniquely identifies the call, and Preczn records it with the processor response.

Contact Preczn support with your Preczn transaction ID (txn_...) and we will supply the AffiniPay request-id to pass along to them.


Did this page help you?