Capture scenarios for PostFinance Card

 

Capture Scenarios Response Status Description Notification Status Description

The transaction has been fully captured.

Only payments with “Authorized” status (9) can be captured.
Intermediary Status: 13 Capture Requested Final Notification Status: 2 Success

The payment has been partially captured.

Only payments with “Authorized” status can be partially captured. The payment has been sent out to be partially captured, but the payment gateway has not yet confirmed that the payment is successful.
Intermediary Status: 13 Capture Requested Final Notification Status: 35 Partially Captured
Capture Failed Scenarios Return Code Description

Retry Capture

This happens when the request timeouts at Provider; a new capture request has to be initiated.
Return Code: 157 Unable to capture transaction

The transaction could not be captured.

The transaction is not in an Authorized status (it has already been fully Captured or Partially Captured).
Return Code: 17 Payment is invalid

For a complete list of all the possible Return Code IDs go to our section GlobalPay Return Codes.

See the request – response examples for the above possible scenarios:

  • Success Status

    A payment can only be captured if it has an Authorized status. Once the payment has an Authorized status (9), you can capture either the full amount or a partial amount of the initial authorized amount for the transaction.

    A 200 HTTP response (OK) is returned if the request was completed successfully.

    Full capture means you capture the entire authorized amount for the initial transaction.

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4424180/capture
    Authorization: Basic MzAxNTE6V05ydTJ5WnJpR2RtNVVMZWt4dFM4cHprUXNRSmdYYTZBZnlnT3FXZXcvNlRBYzNYK1A=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 4424180,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20190320121124",
            "MerchantTransactionID": "PostFinance_55EMI",
            "OriginatorTransactionID": null,
            "Amount": "1000",
            "Currency": "CHF",
            "CapturedAmount": null,
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": null,
            "MethodID": 1129,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": "20190320121338",
            "Customer": null,
            "BillingAddress": {
                "ID": 7808,
                "City": null,
                "ZipCode": null,
                "State": null,
                "Street": null,
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "CH"
            },
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 13,
                "Info": "CaptureRequested",
                "Reasons": null
            },
            "MethodTransactionID": null,
            "TokenLifetime": 10,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=FFABC0234D73F9D23DAC72E1DFC52E61.4424180"
        }
    }
    

    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.

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

    Payment notification format:

    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=
    
    {
      "Payment": {
        "ID": 4424180,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20190320121124",
        "MerchantTransactionID": "PostFinance_55EMI",
        "OriginatorTransactionID": null,
        "Amount": "1000",
        "Currency": "CHF",
        "CapturedAmount": "1000",
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "",
        "MethodID": 1129,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30151,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
          "ID": 7808,
          "City": null,
          "ZipCode": null,
          "State": null,
          "Street": null,
          "StreetNumber": null,
          "HouseNumber": null,
          "HouseExtension": null,
          "Country": "CH"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
          "ID": 2,
          "Info": "Success",
          "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=FFABC0234D73F9D23DAC72E1DFC52E61.4424180"
      }
    }
    
  • Partially Captured Status

    Partial capture means you have the possibility to capture a smaller amount than the one from the initial authorized transaction. Partial capture is used when you have sent at least part of the order to the consumer and want to capture the amount for the item(s) that have been shipped.

    You can perform only one partial capture for an authorized transaction with the limitation that the amount of the partial capture to be smaller or equal than the initial authorized amount.

    Specify only the captured amount parameter in the query string, in order to partially capture the payment, like in the below example:

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4424180/capture?amount=500
    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 4424180,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20190320121124",
            "MerchantTransactionID": "PostFinance_55EMI",
            "OriginatorTransactionID": null,
            "Amount": "1000",
            "Currency": "CHF",
            "CapturedAmount": null,
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": null,
            "MethodID": 1129,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": "20190320121338",
            "Customer": null,
            "BillingAddress": {
                "ID": 7808,
                "City": null,
                "ZipCode": null,
                "State": null,
                "Street": null,
                "StreetNumber": null,
                "HouseNumber": null,
                "HouseExtension": null,
                "Country": "CH"
            },
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 13,
                "Info": "CaptureRequested",
                "Reasons": null
            },
            "MethodTransactionID": null,
            "TokenLifetime": 10,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=FFABC0234D73F9D23DAC72E1DFC52E61.4424180"
        }
    }
    

    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.

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

    Payment notification format:

    Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk={
      "Payment": {
        "ID": 4424180,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20190320121124",
        "MerchantTransactionID": "PostFinance_55EMI",
        "OriginatorTransactionID": null,
        "Amount": "1000",
        "Currency": "CHF",
        "CapturedAmount": null,
        "ReturnURL": "http://demo.smart2pay.com/redirect.php",
        "Description": "",
        "MethodID": 1129,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30151,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
          "ID": 7808,
          "City": null,
          "ZipCode": null,
          "State": null,
          "Street": null,
          "StreetNumber": null,
          "HouseNumber": null,
          "HouseExtension": null,
          "Country": "CH"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": null,
        "Status": {
          "ID": 35,
          "Info": "PartiallyCaptured",
          "Reasons": null
        },
        "MethodTransactionID": null,
        "TokenLifetime": 10,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": "https://apitest.smart2pay.com/Home?PaymentToken=FFABC0234D73F9D23DAC72E1DFC52E61.4424180"
      }
    }
    
  • Return Code: 157 – Unable to capture transaction

    The transaction could not be captured. Retry Capture. This happens when the request timeouts at Provider.

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4426277/capture
    Authorization: Basic MzAxNTE6V05ydTJ5WnJpR2RtNVVMZWt4dFM4cHprUXNRSmdYYTZBZnlnT3FXZXcvNlRBYzNYK1A=

    Response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json; charset=utf-8
    
    {
        "Payment": {
            "ID": 4426277,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20190322135942",
            "MerchantTransactionID": "s2ptest_a3",
            "OriginatorTransactionID": null,
            "Amount": "1000",
            "Currency": "CHF",
            "CapturedAmount": null,
            "ReturnURL": "http://demo.smart2pay.com/redirect.php",
            "Description": "test test",
            "MethodID": 1129,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": "20190322140025",
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 9,
                "Info": "Authorized",
                "Reasons": [
                    {
                        "Code": "157",
                        "Info": "Unable to capture transaction"
                    }
                ]
            },
            "MethodTransactionID": null,
            "TokenLifetime": null,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": null
        }
    }
  • Return Code: 17 – Payment is invalid

    The transaction could not be captured. The transaction is not in an Authorized status. You can receive this response when the payment you want to Capture is not Authorized or when the payment has already been Captured.

    Request:

    POST https://paytest.smart2pay.com/v1/payments/4426219/capture
    Authorization: Basic MzAxNTE6V05ydTJ5WnJpR2RtNVVMZWt4dFM4cHprUXNRSmdYYTZBZnlnT3FXZXcvNlRBYzNYK1A=

    Response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json; charset=utf-8{
        "Payment": {
            "ID": 4426219,
            "SkinID": null,
            "ClientIP": null,
            "Created": "20190322125640",
            "MerchantTransactionID": null,
            "OriginatorTransactionID": null,
            "Amount": null,
            "Currency": null,
            "CapturedAmount": null,
            "ReturnURL": null,
            "Description": null,
            "MethodID": 1129,
            "MethodOptionID": null,
            "IncludeMethodIDs": null,
            "ExcludeMethodIDs": null,
            "PrioritizeMethodIDs": null,
            "SiteID": 30151,
            "NotificationDateTime": null,
            "Customer": null,
            "BillingAddress": null,
            "ShippingAddress": null,
            "Articles": null,
            "Details": null,
            "ReferenceDetails": null,
            "CustomParameters": null,
            "PreapprovalID": null,
            "Status": {
                "ID": 13,
                "Info": "CaptureRequested",
                "Reasons": [
                    {
                        "Code": "17",
                        "Info": "Payment is invalid - 4426219"
                    }
                ]
            },
            "MethodTransactionID": null,
            "TokenLifetime": null,
            "Capture": null,
            "PreapprovalDetails": null,
            "RedirectURL": null
        }
    }