Last modified December 04, 2002
where in this case, the form variable "amount" would contain the total amount the user is to be charged. As is normal for Transform, the variable name is provided surrounded by square brackets.
where in this case, the form variable "pay" is the name of the submit button form variable.
<h3>A Donation Form</h3> <form method = "POST" action = "https://www.indiana.edu/~your_user_name/transformep.cgi"> <p> Enter your name:<br> <input name="name" size = 40> <p> <p> Enter the amount you'd like to donate:<br> <input name="amount" size=20 > <p> <input type="submit" name = charge value="Go to the credit card entry form"> </form>
# Begin the *epayment-variables* section.
# Here we've set !epayment-mode to syntax-check.
# The !payment-total-amount variable is set to [amount],
# the name of the amount input field on our form.
# The !payment-button-name variable is set to [charge],
# the name of our submit button.
*epayment-variables*
!epayment-mode = syntax-check
!payment-total-amount = [amount]
!payment-button-name = [charge]
# Begin the *define-variables* section.
# This is only used to set !force-error-if
*define-variables*
# If there is an error during the payment
# authorization process, the variable IPAS_error_message
# will be set. Here call !force-error-if with this variable.
# This will cause only *error-response* sections to be
# used if there was an IPAS error.
!force-error-if [IPAS_error_message]
# Here's a silly *success-response*.
# Note that IPAS_order_id is displayed to the user!
*success-response*
<h2>Thank you for your donation</h2>
Your name: [name]<br>
The amount you have been charged: <b>$[amount]</b><p>
Your Order ID: <b>[IPAS_order_id]</b>
# Here is the *error-response*.
# This section will only be displayed if there is
# an IPAS_error_message. The !force-error-if command
# accomplished this.
*error-response*
<b>The following error occurred:</b><p>
[IPAS_error_message]
<p>
Just for fun show the error code: [IPAS_error_code]
##### end template file
*epayment-variables* !epayment-mode = syntax-check !payment-total-amount = [amount] !payment-button-name = [charge] *define-variables* # Make both "name" and "amount" required variables. [req-name] [req-amount] # If there is an error during the payment # authorization process, the variable IPAS_error_message # will be set. Here call !force-error-if with this variable. # This will cause only *error-response* sections to be # used if there was an IPAS error. !force-error-if [IPAS_error_message] # Add a !force-error-if that tests to be sure the # amount entered by the user is in the correct format. # This regular expression test simply says: does the # amount variable begin with one or more digits, # followed by a period and ends with two digits. !force-error-if not [amount] =~ /^\d+\.\d\d$/ # Here's a silly *success-response*. # Note that IPAS_order_id is displayed to the user! *success-response* <h2>Thank you for your donation</h2> Your name: [name]<br> The amount your have been charged: <b>$[amount]</b><p> Your Order ID: <b>[IPAS_order_id]</b> # Here is a standard error response if there were # no IPAS errors. This *error-response* will be used # if the user didn't complete all required variables # or if the test on the amount variable fails. # Note that required variables processing is done # before the user is sent to the credit card entry # form. Thus, if there are required variable errors, # IPAS_error_message will not yet have been set. # The !use-if command below simply says: process # this section if there is no IPAS_error_message. *error-response* !use-if not [IPAS_error_message] <h2>Error - this is the first error-response</h2> # Test the amount field and print an error message # if it has an incorrect format. !print-if not [amount] =~ /^\d+\.\d\d$/ The amount you entered: <b>[amount]</b> has an incorrect format.<br> The amount must include dollars and cents (e.g. 10.00).<p> !end-print-if # This section tests for the presence of other required # variables and prints a message if they are missing. # Here only [name] is tested for - others could be added # depending on your form. !print-if not [name] The name field on the form is required.<p> !end-print-if Use the Back button on your browser to return to the form. <p> # Here is the second *error-response*. # This section will only be displayed if there is # an IPAS_error_message. The !force-error-if command # accomplished this. # The !use-if command below insures this section will # only be displayed if there were IPAS errors. *error-response* !use-if [IPAS_error_message] <b>The following error occurred:</b><p> [IPAS_error_message] <p> Just for fun show the error code: [IPAS_error_code] # Next, within this *error-response* we create a new <form> (button) # that allows the user to return directly to the credit card entry form. # This may or may not be appropriate depending on the error # that occurred. The !print-if below checks for just errors # on the credit card entry form using IPAS_card_error. # Hence the form is only printed when there are errors on that form. !print-if [IPAS_card_error] and not [IPAS_amount_error] <p> If you would like to re-enter your credit card information, use the submit button below.<p> The total amount you will be charged is: $[amount]<p> # Here we must supply the full path to transformep.cgi and the template # file because we are calling transform from a template file. <form method = "POST" action = "https://www.indiana.edu/~your_user_name/transformep.cgi?your_user_name/wwws/donate"> <p> # The !carry-forward command insures that all previous form # information will be available. !carry-forward all # Again, the "charge" submit is supplied with a name attribute. <input type="submit" name = charge value="Go to the credit card entry form"> </form> !end-print-if ##### end template file
| Amount Value Errors | |
|---|---|
| AE-0001 | A purchase amount to be approved was not specified. |
| AE-0002 | The purchase amount to be approved has an invalid format. |
| Credit Card Entry Errors | |
| CE-0001 | The type of credit card specified cannot be accepted. |
| CE-0002 | A credit card number was not supplied. |
| CE-0003 | The credit card's expiration date was not supplied. |
| Verisign Cash register Errors - there are many others | |
| CR-0001 | Cash Register: Cannot find a required field in the approval request. |
| CR-0002 | Cash Register: The order id contains illegal characters. An order id can contain letters, numbers, periods (.), commas (,), dashes (-), and underscores (_). |
| CR-0003 | Cash Register: The order id is longer than the maximum of 40 characters. |
| CR-0004 | Cash Register: The order id field is missing. |
| CR-0005 | Cash Register: The credit card number contains illegal characters. A credit card number can contain numbers, dashes (-), underscores (_), or blank spaces. |
| CR-0006 | Cash Register: The credit card number is longer than the maximum of 20 characters. |
| CR-0007 | Cash Register: The credit card number was not received. |
| CR-0008 | Cash Register: The credit card number is invalid |
| CR-0009 | Cash Register: The order id received already exists for this merchant |
| CR-0010 | Cash Register: The order id could not be found. |
| CR-0034 | Cash Register: The length of one or more of the card-expiration-date, card-name, card-address, card-city, card-state, card-country, or tax-id is too long. |
| System Errors | |
| SE-0001 | The IPAS error message you want to test does not exist. |
| SE-0002 | The IU IPAS was contacted using an invalid HTTP access
method. Please notify the merchant of this error. |
| SE-0003 | IPAS could not update it's transaction notification log. Please notify ???? at ???? of this error. |
| SE-0004 | IPAS did not receive a response from the IPAS agent. |
| SE-0005 | The format of the order id that was received is invalid. |
| SE-0006 | The IU IPAS configuration for this merchant is invalid or
missing. Please notify the merchant of this error. |
| SE-0007 | IPAS did not receive the variable 'IPAS_variable_list' or it does not have a value Please notify the merchant of this error. |
| SE-0008 | IPAS did not receive the variable 'IPAS_return_url' from the
IPAS Agent or it does not have a value. Please notify the merchant of this error. |
| SE-0009 | IPAS did not receive the variable 'IPAS_request_method' or it
does not have a value. Please notify the merchant of this error. |
| SE-0010 | IPAS did not receive the variable 'IPAS_order_id' or it does not have a value. Please notify the merchant of this error. |
| SE-0011 | The format of the 'IPAS_order_id' variable that IPAS received is invalid. |
| SE-0012 | IPAS was not able to retrieve the amount of the purchase.
Please notify the merchant of this error. |
| SE-0013 | The IPAS agent received an order id for which no order information could be found. |
| SE-0014 | The IPAS agent was activated with an invalid HTTP request method. |
| SE-0015 | The IPAS agent received an invalid HTTP user agent name. |
| SE-0016 | The IPAS agent received an invalid IPAS host IP number. |
| SE-0017 | The IPAS agent received an invalid IPAS host name. |
| SE-0018 | The IPAS agent received an invalid IPAS merchant name. |
| SE-0019 | The IPAS agent received an invalid request mode from IPAS |
| SE-0020 | One or more reserved variable names were recognized and are listed below. Please select other names. |
| SE-0021 | The variable 'IPAS_return_url' is not valid. |
| SE-0022 | An illegal value was received for IPAS_request_method. This method is not supported |