Notifications

Nordhealth Pay will send different types of notifications via Subhub to all subscribers for specific tenants.

All payment requests (POS / Online / Token / Refund) will trigger transaction events (pending, approved, failed). These notifications will not be sent for Payment Gateway’s internal transactions, such as fee deductions and terminal device expenses.

In the examples place close attention to meta e.g. ‘merchant_meta’ fields. This is the same data which is provided while doing the API requests e.g. for creating payment links. You can use this data to match events to specific transactions in your product.

transaction.approved

Indicates a successful

  • payment

  • reversal of a payment (e.g. refund, cancellation, chargeback)

  • OR reversal of a reversal (e.g. refund failure)

Payments are typically considered successful when they are authorised by the acquirer.

The transaction may still “fail” or be reversed later, but in that case a new transaction.approved will be sent with a new transaction id and original_transaction.id referencing the original transaction. The amount will be negated on the reversal notification. Even if e.g. capturing the payment later fails, transaction.failed is never sent for a transaction id that already received a transaction.approved.

{
  "header": {
    "publisher": "https://pay.etrust.health",
    "event": "transaction.approved",
    "event_id": "e6bd4c44-f504-4bb3-bf81-07fcee99b185",
    "timestamp": "2024-04-01T11:07:44.592838+00:00",
    "tenant_ern": "ern:dummypms/tenants/ab1221a3-6175-47ed-8d62-bb30cce056cc"
  },
  "body": {
    "transaction_id": "164f5203-568a-4e35-90bc-5a9659779a80",
    "category": "reversal",
    "merchant_reference": "0cfcf0cc-afb1-45f2-be0c-047f7ed98d68",
    "psp": "adyen_bp",
    "psp_timestamp": "2024-04-01T13:06:46+02:00",
    "payment_request_timestamp": "2024-04-01T11:06:43.874065+00:00",
    "psp_reference": "HJ43LKZ53RD6R5V5",
    "merchant_meta": {
      "invoice_id": "1431"
    },
    "shopper_ern": null,
    "amount": "-1500",
    "extra_costs": "0.0000",
    "instrument_type": "Card",
    "instrument_brand": "maestro",
    "receipts": {
      "cashier": {
        "text": "\n\n                  KASSA KOPIO                   \n\nP\u00e4iv\u00e4m\u00e4\u00e4r\u00e4                              1.4.2024\nAika                                    11:06:44\n\nKortti                          ************0008\nKorttityyppi                             maestro\n\nViite       0cfcf0cc-afb1-45f2-be0c-047f7ed98d68\nMaksupalvelutarjoajan viite     HJ43LKZ53RD6R5V5\n\nTyyppi                          TAVARAT_PALVELUT\nYHTEENS\u00c4                              \u20ac -1500,00\n\n\n\n\n              *PERUUTUS PYYDETTY*               \n"
      },
      "customer": {
        "text": "\n\n              KORTINHALTIJAN KOPIO              \n\nP\u00e4iv\u00e4m\u00e4\u00e4r\u00e4                              1.4.2024\nAika                                    11:06:44\n\nKortti                          ************0008\nKorttityyppi                             maestro\n\nViite       0cfcf0cc-afb1-45f2-be0c-047f7ed98d68\nMaksupalvelutarjoajan viite     HJ43LKZ53RD6R5V5\n\nTyyppi                          TAVARAT_PALVELUT\nYHTEENS\u00c4                              \u20ac -1500,00\n\n\n\n\n              *PERUUTUS PYYDETTY*               \n"
      }
    },
    "tokenization": {
      "result": "not-requested"
    },
    "reversal_type": "Refund",
    "reversal_reason": null,
    "merchant_reason": "test refund maestro",
    "original_transaction": {
      "transaction_id": "be44853a-d5ef-4ca2-97f4-46e02813405f",
      "category": "payment",
      "merchant_reference": "a5b6f51f-5b9c-4496-9541-64797129f02b",
      "psp": "adyen_bp",
      "psp_timestamp": "2024-03-28T15:42:31+00:00",
      "payment_request_timestamp": "2024-03-28T15:42:32.605552+00:00",
      "psp_reference": "M3CKTXK23RD6R5V5",
      "merchant_meta": {
        "invoice_id": "1431"
      },
      "shopper_ern": "ern:dummypms/tenants/ab1221a3-6175-47ed-8d62-bb30cce056cc/customers/258",
      "amount": "1500.0000",
      "extra_costs": "0.0000",
      "payment_link_id": "bd724b8e-faf2-4a64-8ac4-2ee14ddce2c1",
      "instrument_type": "Card",
      "instrument_brand": "maestro"
    },
    "reversed_transaction": null
  }
}

