KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > util > CreditCardProcessorResponse


1 package com.dotmarketing.util;
2
3 import org.apache.commons.lang.builder.ToStringBuilder;
4
5 public class CreditCardProcessorResponse {
6     private String JavaDoc avs;
7
8     private String JavaDoc ordernum;
9
10     private String JavaDoc error;
11
12     private String JavaDoc approved;
13
14     private String JavaDoc code;
15
16     private String JavaDoc message;
17
18     private String JavaDoc time;
19
20     private String JavaDoc ref;
21
22     private String JavaDoc tdate;
23
24     private String JavaDoc score;
25
26     public boolean orderApproved() {
27         return approved.trim().toUpperCase().equals("APPROVED");
28     }
29
30     public CreditCardProcessorResponse(String JavaDoc approved, String JavaDoc avs,
31             String JavaDoc code, String JavaDoc error, String JavaDoc message, String JavaDoc ordernum,
32             String JavaDoc ref, String JavaDoc score, String JavaDoc tdate, String JavaDoc time) {
33         super();
34         this.approved = approved;
35         this.avs = avs;
36         this.code = code;
37         this.error = error;
38         this.message = message;
39         this.ordernum = ordernum;
40         this.ref = ref;
41         this.score = score;
42         this.tdate = tdate;
43         this.time = time;
44     }
45
46     /**
47      * Returns the approval status string
48      *
49      * @return Posible values APPROVED, DECLINED, or FRAUD
50      */

51     public String JavaDoc getApproved() {
52         return approved;
53     }
54
55     /*
56      * The Address Verification System (AVS) response for this transaction. The
57      * first character indicates whether the contents of the addrnum tag match
58      * the address number on file for the billing address. The second character
59      * indicates whether the billing zip code matches the billing records. The
60      * third character is the raw AVS response from the card-issuing bank. The
61      * last character indicates whether the cvmvalue was correct and may be “M”
62      * for Match, “N” for No Match, or “Z” if the match could not determined.
63      */

64     public String JavaDoc getAvs() {
65         return avs;
66     }
67
68     /**
69      *
70      * @return The approval code for this transaction.
71      */

72     public String JavaDoc getCode() {
73         return code;
74     }
75
76     /**
77      *
78      * @return Any error message associated with this transaction.
79      */

80     public String JavaDoc getError() {
81         return error;
82     }
83
84     /**
85      *
86      * @return Any message returned by the processor; e.g., “CALL VOICE CENTER”.
87      */

88     public String JavaDoc getMessage() {
89         return message;
90     }
91
92     /**
93      *
94      * @return The order number associated with this transaction.
95      */

96     public String JavaDoc getOrdernum() {
97         return ordernum;
98     }
99
100     /**
101      *
102      * @return The reference number returned by the credit card processor.
103      */

104     public String JavaDoc getRef() {
105         return ref;
106     }
107
108     /**
109      *
110      * @return A server time-date stamp for this transaction. Used to
111      * uniquely identify a specific transaction where one order
112      * number may apply to several individual transactions. See
113      * the Transaction Details Data Fields section for further
114      * information and an example of tdate.
115      */

116     public String JavaDoc getTdate() {
117         return tdate;
118     }
119
120     /**
121      *
122      * @return The time and date of the transaction server response.
123      */

124     public String JavaDoc getTime() {
125         return time;
126     }
127
128     /**
129      *
130      * @return If LinkShieldTM is enabled on the account, the LinkShield
131      * fraud risk score will be returned in this field. A value of 0
132      * indicates a low risk of fraud; a value of 99 indicates a high
133      * risk of fraud.
134      */

135     public String JavaDoc getScore() {
136         return score;
137     }
138
139     @Override JavaDoc
140     public String JavaDoc toString() {
141         return ToStringBuilder.reflectionToString(this);
142     }
143
144     
145 }
146
Popular Tags