submit and pay - smbc-digital/form-builder GitHub Wiki

Submit and Pay

This sends the from details to the Submit and Pay Web Service. The required fields

are

  • conditions: List
  • behaviourType: "SubmitAndPay"
  • SubmitSlug: List The SubmitSlug will vary according to the environment

A SubmitSlug consists of

  • Environment: string
  • URL: string
  • AuthToken : string
  • callbackUrl: string

callbackUrl

The callbackUrl property is used when third party systems are involved and logic has be performed on the receipt of a response from the third party system. In the current code base this is used when a call is made to invoke Civica Pay and the result outcome specifies whether the payment was successful or not. In this scenario we need the form to behave accordingly.

The model passed to the callbackUrl provided is PostPaymentUpdateRequest. Which contains the Reference passed into the payment provider and the status of the payment.

    public class PostPaymentUpdateRequest
    {
        public string Reference { get; set; }

        public EPaymentStatus PaymentStatus { get; set; }
    }

Example

"Behaviours": [
        {
          "conditions": [],
          "behaviourType": "SubmitAndPay",
          "SubmitSlugs": [
            {
              "Environment": "local",
              "URL": "https://localhost/api/v1/Home/Post",
              "AuthToken": "local-authtoken",
              "callbackUrl": "http://formsurl/serrvice/api/v1/Home/Post"
            },
            {
              "Environment": "Int",
              "URL": "http://int/formbuilderservice/api/v1/Home/Post",
              "AuthToken": "int-authtoken",
              "callbackUrl": "http://formsurl/serrvice/api/v1/Home/Post"
            },
            {
              "Environment": "QA",
              "URL": "http://qa/formbuilderservice/api/v1/Home/Post",
              "AuthToken": "qa-authtoken",
              "callbackUrl": "http://formsurl/serrvice/api/v1/Home/Post"
            },
            {
              "Environment": "Staging",
              "URL": "http://staging/formbuilderservice/api/v1/Home/Post",
              "AuthToken": "staging-authtoken",
              "callbackUrl": "http://formsurl/serrvice/api/v1/Home/Post"
            },
            {
              "Environment": "Prod",
              "URL": "http://prod/formbuilderservice/api/v1/Home/Post",
              "AuthToken": "prod-authtoken",
              "callbackUrl": "http://formsurl/serrvice/api/v1/Home/Post"
            }
          ]
⚠️ **GitHub.com Fallback** ⚠️