transaction.pending

Sent for some transaction types, when transaction result is not immediately known. Indicates the payment/reversal request has been registered, and that either a transaction.approved or transaction.failed will arrive later.

{
  "header": {
    "publisher": "https://pay.etrust.health",
    "event": "transaction.pending",
    "event_id": "4dd48f8d-f786-40f2-b8d3-fd6f4171ad5e",
    "timestamp": "2024-04-01T11:06:44.648584+00:00",
    "tenant_ern": "ern:dummypms/tenants/ab1221a3-6175-47ed-8d62-bb30cce056cc"
  },
  "body": {
    "transaction_id": "164f5203-568a-4e35-90bc-5a9659779a80",
    "category": "reversal",
    "merchant_reference": "0cfcf0cc-afb1-45f2-be0c-047f7ed98d68",
    "psp": "adyen_bp",
    "psp_timestamp": null,
    "payment_request_timestamp": "2024-04-01T11:06:43.874065+00:00",
    "psp_reference": "HJ43LKZ53RD6R5V5",
    "merchant_meta": {
      "invoice_id": "1431"
    },
    "shopper_ern": null,
    "amount": "-1500.00",
    "extra_costs": "0",
    "instrument_type": "Card",
    "instrument_brand": "maestro",
    "receipts": {
      "cashier": {
        "text": "\n\n                  KASSA KOPIO                   \n\nP\u00e4iv\u00e4m\u00e4\u00e4r\u00e4                              1.4.2024\nAika                                    11:06:44\n\nKortti                          ************0008\nKorttityyppi                             maestro\n\nViite       0cfcf0cc-afb1-45f2-be0c-047f7ed98d68\nMaksupalvelutarjoajan viite     HJ43LKZ53RD6R5V5\n\nTyyppi                          TAVARAT_PALVELUT\nYHTEENS\u00c4                              \u20ac -1500,00\n\n\n\n\n              *PERUUTUS PYYDETTY*               \n"
      },
      "customer": {
        "text": "\n\n              KORTINHALTIJAN KOPIO              \n\nP\u00e4iv\u00e4m\u00e4\u00e4r\u00e4                              1.4.2024\nAika                                    11:06:44\n\nKortti                          ************0008\nKorttityyppi                             maestro\n\nViite       0cfcf0cc-afb1-45f2-be0c-047f7ed98d68\nMaksupalvelutarjoajan viite     HJ43LKZ53RD6R5V5\n\nTyyppi                          TAVARAT_PALVELUT\nYHTEENS\u00c4                              \u20ac -1500,00\n\n\n\n\n              *PERUUTUS PYYDETTY*               \n"
      }
    },
    "tokenization": {
      "result": "not-requested"
    },
    "reversal_type": "Refund",
    "reversal_reason": null,
    "merchant_reason": "test refund maestro",
    "original_transaction": {
      "transaction_id": "be44853a-d5ef-4ca2-97f4-46e02813405f",
      "category": "payment",
      "merchant_reference": "a5b6f51f-5b9c-4496-9541-64797129f02b",
      "psp": "adyen_bp",
      "psp_timestamp": "2024-03-28T15:42:31+00:00",
      "payment_request_timestamp": "2024-03-28T15:42:32.605552+00:00",
      "psp_reference": "M3CKTXK23RD6R5V5",
      "merchant_meta": {
        "invoice_id": "1431"
      },
      "shopper_ern": "ern:dummypms/tenants/ab1221a3-6175-47ed-8d62-bb30cce056cc/customers/258",
      "amount": "1500.0000",
      "extra_costs": "0.0000",
      "payment_link_id": "bd724b8e-faf2-4a64-8ac4-2ee14ddce2c1",
      "instrument_type": "Card",
      "instrument_brand": "maestro"
    },
    "reversed_transaction": null
  }
}

