VerifyCardPayment

The VerifyCardPayment activity is used in workflows for sequences that contain a form with the Credit Card Payment component. The activity validates that the information received when the payment was processed matches the payment details for the provided transaction identifier that was returned when the payment was processed. A payment can be processed using the ACI, IATS, or PayPal payment gateways.

If the VerifyCardPayment activity is missing in the workflow for the sequence that contains the Credit Card Payment component, the transaction identifier will be null, and the form with the Credit Card Payment component will show a validation message or return an "event not verified" error.

The placement of the VerifyCardPayment activity must be in the Next transition from the form that contains the Credit Card Payment component.

alert The transition out of the form that has the Credit Card Payment component has to keep its the default name, i.e., “Next”. Do not change this default for this particular form. When receiving the post back from the payment site, Forms Builder automatically transitions forward and looks for “Next” on the form.

Verify card payment

VerifyCardPayment properties

alert The VerifyCardPayment activity does not check for form validation errors. If errors occur, the activity will return to same form, but the state of the form sequence and payment are not guaranteed. You need to ensure that there are no input validation errors prior to the user selecting the "Make Payment" link.

Capture validation errors using an If activity following the VerifyCardPayment activity. Specify the Condition for the If statement as: formInstance.ValidationMessages.HasErrors.

  • In the Then branch, add a LogLine (e.g., Text = "Verify payment result: " & formInstance.ValidationMessages(0).Message) and a CreateValidationItem activity that displays a message to the user.

  • In the Else branch, place a LogLine activity that records the success of the VerifyCardPayment activity in the log, e.g., "Payment verified using activity."

We recommend setting the Level value to Information for any LogLine or LogObject activities. See Best Practices for Logging and Logging in Azure.

The Condition area of the Next transition contains the expression Not formInstance.ValidationMessages.HasErrors. The Action area leads to the next form in the sequence, in this case, a payment confirmation form.

Has errors

Properties

VerifyCardPayment Properties
Name Value Required Notes
DisplayName String No Specify a name for the activity or accept the default.
PaymentAmount InArgument<Decimal> Yes Specify the amount to be paid using a credit card, for example, 45.00d.

If you specify a binding to an entity in the database, for example, depositEntity.Amount, make sure that the workflow for the form sequence contains a matching CreateEntity<> activity, for example, CreateEntity<DepositEntity>.

PaymentTransactionId InArgument<String> No Specify the transaction identifier associated with the payment form instance: formInstance.PaymentInfo.TransactionId
ValidationMessages InOutArgument
<ValidationMessage
Collection>
No Specify a variable that can be used to capture validation messages.

You can either set this value to formInstance.ValidationMessages to show it to the end user or assign it to a local variable and customize formInstance.ValidationMessages.