@@ -38,16 +38,16 @@ public class PaymentType implements Serializable, BroadleafEnumerationType {
38
38
39
39
private static final Map <String , PaymentType > TYPES = new LinkedHashMap <String , PaymentType >();
40
40
41
- public static final PaymentType GIFT_CARD = new PaymentType ("GIFT_CARD" , "Gift Card" );
42
- public static final PaymentType CREDIT_CARD = new PaymentType ("CREDIT_CARD" , "Credit Card" );
43
- public static final PaymentType BANK_ACCOUNT = new PaymentType ("BANK_ACCOUNT" , "Bank Account" );
44
- public static final PaymentType CHECK = new PaymentType ("CHECK" , "Check" );
45
- public static final PaymentType ELECTRONIC_CHECK = new PaymentType ("ELECTRONIC_CHECK" , "Electronic Check" );
46
- public static final PaymentType WIRE = new PaymentType ("WIRE" , "Wire Transfer" );
47
- public static final PaymentType MONEY_ORDER = new PaymentType ("MONEY_ORDER" , "Money Order" );
48
- public static final PaymentType CUSTOMER_CREDIT = new PaymentType ("CUSTOMER_CREDIT" , "Customer Credit" );
49
- public static final PaymentType COD = new PaymentType ("COD" , "Collect On Delivery" );
50
- public static final PaymentType CUSTOMER_PAYMENT = new PaymentType ("CUSTOMER_PAYMENT" , "Customer Payment" );
41
+ public static final PaymentType GIFT_CARD = new PaymentType ("GIFT_CARD" , "Gift Card" , false );
42
+ public static final PaymentType CREDIT_CARD = new PaymentType ("CREDIT_CARD" , "Credit Card" , true );
43
+ public static final PaymentType BANK_ACCOUNT = new PaymentType ("BANK_ACCOUNT" , "Bank Account" , false );
44
+ public static final PaymentType CHECK = new PaymentType ("CHECK" , "Check" , false );
45
+ public static final PaymentType ELECTRONIC_CHECK = new PaymentType ("ELECTRONIC_CHECK" , "Electronic Check" , false );
46
+ public static final PaymentType WIRE = new PaymentType ("WIRE" , "Wire Transfer" , false );
47
+ public static final PaymentType MONEY_ORDER = new PaymentType ("MONEY_ORDER" , "Money Order" , false );
48
+ public static final PaymentType CUSTOMER_CREDIT = new PaymentType ("CUSTOMER_CREDIT" , "Customer Credit" , false );
49
+ public static final PaymentType COD = new PaymentType ("COD" , "Collect On Delivery" , false );
50
+ public static final PaymentType CUSTOMER_PAYMENT = new PaymentType ("CUSTOMER_PAYMENT" , "Customer Payment" , false );
51
51
/**
52
52
* Intended for modules like PayPal Express Checkout
53
53
*
@@ -58,14 +58,15 @@ public class PaymentType implements Serializable, BroadleafEnumerationType {
58
58
* Note that not all third party gateways support this feature described above.
59
59
* Make sure to the gateway does before assigning this type to your Order Payment.
60
60
*/
61
- public static final PaymentType THIRD_PARTY_ACCOUNT = new PaymentType ("THIRD_PARTY_ACCOUNT" , "3rd-Party Account" );
61
+ public static final PaymentType THIRD_PARTY_ACCOUNT = new PaymentType ("THIRD_PARTY_ACCOUNT" , "3rd-Party Account" , true );
62
62
63
63
public static PaymentType getInstance (final String type ) {
64
64
return TYPES .get (type );
65
65
}
66
66
67
67
private String type ;
68
68
private String friendlyType ;
69
+ private boolean isFinalPayment ;
69
70
70
71
public PaymentType () {
71
72
//do nothing
@@ -74,8 +75,19 @@ public PaymentType() {
74
75
public PaymentType (final String type , final String friendlyType ) {
75
76
this .friendlyType = friendlyType ;
76
77
setType (type );
78
+ this .isFinalPayment = false ;
77
79
}
78
-
80
+
81
+ public PaymentType (final String type , final String friendlyType , final boolean isFinalPayment ) {
82
+ this .friendlyType = friendlyType ;
83
+ this .isFinalPayment = isFinalPayment ;
84
+ setType (type );
85
+ }
86
+
87
+ public boolean getIsFinalPayment () {
88
+ return isFinalPayment ;
89
+ }
90
+
79
91
@ Override
80
92
public String getType () {
81
93
return type ;
0 commit comments