Created
May 19, 2016 14:40
-
-
Save obedmhg/05faaaeb19529271ae8b8bcc41f745a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycompany.commerce.order; | |
import atg.commerce.order.OrderImpl; | |
import atg.commerce.order.CreditCard; | |
import atg.commerce.order.GiftCertificate; | |
import com.sparkred.paypal.PayPalPaymentGroup; | |
public class MyCompanyOrderImpl extends OrderImpl { | |
/** serialVersionUID. */ | |
private static final long serialVersionUID = -5384547034115301944L; | |
public String getPaymentType() { | |
String paymentType = null; | |
for (Object pgObject : getPaymentGroups()) { | |
if(pgObject instanceof CreditCard) { | |
CreditCard cc = (CreditCard)pgObject; | |
paymentType = cc.getCreditCardType(); | |
break; | |
} else if(pgObject instanceof PayPalPaymentGroup) { | |
paymentType = "paypal"; | |
break; | |
} else if(pgObject instanceof GiftCertificate) { | |
paymentType = "giftCard"; | |
} | |
} | |
return paymentType; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beanNameToItemDescriptorMap-=\ | |
atg.commerce.order.OrderImpl=order | |
beanNameToItemDescriptorMap+=\ | |
com.mycompany.commerce.order.MyCompanyOrderImpl=order | |
orderTypeClassMap+=\ | |
shoppingcart=com.mycompany.commerce.order.MyCompanyOrderImpl,\ | |
default=com.mycompany.commerce.order.MyCompanyOrderImpl | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment