Truemoney Recurring Payment

Definition: POST /v1/payments/recurrent

A recurring payment is created in the same manner a one-off payment is created. In addition, you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the information specific to each payment method.

For Truemoney (1143), you need to send the PreapprovalID (the PreapprovalID received when you created/opened a preapproval) and the Amount to be captured.

Checkout the below example of a recurring payment request for Truemoney (1143) that is based on the PreapprovalID. Please send in the payment request the Description parameter and Country parameter that should be the same with the ones sent in the Preapproval request.

Request:

POST https://paytest.smart2pay.com/v1/payments/recurrent
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "PreapprovalID": 28076,
    "MerchantTransactionID": "s2ptest_truemoney1",
    "Amount": 100,
    "Currency": "THB",
    "MethodID": 1143,
    "Description": "recurring payment",
    "BillingAddress": {
    "Country": "TH"
    } 
  }
}

Response:

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "Payment": {
        "ID": 5879743,
        "SkinID": null,
        "ClientIP": null,
        "Created": "20210202154700",
        "MerchantTransactionID": "s2ptest_truemoney1",
        "OriginatorTransactionID": null,
        "Amount": "100",
        "Currency": "THB",
        "CapturedAmount": null,
        "ReturnURL": null,
        "Description": "recurring payment",
        "MethodID": 1143,
        "MethodOptionID": null,
        "IncludeMethodIDs": null,
        "ExcludeMethodIDs": null,
        "PrioritizeMethodIDs": null,
        "SiteID": 30201,
        "NotificationDateTime": null,
        "Customer": null,
        "BillingAddress": {
            "ID": 1540,
            "City": null,
            "ZipCode": null,
            "State": null,
            "Street": null,
            "StreetNumber": null,
            "HouseNumber": null,
            "HouseExtension": null,
            "Country": "TH"
        },
        "ShippingAddress": null,
        "Articles": null,
        "Details": null,
        "ReferenceDetails": null,
        "CustomParameters": null,
        "PreapprovalID": 28076,
        "Status": {
            "ID": 1,
            "Info": "Open",
            "Reasons": null
        },
        "Fraud": null,
        "MethodTransactionID": null,
        "TokenLifetime": null,
        "Capture": null,
        "PreapprovalDetails": null,
        "RedirectURL": null,
        "Splits": null
    }
}

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 MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

{
  "Payment": {
    "ID": 5879743,
    "SkinID": null,
    "ClientIP": null,
    "Created": "20210202154700",
    "MerchantTransactionID": "s2ptest_truemoney1",
    "OriginatorTransactionID": null,
    "Amount": "100",
    "Currency": "THB",
    "CapturedAmount": null,
    "ReturnURL": "",
    "Description": "recurring payment",
    "MethodID": 1143,
    "MethodOptionID": null,
    "IncludeMethodIDs": null,
    "ExcludeMethodIDs": null,
    "PrioritizeMethodIDs": null,
    "SiteID": 30201,
    "NotificationDateTime": null,
    "Customer": null,
    "BillingAddress": {
      "ID": 1540,
      "City": null,
      "ZipCode": null,
      "State": null,
      "Street": null,
      "StreetNumber": null,
      "HouseNumber": null,
      "HouseExtension": null,
      "Country": "TH"
    },
    "ShippingAddress": null,
    "Articles": null,
    "Details": null,
    "ReferenceDetails": null,
    "CustomParameters": null,
    "PreapprovalID": 28076,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    },
    "Fraud": null,
    "MethodTransactionID": null,
    "TokenLifetime": null,
    "Capture": null,
    "PreapprovalDetails": null,
    "RedirectURL": null,
    "Splits": null
  }
}