public class DefaultPaymentOptionsStrategy<O extends Order> extends Object implements PaymentOptionsStrategy<O>
PaymentOptionsStrategy
; by default only online payment is availableModifier and Type | Field and Description |
---|---|
protected LogisticsService |
logisticsService
If we wish to supply multiple payment Options then supply a
LogisticsService If null; only PaymentMethod.ONLINE_SERVICE_PROVIDER will be available. |
Constructor and Description |
---|
DefaultPaymentOptionsStrategy() |
Modifier and Type | Method and Description |
---|---|
protected Area |
getArea(O order) |
protected String |
getAreaCode(O order)
get Area Code for the Order; looks in the following order:
Order user contact Details - Shipping Address
User Object - Shipping Address
|
String |
getAreaType()
When looking up details for an Area what type of Area code to consider
|
PaymentOption |
getDefaultPaymentOption(O o)
Get default
PaymentOption |
LogisticsService |
getLogisticsService()
If we wish to supply multiple payment Options then supply a
LogisticsService If null; only PaymentMethod.ONLINE_SERVICE_PROVIDER will be available. |
List<PaymentMethod> |
getPaymentMethods(O order)
Get a List of possible
PaymentMethod s for the Order of a user |
List<PaymentOption> |
getPaymentOptions(O o)
Get a List of possible
PaymentOption s for the Order of a user |
String |
getVersion()
Strategies change; it may be important/required in most applications to know a result based on which version of a particular strategy.
|
void |
setAreaType(String areaType)
When looking up details for an Area what type of Area code to consider
|
void |
setLogisticsService(LogisticsService logisticsService)
If we wish to supply multiple payment Options then supply a
LogisticsService If null; only PaymentMethod.ONLINE_SERVICE_PROVIDER will be available. |
protected LogisticsService logisticsService
LogisticsService
PaymentMethod.ONLINE_SERVICE_PROVIDER
will be available.protected String getAreaCode(O order)
order
- public List<PaymentMethod> getPaymentMethods(O order)
PaymentOptionsStrategy
PaymentMethod
s for the Order of a usergetPaymentMethods
in interface PaymentOptionsStrategy<O extends Order>
order
- as OrderPaymentMethod
existspublic LogisticsService getLogisticsService()
LogisticsService
PaymentMethod.ONLINE_SERVICE_PROVIDER
will be available.public void setLogisticsService(LogisticsService logisticsService)
LogisticsService
PaymentMethod.ONLINE_SERVICE_PROVIDER
will be available.public String getAreaType()
Area.TYPE_AREACODE
public void setAreaType(String areaType)
Area.TYPE_AREACODE
public String getVersion()
getVersion
in interface Strategy
public List<PaymentOption> getPaymentOptions(O o) throws Exception
PaymentOptionsStrategy
PaymentOption
s for the Order of a usergetPaymentOptions
in interface PaymentOptionsStrategy<O extends Order>
o
- as OrderPaymentMethod
existsException
public PaymentOption getDefaultPaymentOption(O o) throws Exception
PaymentOptionsStrategy
PaymentOption
getDefaultPaymentOption
in interface PaymentOptionsStrategy<O extends Order>
o
- as OrderPaymentMethod
existsException
Copyright © 2018. All rights reserved.