Payment Notification

Whenever a payment process is completed, we notify you of the event and whether it was successful or not. GlobalPay will send a POST message to the notification URL you setup in the Merchant Dashboard.

You need to respond with HTTP code 204 (No Content)!

Please note that you need to respond within a 30 seconds time limit otherwise we will resend the notification.

We recommend you to always verify the Notification content we sent and not just simply/automatically respond to our notifications. Also it is highly recommended to match the values for notification Amount and Currency with the ones from your database!

In exceptional cases it is possible to receive different notifications and your system should be able to handle such situations. If an additional notification is received with Success Status, it overwrites any previous notification.

If you do not respond to the notifications of type Payment our system will keep sending the notifications until it receives a response. At first you will be notified more often. Once the time passes the notifications from our system will be rare and they will eventually stop (after a period of time defined in our system, currently set to 7 days).

Payment Notification Format

We will notify you about the new status of the payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

For the payment methods where the Customer ID parameter is not being sent in the initial payment response, the notification format will contain a Customer object with a NULL value.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
    "Payment": {
        "ID": 4683165,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20190621075306",
        "MerchantTransactionID": "s2ptest_ga1",
        "OriginatorTransactionID": null,
        "Amount": "11",
        "Currency": "CNY",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "",
        "MethodID": 1066,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer":  null,
        "BillingAddress": {
            "ID": 291,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "CN"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": {
            "BankCode": null,
            "BankName": null,
            "EntityID": null,
            "EntityNumber": null,
            "ReferenceID": null,
            "ReferenceNumber": null,
            "SwiftBIC": null,
            "AccountCurrency": null,
            "AccountNumber": null,
            "AccountHolder": null,
            "IBAN": null,
            "AmountToPay": null,
            "QRCodeURL": "weixin://wxpay/bizpayurl?pr=dHj3ZkU",
            "Instructions": null,
            "BoletoURL": null
        },
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=D70DBE70D7A4FE3E0E6E035665B5598A.4683165"
    }
}

Response:

204 No Content

For the payment methods where the Customer ID parameter is being sent in the initial payment response, the notification format will contain a Customer object with all the details.

Payment notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{
  "Payment": {
    "ID": 232662304,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20190612180443",
    "MerchantTransactionID": "1560362681423",
    "OriginatorTransactionID": null,
    "Amount": "30000",
    "Currency": "BRL",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "Test Payment",
    "MethodID": 46,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 31547,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 2403413,
      "MerchantCustomerID": null,
      "Email": "test@gmail.com",
      "FirstName": "Test Person",
      "LastName": null,
      "Gender": null,
      "SocialSecurityNumber": null,
      "Phone": null,
      "Company": null,
      "DateOfBirth": null
    },
    "BillingAddress": {
      "ID": 89794,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "BR"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": 5,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": "https://globalapi.smart2pay.com/Home?PaymentToken=6F00D7B7444DA35A316F184DA554E965.232662304"
  }
}

Response:

204 No Content

For Card payment notifications, you will also receive the new status of the card payment to the Notification URL you setup in the Merchant Dashboard. The format of the received notification has the same structure as the response of the initial request.

You need to respond with HTTP code 204 (No Content)!

Payment notification format:

Authorization: Basic MTAxMDpnYWJp

{
  "Payment": {
    "ID": 202238,
    "ClientIP": null,
    "SkinID": null,
    "Created": "20161205091735",
    "MerchantTransactionID": "s2ptest_h9",
    "OriginatorTransactionID": null,
    "Amount": "2000",
    "Currency": "EUR",
    "CapturedAmount": "2000",
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": "payment product",
    "StatementDescriptor": "bank statement message",
    "MethodID": 6,
    "MethodOptionID": null,
    "SiteID": 1010,
    "NotificationDateTime": null,
    "Customer": {
      "ID": 115,
      "MerchantCustomerID": "null",
      "Email": "customer@test.com",
      "FirstName": "John",
      "LastName": "Doe",
      "Gender": "1",
      "SocialSecurityNumber": "45908-28324",
      "Phone": "0744-783322",
      "Company": "S2P"
    },
    "BillingAddress": {
      "ID": 253,
      "City": "Iasi",
      "ZipCode": "7000-49",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "5A",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "ShippingAddress": {
      "ID": 87,
      "City": "Iasi",
      "ZipCode": "700049",
      "State": "Iasi",
      "Street": "Sf Lazar",
      "StreetNumber": "37",
      "HouseNumber": "-",
      "HouseExtension": "-",
      "Country": "RO"
    },
    "Articles": null,
    "Card": null,
    "CreditCardToken": null,
    "Status": {
      "ID": 11,
      "Info": "Captured",
      "Reasons": []
    },
    "CaptureDetails": {
      "ID": 264,
      "Amount": 2000,
      "Status": {
        "ID": 2,
        "Info": "Success",
        "Reasons": []
      }
    },
    "MethodTransactionID": null,
    "PaymentTokenLifetime": null,
    "Capture": false,
    "Retry": true,
    "RedirectURL": null,
    "3DSecure": null
  }
}

Response:

204 No Content

Whenever a payment changes its status, we notify you of the event and whether it was successful or not. In case of a non-successful payment, additional information to why the payment got to this status will be sent in the Reasons Code and Info fields.

For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.

Payment notification format:

Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

{

  "Payment": {
    "ID": 3470169,        
    "SkinID": null,        
    "ClientIP": null,        
    "Created": "20171216132024",        
    "MerchantTransactionID": "s2ptest_g282",
    "OriginatorTransactionID": null,
    "Amount": 100,
    "Currency": "EUR",
    "CapturedAmount": null,
    "ReturnURL": "http://demo.smart2pay.com/redirect.php",
    "Description": null,
    "MethodID": 2,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": "20171216132024",
    "Customer": null,
    "BillingAddress": null,
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": null,
    "Status": {
      "ID": 4,
      "Info": "Failed",
      "Reasons": [
        {
          "Code": "147",
          "Info": "Address details are invalid (BillingAddress)Country - RegEx: ^[a-zA-Z]{2}$;"
        }
      ]
    },
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null
  }
}

Response:

204 No Content

Payment Notification Security

You will receive a notification whenever a payment process is completed, successful or not. GlobalPay will send a POST message to the Notification URL you initially setup in the Merchant Dashboard.

To ensure that a payment has been securely processed you will need to validate the authorization header using your SiteID and API Key in the same manner you compute the authorization header for a request. For more details, please go to Authentication section.

Also, you will have to whitelist Smart2Pay’s IPs for Test and Live Environment.
Here you will find the complete list of GlobalPay’s Environments and IPs.