transaction.failed

Indicates a payment or reversal attempt failed. The subscriber may have previously received a transaction.pending notification for the same transaction id.

{
  "header": {
    "publisher": "https://pay.etrust.health",
    "event": "transaction.failed",
    "event_id": "d5dac51d-5fd2-4f7a-ad24-3c7151cc84be",
    "timestamp": "2024-03-31T22:05:39.136709+00:00",
    "tenant_ern": "ern:provetcloud-dev3/tenants/1"
  },
  "body": {
    "transaction_id": "741ef7f4-d457-4023-9181-e5d6ec964be2",
    "category": "reversal",
    "merchant_reference": "4673bba5-cacb-4e29-a0b6-22afc78d22b9",
    "psp": "adyen",
    "psp_timestamp": "2024-04-01T00:04:34+02:00",
    "payment_request_timestamp": "2024-03-26T14:28:14.701491+00:00",
    "psp_reference": "X2LV89VRQWTGLXT5",
    "failure": {
      "error_condition": "Refusal",
      "refusal_reason_code": null,
      "refusal_reason": "Transaction hasn't been captured, refund not possible",
      "psp_refusal_reason": null,
      "message": null
    },
    "merchant_meta": {
      "invoice_id": "2678",
      "transaction_id": "2306"
    },
    "shopper_ern": null,
    "amount": "-10",
    "extra_costs": "0.0000",
    "instrument_type": "Card",
    "instrument_brand": "mc",
    "receipts": {
      "cashier": {
        "text": "\n\n                  KASSA KOPIO                   \n\nP\u00e4iv\u00e4m\u00e4\u00e4r\u00e4                             26.3.2024\nAika                                    14:28:14\n\nKortti                          ************9999\nKorttityyppi                                  mc\n\nViite       4673bba5-cacb-4e29-a0b6-22afc78d22b9\nMaksupalvelutarjoajan viite     X2LV89VRQWTGLXT5\n\nTyyppi                          TAVARAT_PALVELUT\nYHTEENS\u00c4                                \u20ac -10,00\n\n\n\n\n              *PERUUTUS PYYDETTY*               \n"
      },
      "customer": {
        "text": "\n\n              KORTINHALTIJAN KOPIO              \n\nP\u00e4iv\u00e4m\u00e4\u00e4r\u00e4                             26.3.2024\nAika                                    14:28:14\n\nKortti                          ************9999\nKorttityyppi                                  mc\n\nViite       4673bba5-cacb-4e29-a0b6-22afc78d22b9\nMaksupalvelutarjoajan viite     X2LV89VRQWTGLXT5\n\nTyyppi                          TAVARAT_PALVELUT\nYHTEENS\u00c4                                \u20ac -10,00\n\n\n\n\n              *PERUUTUS PYYDETTY*               \n"
      }
    },
    "tokenization": {
      "result": "not-requested"
    },
    "reversal_type": "Refund",
    "reversal_reason": null,
    "merchant_reason": "refund 10",
    "original_transaction": {
      "transaction_id": "a30d5ba4-e4a1-4374-96eb-28dc36066214",
      "category": "payment",
      "merchant_reference": "89fd263c-5425-4749-a2ce-4c9e7ba951c1",
      "psp": "adyen",
      "psp_timestamp": "2024-03-26T14:27:06.724000+00:00",
      "payment_request_timestamp": "2024-03-26T14:27:06.457228+00:00",
      "psp_reference": "VQFD001711463226000.HSD2MWKS5MSWXT65",
      "merchant_meta": {
        "invoice_id": "2678",
        "transaction_id": "2305"
      },
      "shopper_ern": "ern:provetcloud-dev3/tenants/1/customers/23",
      "amount": "22.0000",
      "extra_costs": "0.0000",
      "instrument_type": "Card",
      "instrument_brand": "mc"
    },
    "reversed_transaction": null
  }
}

