|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.ManagedReferenceHolder
org.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
|
private PaymentGatewayReal |
implementation
|
private String |
implementor
The class implementing the actual functionality, e.g. |
private String |
managementURL
|
private static long |
serialVersionUID
|
private String |
title
|
private Person |
user
|
Constructor Summary | |
---|---|
PaymentGateway()
|
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()
|
Person |
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 implementor)
|
void |
setManagementURL(String newManagementURL)
|
void |
setTitle(String newTitle)
|
void |
setUser(Parent byID)
|
void |
setUser(Person newUser)
|
void |
startEnrolment(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, findInCache, get, prepare, prepare, saveInCache |
Methods inherited from class org.starhope.appius.util.ManagedReferenceHolder |
---|
deref, setRef |
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 Person 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
IllegalAccessException
- if the class specified is
protected from this one
InstantiationException
- if the class couldn't be
constructed for some reasonpublic void alterEnrolment(Payment payment, UserEnrolment newForm) throws UnsupportedCurrencyException, NotFoundException, UnsupportedCredentialException, IOException, RetryPaymentException, GameLogicException
alterEnrolment
in interface PaymentGatewayReal
UnsupportedCurrencyException
NotFoundException
UnsupportedCredentialException
IOException
RetryPaymentException
GameLogicException
PaymentGatewayReal.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
UnsupportedCurrencyException
NotFoundException
UnsupportedCredentialException
IOException
RetryPaymentException
GameLogicException
PaymentGatewayReal.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 Person getUser()
public boolean isAvailable()
isAvailable
in interface PaymentGatewayReal
PaymentGatewayReal.isAvailable()
public void set(org.json.JSONObject o)
set
in class SQLPeerDatum
CastsToJSON.set(org.json.JSONObject)
protected void set(ResultSet rs) throws SQLException
set
in class SQLPeerDatum
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 implementor)
implementor
- 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(Parent byID)
byID
- org.starhope.appius.pay.util.PaymentGatewayReal#setUser(org.starhope.appius.user.Parent)
public void setUser(Person newUser)
newUser
- the user accountpublic void startEnrolment(Payment payment) throws UnsupportedCurrencyException, NotFoundException, UnsupportedCredentialException, IOException, RetryPaymentException, GameLogicException
startEnrolment
in interface PaymentGatewayReal
UnsupportedCurrencyException
NotFoundException
UnsupportedCredentialException
IOException
RetryPaymentException
GameLogicException
PaymentGatewayReal.startEnrolment(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
transactPayment
in interface PaymentGatewayReal
UnsupportedCurrencyException
NotFoundException
UnsupportedCredentialException
IOException
RetryPaymentException
PaymentGatewayReal.transactPayment(Payment)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |