In this section, let's see how to build a FormFlow to pay a credit card bill using the bot. However, here we will not use a database; rather the bot will just contain static information.
Add the CreditCardPayment class:
[Serializable]
class CreditCardPayment
{
[Prompt("Please enter your creditcard number")]
public string CreditcardNumber;
[Prompt("Please enter how much amount do you want to pay")]
public string Pay;
public string CreditCardPaymentSuccessMessage;
};
Next, in the Customer class, define the following public field/property:
public CreditCardPayment CreditCard_Payment;
Append the following code to the builder object to perform the credit card payment; add it before OnCompletion(accountStatus):
Field("CreditCard_Payment.Pay", isCreditCardPayment)
...