Prev | Current Page 739 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

php?step=1">



4. Load the test_datacash.php file in your browser to see the results. If you use Opera, the output should
look like Figure 20-1, because Opera shows only the contents of the XML elements. If you use another web
browser, you should see properly formatted XML documents.
Figure 20-1. DataCash transaction results
CHAPTER 20 ?–  PROCESSING CREDIT CARD TRANSACTIONS 634
5. Log on to https://testserver.datacash.com/reporting2 to see the transaction log for your
DataCash account (note that this view takes a while to update, so you might not see the transaction right
away). This report is shown in Figure 20-2.
Figure 20-2. DataCash transaction report details
How It Works: The Code That Communicates with DataCash
The DataCashRequest class is quite simple. First the constructor sets the HTTPS address where we send your
requests:
// Constructor initializes the class with URL of DataCash
public function __construct($url)
{
// Datacash URL
$this->_mUrl = $url;
}
When we want to make a preauthentication request, we first need to call the MakeXmlPre() method to create the
required XML for this kind of request. Some XML elements are optional (such as startdate or issuenumber,
which get default values if we don??™t provide our own??”see the MakeXmlPre() method), but the other elements are
mandatory.


Pages:
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751
skrzynki do internetu brak Accept opony samochodowe mieszkania sosnowiec