Overview
  • Namespace
  • Class
  • Tree

Namespaces

  • OpenDNS
    • MES
      • Recurring
      • Reporting
      • Trident

Classes

  • Report
  1 <?php
  2 namespace OpenDNS\MES\Reporting;
  3 use OpenDNS\MES\Request;
  4 
  5 class Report extends Request
  6 {
  7     const REPORT_ACHP_RETURN_SUMMARY = 18;
  8     const REPORT_ACHP_SETTLEMENT_SUMMARY = 17;
  9     const REPORT_AUTHORIZATION_LOG = 15;
 10     const REPORT_BATCH_SUMMARY = 1;
 11     const REPORT_CHARGEBACK_ADJUSTMENTS = 5;
 12     const REPORT_CUSTOM = 9;
 13     const REPORT_DAILY_INTERCHANGE_SUMMARY = 8;
 14     const REPORT_DEPOSIT_SUMMARY = 3;
 15     const REPORT_FX_BATCH_SUMMARY = 10;
 16     const REPORT_FX_INTERCHANGE_SUMMARY = 13;
 17     const REPORT_INTERNATIONAL_CHARGEBACKS = 11;
 18     const REPORT_INTERNATIONAL_RETRIEVAL_REQUESTS = 12;
 19     const REPORT_INTERNATIONAL_SETTLEMENT_SUMMARY = 14;
 20     const REPORT_PAYMENT_GATEWAY_REJECTED_TRANSACTIONS = 23;
 21     const REPORT_PAYMENT_GATEWAY_SETTLED_TRANSACTIONS = 22;
 22     const REPORT_PAYMENT_GATEWAY_UNSETTLED_TRANSACTIONS = 21;
 23     const REPORT_RETRIEVAL_REQUESTS = 7;
 24     const REPORT_SETTLEMENT_SUMMARY = 2;
 25 
 26     const TYPE_SUMMARY = 0;
 27     const TYPE_DETAIL = 1;
 28 
 29     const QUERY_VISA_ARDEF_TABLES = 283;
 30     const QUERY_MC_ARDEF_TABLES = 284;
 31 
 32     protected $httpMethod = 'GET';
 33 
 34     protected $defaultFieldValues = array(
 35         'reportType' => 0,
 36         'encoding' => 'csv',
 37         'includeTridentTranId' => 'true',
 38     );
 39 
 40     protected $apiBasePath = '/jsp/reports/report_api.jsp';
 41 
 42     /**
 43      * Sets authentication info for the request
 44      *
 45      * This is required before calling execute()
 46      *
 47      * @param string $profileId Your MeS User ID
 48      * @param string $profileKey Your MeS Password
 49      * @return self The current class instance for chaining
 50      */
 51     public function setAuthenticationInfo($userId, $password)
 52     {
 53         return $this->setField('userId', $userId)
 54                     ->setField('userPass', $password);
 55     }
 56 
 57     /**
 58      * Sets the report ID you'd like returned
 59      *
 60      * Expected values are the REPORT_ consts from this class
 61      *
 62      * @param int $reportId A report id
 63      * @return self The current class instance for chaining
 64      */
 65     public function setReportId($reportId)
 66     {
 67         return $this->setField('dsReportId', $reportId);
 68     }
 69 
 70     /**
 71      * Sets the start date of the report
 72      *
 73      * @param \DateTime $reportId A datetime instance representing the start date of the report
 74      * @return self The current class instance for chaining
 75      */
 76     public function setBeginDate(\DateTime $startDate)
 77     {
 78         // Note: The api expects months to be 0-indexed
 79         return $this->setField('beginDate.month', $startDate->format('m') - 1)
 80                     ->setField('beginDate.day', $startDate->format('d'))
 81                     ->setField('beginDate.year', $startDate->format('Y'))
 82                     ->setField('reportDateBegin', $startDate->format('m/d/Y'));
 83     }
 84 
 85     /**
 86      * Sets the end date of the report
 87      *
 88      * @param \DateTime $reportId A datetime instance representing the end date of the report
 89      * @return self The current class instance for chaining
 90      */
 91     public function setEndDate(\DateTime $endDate)
 92     {
 93         // Note: The api expects months to be 0-indexed
 94         return $this->setField('endDate.month', $endDate->format('m') - 1)
 95                     ->setField('endDate.day', $endDate->format('d'))
 96                     ->setField('endDate.year', $endDate->format('Y'))
 97                     ->setField('reportDateEnd', $endDate->format('m/d/Y'));
 98     }
 99 
100     /**
101      * Sets the node ID (AKA merchant account number)
102      *
103      * @param string $nodeId
104      * @return self The current class instance for chaining
105      */
106     public function setNodeId($nodeId)
107     {
108         return $this->setField('nodeId', $nodeId);
109     }
110 
111     /**
112      * Sets the report type to return.
113      *
114      * Valid values are the TYPE_ constants from this class
115      *
116      * @param int $reportType
117      * @return self The current class instance for chaining
118      */
119     public function setReportType($reportType)
120     {
121         return $this->setField('reportType', $reportType);
122     }
123 
124     /**
125      * Sets whether the report should include the trident transaction ID or not
126      *
127      * @param bool $includeId
128      * @return self The current class instance for chaining
129      */
130     public function setIncludeTridentTransactionId($includeId)
131     {
132         return $this->setField('includeTridentTranId', $includeId ? 'true' : 'false');
133     }
134 
135     /**
136      * Sets whether the report should include the purchase ID or not
137      *
138      * @param bool $includeId
139      * @return self The current class instance for chaining
140      */
141     public function setIncludePurchaseId($includeId)
142     {
143         return $this->setField('includePurchaseId', $includeId ? 'true' : 'false');
144     }
145 
146     /**
147      * Sets a customer query ID to be run.
148      *
149      * This is only for use when fetching reports of type REPORT_CUSTOM. Some
150      * defaults are specified in the QUERY_ constants above.
151      *
152      * @param int $queryId
153      * @return self The current class instance for chaining
154      */
155     public function setCustomQueryId($queryId)
156     {
157         return $this->setField('queryId', $queryId);
158     }
159 
160 }
161 
API documentation generated by ApiGen