|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.mb.PaymentGateway
public class PaymentGateway
A payment gateway is a transaction broker for payments. E.G. Res Interactive/Tootsville is using Authorize.Net. Alternative providers might include other credit-card or cheque processing companies, or other electronic transfer means such as Paypal or micro-currency systems used in other online gaming sites/communities. Gift card transactions are also processed through a special payment gateway.
Field Summary | |
---|---|
private String |
code
WRITEME |
private PaymentGatewayReal |
implementation
WRITEME |
private String |
implementor
The class implementing the actual functionality, e.g. |
private String |
managementURL
WRITEME |
private static long |
serialVersionUID
|
private String |
title
WRITEME |
private AbstractPerson |
user
WRITEME |
Constructor Summary | |
---|---|
PaymentGateway()
WRITEME |
Method Summary | |
---|---|
void |
alterEnrolment(Payment payment,
UserEnrolment newForm)
|
void |
endEnrolment(Payment payment)
|
List<CredentialType> |
enumerateCredentialTypes()
Provides a list of all credential types supported by the given payment gateway. |
void |
flush()
This is an overriding method. |
static PaymentGateway |
get(org.json.JSONObject object)
|
static Class<? extends PaymentGatewayReal> |
get(String id)
|
static PaymentGatewayReal |
getByClass(Class<? extends PaymentGatewayReal> klass)
|
protected String |
getCacheUniqueID()
This is an overriding method. |
String |
getCode()
|
private PaymentGatewayReal |
getImplementation()
|
String |
getImplementor()
|
String |
getManagementURL()
|
Payment |
getPayment(BigDecimal bigDecimal)
This is an overriding method. |
String |
getTitle()
|
AbstractPerson |
getUser()
Get the user account associated with the payment gateway. |
boolean |
isAvailable()
|
void |
set(org.json.JSONObject o)
|
protected void |
set(ResultSet rs)
This is an overriding method. |
void |
setCode(String newCode)
|
void |
setImplementor(String implementor1)
|
void |
setManagementURL(String newManagementURL)
|
void |
setTitle(String newTitle)
|
void |
setUser(AbstractPerson newUser)
|
void |
setUser(Parent byID)
|
void |
startEnrolment(Payment payment)
|
void |
startTransaction(Payment payment)
|
org.json.JSONObject |
toJSON()
This is an overriding method. |
void |
transactPayment(Payment p)
|
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, compareTo, findInCache, get, saveInCache |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private String code
private PaymentGatewayReal implementation
private String implementor
private String managementURL
private String title
private AbstractPerson user
Constructor Detail |
---|
public PaymentGateway()
Method Detail |
---|
public static PaymentGateway get(org.json.JSONObject object) throws RuntimeException, NotFoundException, org.json.JSONException
object
- The JSON object containing the description of the
gateway we want ot get
org.json.JSONException
- if the JSON object is busted
NotFoundException
- if the payment gateway can't be found
RuntimeException
- if, I dunno, something bad happens?
(TODO: what??)public static Class<? extends PaymentGatewayReal> get(String id) throws NotFoundException
id
- The 4-char authorization code for the payment gateway.
(Used as the order_source part of the order ID), in
lower-case letters.
NotFoundException
- if the payment gateway type does not
exist or is unimplemented.public static PaymentGatewayReal getByClass(Class<? extends PaymentGatewayReal> klass)
klass
- A class implementing PaymentGatewayReal
public void alterEnrolment(Payment payment, UserEnrolment newForm) throws UnsupportedCurrencyException, NotFoundException, UnsupportedCredentialException, IOException, RetryPaymentException, GameLogicException
alterEnrolment
in interface PaymentGatewayReal
payment
- WRITEMEnewForm
- WRITEME
UnsupportedCurrencyException
- WRITEME
NotFoundException
- WRITEME
UnsupportedCredentialException
- WRITEME
IOException
- WRITEME
RetryPaymentException
- WRITEME
GameLogicException
- WRITEMEPaymentGatewayReal.alterEnrolment(org.starhope.appius.mb.Payment,
org.starhope.appius.mb.UserEnrolment)
public void endEnrolment(Payment payment) throws UnsupportedCurrencyException, NotFoundException, UnsupportedCredentialException, IOException, RetryPaymentException, GameLogicException
endEnrolment
in interface PaymentGatewayReal
payment
- WRITEME
UnsupportedCurrencyException
- WRITEME
NotFoundException
- WRITEME
UnsupportedCredentialException
- WRITEME
IOException
- WRITEME
RetryPaymentException
- WRITEME
GameLogicException
- WRITEMEPaymentGatewayReal.endEnrolment(org.starhope.appius.mb.Payment)
public List<CredentialType> enumerateCredentialTypes()
PaymentGatewayReal
enumerateCredentialTypes
in interface PaymentGatewayReal
CredentialType
:sPaymentGatewayReal.enumerateCredentialTypes()
public void flush()
flush
in class SQLPeerDatum
SQLPeerDatum.flush()
protected String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerDatum
SQLPeerDatum.getCacheUniqueID()
public String getCode()
private PaymentGatewayReal getImplementation() throws Exception
Exception
- of many kinds, because this is funky mojopublic String getImplementor()
public String getManagementURL()
public Payment getPayment(BigDecimal bigDecimal)
getPayment
in interface PaymentGatewayReal
bigDecimal
- The identifier used by the implementing payment
gateway to uniquely identify the transaction in question.
PaymentGatewayReal.getPayment(java.math.BigDecimal)
public String getTitle()
public AbstractPerson getUser()
public boolean isAvailable()
isAvailable
in interface PaymentGatewayReal
PaymentGatewayReal.isAvailable()
public void set(org.json.JSONObject o)
set
in class SQLPeerDatum
o
- The JSON data to be used to set the value of this
objectorg.starhope.appius.util.CastsToJSON#set(org.json.JSONObject)
protected void set(ResultSet rs) throws SQLException
set
in class SQLPeerDatum
rs
- The result of an SQL query, with the cursor already
pointed at the row describing this specific instance of
the object.
SQLException
- if the database fails somehowSQLPeerDatum.set(java.sql.ResultSet)
public void setCode(String newCode)
newCode
- The new code for this payment gatewaypublic void setImplementor(String implementor1)
implementor1
- Set the actual Payment Gateway implementation
to be used (String)public void setManagementURL(String newManagementURL)
newManagementURL
- the management URL for accessing this
payment gateway's settings (outside of our systems)public void setTitle(String newTitle)
newTitle
- the (user-visible) titlepublic void setUser(AbstractPerson newUser)
newUser
- the user accountpublic void setUser(Parent byID)
byID
- WRITEMEpublic void startEnrolment(Payment payment) throws UnsupportedCurrencyException, NotFoundException, UnsupportedCredentialException, IOException, RetryPaymentException, GameLogicException, AlreadyUsedException
startEnrolment
in interface PaymentGatewayReal
payment
- WRITEME
AlreadyUsedException
- WRITEME
UnsupportedCurrencyException
- WRITEME
NotFoundException
- WRITEME
UnsupportedCredentialException
- WRITEME
IOException
- WRITEME
RetryPaymentException
- WRITEME
GameLogicException
- WRITEMEPaymentGatewayReal.startEnrolment(org.starhope.appius.mb.Payment)
public void startTransaction(Payment payment) throws UnsupportedCurrencyException, NotFoundException, UnsupportedCredentialException, IOException, RetryPaymentException, GameLogicException, AlreadyUsedException, DataException
startTransaction
in interface PaymentGatewayReal
payment
- WRITEME
DataException
- WRITEME
UnsupportedCurrencyException
- WRITEME
NotFoundException
- WRITEME
UnsupportedCredentialException
- WRITEME
IOException
- WRITEME
RetryPaymentException
- WRITEME
GameLogicException
- WRITEME
AlreadyUsedException
- WRITEMEPaymentGatewayReal.startTransaction(org.starhope.appius.mb.Payment)
public org.json.JSONObject toJSON()
toJSON
in class SQLPeerDatum
SQLPeerDatum.toJSON()
public void transactPayment(Payment p) throws UnsupportedCurrencyException, NotFoundException, UnsupportedCredentialException, IOException, RetryPaymentException, GameLogicException, AlreadyUsedException, DataException
transactPayment
in interface PaymentGatewayReal
p
- WRITEME
DataException
- WRITEME
AlreadyUsedException
- WRITEME
GameLogicException
- WRITEME
UnsupportedCurrencyException
- WRITEME
NotFoundException
- WRITEME
UnsupportedCredentialException
- WRITEME
IOException
- WRITEME
RetryPaymentException
- WRITEMEPaymentGatewayReal.transactPayment(Payment)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |