| home / programming / carts / chap7 / 2 | [previous] |
|
|
We also display the amount to be charged to the customer's card, and provide them a reference number in case there are any problems.
<tr>
<td class="cart">
Amount to be charged: $<php echo $HTTP_POST_VARS["order_total"]; ?>
</td>
<td>
Order Reference Code: <php echo $HTTP_POST_VARS["s_id"]; ?>
</td>
</tr>
</table>
<input type="hidden" name="ship_type"
value="<?php echo $HTTP_POST_VARS["ship_type"]; ?>" />
<input type="hidden" name="order_total"
value="<?php echo $HTTP_POST_VARS["order_total"]; ?>" />
<input type="hidden" name="s_id" value="<?php echo $s_id; ?>" />
</form>
<?php
}
?>
</td>
</tr>
</table>
<p><a href="checkout_help.html" target="_blank">HELP</a></p>
</body>
</html>
You may have noticed that we've omitted one crucial step here, which is obtaining the actual authorization of the sale. The method for doing this will vary according to the processor or clearinghouse that's used; in general, you'll be provided with code and/or programming APIs and guidelines to employ. The scenario might look something like this:
Customer fills out secure credit card information form and the card number is validated
The credit card form data form data required by the card processing agency is posted to the processor's server via a secure connection
Authorisation code or "declined" code is posted back to a script on your server (also using a secure connection)
If an authorisation is returned from the processor, display success message to customer, update inventory and send confirmation e-mail
If the sale is rejected, return customer to the Payment Options screen, displaying a message indicating that the card was declined and perhaps provide appropriate contact information or advise the customer to contact his bank or credit card provider to ascertain the nature of the problem.
| home / programming / carts / chap7 / 2 | [previous] |
Created: December 26, 2002
Revised: December 26, 2002
URL: http://webreference.com/programming/carts/chap7/2/8.html