|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.authorize.admc.authnet.AimTransaction
public class AimTransaction
Authorize.net client. N.b. It would be very easy for a scoundrel to modify this class to steal or use your credit card information. Therefore, only use a copy of this class from a source which you trust, and verify the checksums! N.b. the difference between "transaction key", my password; and "transaction ID", the identifier for a transaction. It seems that Authorize.net is trying to force AIM users into the hands of their own partners by no longer providing easy public access to the AIM API's, like they used to do. You can see the sample code at http://developer.authorize.net/samplecode/ but they leave a lot of questions unanswered, and the code is non-scalable and non-Object Oriented.
Nested Class Summary | |
---|---|
static interface |
AimTransaction.Persistor
An implementation of this interface may be passed to the postPurchase method to perform any custom post-purchase processing. |
Field Summary | |
---|---|
java.lang.String[] |
data
WRITEME |
static java.lang.String |
LS
TODO: document this field (brpocock, Oct 13, 2009) LS (AimTransaction) |
Method Summary | |
---|---|
void |
checkMd5Hash()
|
java.math.BigDecimal |
getAmount()
TODO: document this method (brpocock, Sep 23, 2009) |
java.lang.String |
getApproval()
TODO: document this method (brpocock, Sep 23, 2009) |
char |
getAVS()
TODO: document this method (brpocock, Sep 23, 2009) |
int |
getRcode()
TODO: document this method (brpocock, Sep 23, 2009) |
int |
getRRcode()
TODO: document this method (brpocock, Sep 23, 2009) |
java.lang.String |
getRRtext()
TODO: document this method (brpocock, Sep 23, 2009) |
boolean |
getTestMode()
TODO: document this method (brpocock, Sep 23, 2009) |
java.math.BigDecimal |
getTransId()
TODO: document this method (brpocock, Sep 23, 2009) |
java.lang.String |
getTransType()
TODO: document this method (brpocock, Sep 23, 2009) |
boolean |
isTestMode()
TODO: document this method (brpocock, Sep 23, 2009) |
void |
postPurchase()
Perform post-purchase validation. |
void |
postPurchase(AimTransaction.Persistor persistor)
Purchase-specific post-processing. |
void |
setAmount(java.math.BigDecimal inInt)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setAmount(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setAuthCode(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillAddress(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillCity(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillCountry(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillFax(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillFirstName(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillLastName(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillOrg(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillPhone(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillStateName(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setBillZip(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setCardCode(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setCardNum(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setCustId(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setDescription(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setEmail(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setExp(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setInvoiceNum(int i)
Convenience data type conversion |
void |
setInvoiceNum(java.lang.String inString)
Misnomer taken from the AIM documentation. |
void |
setPhone(java.lang.String phone1)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setShipAddress(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setShipCity(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setShipCountry(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setShipFirstName(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setShipLastName(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setShipOrg(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setShipStateName(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setShipZip(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setTestMode(boolean is_this_a_test_request_QQ)
Set the test mode for this one transaction. |
void |
setTransId(int inInt)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
setType(java.lang.String inString)
TODO: document this method (brpocock, Oct 13, 2009) |
void |
submit()
TODO: document this method (brpocock, Oct 13, 2009) |
static java.lang.String |
toHex(byte[] byteArray)
Run with no parameters to see syntax, like: |
java.lang.String |
toString()
Dumps entire response data array, except for empty elements, which are skipped. |
static java.lang.String |
truncateIfLonger(java.lang.String inString,
int maxLen)
Public utility method. |
void |
validateInput(java.lang.String vehicle)
Verify that input data is good to submit a payment request. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LS
public java.lang.String[] data
Method Detail |
---|
public static java.lang.String toHex(byte[] byteArray)
java com.admc.authnet.AimTransactionN.b. THIS IS FOR NON-SECURE TESTING! Make sure your computer (and your nework connection to it, if any) is secure before running this method, because the command-line parameters you give to this command can be observerd by others.
byteArray
- WRITEME
public static java.lang.String truncateIfLonger(java.lang.String inString, int maxLen)
inString
- WRITEMEmaxLen
- WRITEME
public void checkMd5Hash() throws AuthNetException
AuthNetException
- if received hash does not match
calculated hash.public java.math.BigDecimal getAmount()
public java.lang.String getApproval()
public char getAVS()
public int getRcode()
public int getRRcode()
public java.lang.String getRRtext()
public boolean getTestMode()
public java.math.BigDecimal getTransId()
public java.lang.String getTransType()
public boolean isTestMode()
public void postPurchase() throws AuthNetException
Perform post-purchase validation.
User should call either postPurchase(Persistor) or postPurchase() after submitting a purchase transaction.
AuthNetException
- Your postPurchase call should handle
these.public void postPurchase(AimTransaction.Persistor persistor) throws java.sql.SQLException, AuthNetException
User should call either postPurchase(Persistor) or postPurchase() after submitting a purchase transaction.
Does purchase-specific post-validation, and invokes the user-specified persist method.
persistor
- WRITEME
AuthNetException
- It is very important that these critical
exceptions be handled appropriately, because the customer
has been charged but you may not have a record of it. You
just need to set up a SMTP Appender or write these to a
critical log file so you know to check the details with
the Authorize.net console.
java.sql.SQLException
- If you did not pass a Persistor which can
throw a SQLException, then just catch SQLException and
rethrow a RuntimeException, because you won't get it
unless your app is messed up. If you may throw
SQLException, same comment as for AuthNetException
applies.public void setAmount(java.math.BigDecimal inInt)
inInt
- WRITEMEpublic void setAmount(java.lang.String inString)
inString
- WRITEMEpublic void setAuthCode(java.lang.String inString)
inString
- WRITEMEpublic void setBillAddress(java.lang.String inString)
inString
- WRITEMEpublic void setBillCity(java.lang.String inString)
inString
- WRITEMEpublic void setBillCountry(java.lang.String inString)
inString
- WRITEMEpublic void setBillFax(java.lang.String inString)
inString
- WRITEMEpublic void setBillFirstName(java.lang.String inString)
inString
- WRITEMEpublic void setBillLastName(java.lang.String inString)
inString
- WRITEMEpublic void setBillOrg(java.lang.String inString)
inString
- WRITEMEpublic void setBillPhone(java.lang.String inString)
inString
- WRITEMEpublic void setBillStateName(java.lang.String inString)
inString
- WRITEMEpublic void setBillZip(java.lang.String inString)
inString
- WRITEMEpublic void setCardCode(java.lang.String inString)
inString
- WRITEMEpublic void setCardNum(java.lang.String inString)
inString
- WRITEMEpublic void setCustId(java.lang.String inString)
inString
- WRITEMEpublic void setDescription(java.lang.String inString)
inString
- WRITEMEpublic void setEmail(java.lang.String inString)
inString
- WRITEMEpublic void setExp(java.lang.String inString)
inString
- WRITEMEpublic void setInvoiceNum(int i)
i
- WRITEMEpublic void setInvoiceNum(java.lang.String inString)
inString
- WRITEMEpublic void setPhone(java.lang.String phone1)
phone1
- WRITEMEpublic void setShipAddress(java.lang.String inString)
inString
- WRITEMEpublic void setShipCity(java.lang.String inString)
inString
- WRITEMEpublic void setShipCountry(java.lang.String inString)
inString
- WRITEMEpublic void setShipFirstName(java.lang.String inString)
inString
- WRITEMEpublic void setShipLastName(java.lang.String inString)
inString
- WRITEMEpublic void setShipOrg(java.lang.String inString)
inString
- WRITEMEpublic void setShipStateName(java.lang.String inString)
inString
- WRITEMEpublic void setShipZip(java.lang.String inString)
inString
- WRITEMEpublic void setTestMode(boolean is_this_a_test_request_QQ)
is_this_a_test_request_QQ
- WRITEMEpublic void setTransId(int inInt)
inInt
- WRITEMEpublic void setType(java.lang.String inString)
inString
- WRITEMEpublic void submit() throws java.io.IOException
java.io.IOException
- WRITEMEpublic java.lang.String toString()
toString
in class java.lang.Object
public void validateInput(java.lang.String vehicle) throws AuthNetException
vehicle
- WRITEME
AuthNetException
- WRITEME
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |