Documentation

SaltPay, all rights reserved. 2022 ©

Webhook notifications

Webhook notifications are notifications that are pushed to the merchant by SaltPay RESTful Payment Gateway when certain events happen. Server urls are registered using B-Online, url listeners can be registered for the following events:

  • PaymentCreate
  • PaymentCapture
  • PaymentRefund
  • PaymentCancel

NOTE: Only urls that have a valid SSL encryption can be used.

RPG will attempt to post notifications to listeners with minimal delay, if the listener server does not respond with status code 200 (OK) then RPG will retry to deliver the notification every hour for 24 hours or until the notification has been successfully delivered.

Notification messages have the structure

{
  "EventId": "string",
  "EventType": "PaymentCreate",
  "Created": "2016-01-08T16:41:16.962Z",
  "Data": {}
}

where "Data" contains the same data the API returned when the action was performed.

Getting notification confirmation

To confirm that the notification was indeed sent from SaltPay a call can be made to the API with the EventId and it should return the same notification that was received.

Request:

[GET] api/events/{{EventId}}

{
  "EventId": "ev_l4VIh1Ktn0NeSfU7HihsP0JyAXxO4mqt",
  "EventType": "PaymentCreate",
  "Created": "2016-01-11T16:42:10Z",
  "Data": {
    "TransactionId": "tr_jtv0lxQCZx01O7zO4AAivPyFADihyRGA",
    "TransactionType": "Sale",
    "Amount": 100,
    "Currency": "352",
    "TransactionDate": "2015-10-10T11:00:00",
    "OrderId": "INTEGR059391",
    "AuthCode": "814206",
    "ActionCode": "000",
    "TransactionStatus": "Accepted",
    "PaymentMethod": {
      "PaymentType": "Card",
      "PAN": "558740******2011",
      "ExpYear": "2018",
      "ExpMonth": "09",
      "CardType": "MasterCard"
    },
    "Metadata": {
      "Payload": "TEST"
    }
  }
}

##Example notifications##

For more examples see Example Requests.

PaymentCreate notification

{
  "EventId": "ev_l4VIh1Ktn0NeSfU7HihsP0JyAXxO4mqt",
  "EventType": "PaymentCreate",
  "Created": "2016-01-11T16:42:10Z",
  "Data": {
    "TransactionId": "tr_jtv0lxQCZx01O7zO4AAivPyFADihyRGA",
    "TransactionType": "Sale",
    "Amount": 100,
    "Currency": "352",
    "TransactionDate": "2015-10-10T11:00:00",
    "OrderId": "INTEGR059391",
    "AuthCode": "814206",
    "ActionCode": "000",
    "TransactionStatus": "Accepted",
    "PaymentMethod": {
      "PaymentType": "Card",
      "PAN": "558740******2011",
      "ExpYear": "2018",
      "ExpMonth": "09",
      "CardType": "MasterCard"
    },
    "Metadata": {
      "Payload": "TEST"
    }
  }
}

PaymentCapture notification

{
  "EventId": "ev_gf6Ob3jO0bgQcroWy0Xzie2uiRxP6VPp",
  "EventType": "PaymentCapture",
  "Created": "2016-01-11T16:43:19Z",
  "Data": {
    "TransactionId": "tr_qH5A_73d-1qGJIwnX2Mv7-bIRxwBaXXQ",
    "TransactionType": "PreAuthorization",
    "Amount": 100,
    "Currency": "352",
    "TransactionDate": "2015-10-10T11:00:00",
    "OrderId": "INTEGR901390",
    "AuthCode": "814209",
    "ActionCode": "000",
    "TransactionStatus": "Captured",
    "PaymentMethod": {
      "PaymentType": "Card",
      "PAN": "558740******2011",
      "ExpYear": "2018",
      "ExpMonth": "09",
      "CardType": "MasterCard"
    },
    "Metadata": {
      "Payload": "TEST"
    }
  }
}

PaymentCancel notification

{
  "EventId": "ev_ZLMDKR4VlNGZenGHjxWmPl2mMHTiPNhT",
  "EventType": "PaymentCancel",
  "Created": "2016-01-11T16:44:34Z",
  "Data": {
    "TransactionId": "tr_KB4YkgAOYXvdVd1iN_wI00nXkKK2XV6A",
    "TransactionType": "PreAuthorization",
    "Amount": 100,
    "Currency": "352",
    "TransactionDate": "2015-10-10T11:00:00",
    "OrderId": "INTEGR505919",
    "AuthCode": "814212",
    "ActionCode": "000",
    "TransactionStatus": "Cancelled",
    "PaymentMethod": {
      "PaymentType": "Card",
      "PAN": "558740******2011",
      "ExpYear": "2018",
      "ExpMonth": "09",
      "CardType": "MasterCard"
    },
    "Metadata": {
      "Payload": "TEST"
    }
  }
}

PaymentRefund notification

{
  "EventId": "ev_AEuSUOY-uQJOE0NOjkPqC8wYhmXXA-0K",
  "EventType": "PaymentRefund",
  "Created": "2016-01-11T16:43:48Z",
  "Data": {
    "TransactionId": "tr_kU2VVEBEApFNlDQHhG6Meh-wQITeRQxy",
    "TransactionType": "Sale",
    "Amount": 100,
    "Currency": "352",
    "TransactionDate": "2015-10-10T11:00:00",
    "OrderId": "INTEGR941847",
    "AuthCode": "814210",
    "ActionCode": "000",
    "TransactionStatus": "Refunded",
    "PaymentMethod": {
      "PaymentType": "Card",
      "PAN": "558740******2011",
      "ExpYear": "2018",
      "ExpMonth": "09",
      "CardType": "MasterCard"
    },
    "Metadata": {
      "Payload": "TEST"
    }
  }
}