tokenization.succeeded

The payment gateway sends a tokenization notification if the tokenization is requested by the client. In this cases, transaction notification also includes basic information about the tokenization, but not all tokenization notification fields (e.g. instrument type, label).

For the DirectDebit instrument type, the tokenization result will always be “requested” in the transaction notification, even though the tokenization eventually succeeds. Therefore, TokenizationNotification is the only way to get tokenization data for the direct debit instrument type!

{
  "header": {
    "publisher": "https://pay.etrust.health",
    "event": "tokenization.succeeded",
    "event_id": "4aae0fdf-ec5b-4f17-ad64-7cb3ced2b28b",
    "timestamp": "2024-03-28T15:42:33.362557+00:00",
    "tenant_ern": "ern:dummypms/tenants/ab1221a3-6175-47ed-8d62-bb30cce056cc"
  },
  "body": {
    "tokenization_id": "bb6620cf-e6a6-44ec-a81e-fa32af733080",
    "merchant_reference": "a5b6f51f-5b9c-4496-9541-64797129f02b",
    "payment_link_id": "bd724b8e-faf2-4a64-8ac4-2ee14ddce2c1",
    "shopper_ern": "ern:dummypms/tenants/ab1221a3-6175-47ed-8d62-bb30cce056cc/customers/258",
    "instrument_type": "Card",
    "label": "MAESTRO - 03/30",
    "meta": {
      "health_plan": 1
    }
  }
}

tokenization.failed

Indicates tokenization failed. The notification might have tokenization_id value but it cannot be used to make new payments.

{
  "header": {
    "publisher": "https://pay.etrust.health",
    "event": "tokenization.failed",
    "event_id": "7e3eb1ce-ae1f-434b-976c-b9e757687748",
    "timestamp": "2024-03-22T06:34:35.685336+00:00",
    "tenant_ern": "ern:provetcloud-dev10/tenants/922"
  },
  "body": {
    "tokenization_id": "bc4dc9e7-e5f1-44a4-ab35-4dbe11c1b130",
    "merchant_reference": "0fe317fa-f722-4546-a210-247a6b38a72e",
    "payment_link_id": "00039ce0-2622-4cb5-b311-f45386d1af8e",
    "shopper_ern": "",
    "instrument_type": "",
    "label": "",
    "meta": {}
  }
}

company_status.changed

{
  "header": {
    "publisher": "https://pay.etrust.health",
    "event": "company_status.changed",
    "event_id": "45ebb7cd-6acb-4734-8524-162be8072ec8",
    "timestamp": "2024-03-21T08:16:17.231080+00:00",
    "tenant_ern": "ern:dummypms/tenants/65bfe195-8069-4ad6-abe8-0f377f1abfcc"
  },
  "body": {
    "company_id": "77a22864-6107-4ede-a40e-ef0e7ef97002",
    "company_reference": "203",
    "company_ern": "ern:dummypms/tenants/65bfe195-8069-4ad6-abe8-0f377f1abfcc/companies/203",
    "old_status": {
      "allow_payout": false,
      "status": "pending"
    },
    "new_status": {
      "allow_payout": false,
      "status": "active"
    }
  }
}

department_status.changed

{
  "header": {
    "publisher": "https://pay.etrust.health",
    "event": "department_status.changed",
    "event_id": "740d7ede-3103-4efb-96a4-f8eb5710b478",
    "timestamp": "2024-03-15T11:20:53.465650+00:00",
    "tenant_ern": "ern:dummypms/tenants/ab1221a3-6175-47ed-8d62-bb30cce056cc"
  },
  "body": {
    "department_id": "b930f128-f3c7-435a-97dd-5f2f7deef5d1",
    "department_reference": "234",
    "department_ern": "ern:dummypms/tenants/ab1221a3-6175-47ed-8d62-bb30cce056cc/departments/234",
    "old_status": {
      "allow_processing": false,
      "status": "active"
    },
    "new_status": {
      "allow_processing": true,
      "status": "active"
    }
  }
}