Subversion Repositories SmartDukaan

Rev

Rev 2534 | Rev 3126 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2534 Rev 2577
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
-
 
3
import java.util.List;
-
 
4
 
3
import org.apache.log4j.Logger;
5
import org.apache.log4j.Logger;
4
import org.apache.struts2.convention.annotation.InterceptorRef;
6
import org.apache.struts2.convention.annotation.InterceptorRef;
5
import org.apache.struts2.convention.annotation.InterceptorRefs;
7
import org.apache.struts2.convention.annotation.InterceptorRefs;
6
import org.apache.struts2.convention.annotation.Result;
8
import org.apache.struts2.convention.annotation.Result;
7
import org.apache.struts2.convention.annotation.Results;
9
import org.apache.struts2.convention.annotation.Results;
Line 49... Line 51...
49
		}
51
		}
50
	}
52
	}
51
	
53
	
52
	private String id;
54
	private String id;
53
	
55
	
54
	private String paymentOption;
56
	private String paymentOption = null;
55
	
57
	
56
	private StringBuilder description;
58
	private StringBuilder description;
57
	
59
	
58
	private double amount;
60
	private double amount;
59
	
61
	
Line 152... Line 154...
152
		return amount;
154
		return amount;
153
	}
155
	}
154
 
156
 
155
	public void setPaymentOption(Payment payment) {
157
	public void setPaymentOption(Payment payment) {
156
		this.paymentOption = null;
158
		this.paymentOption = null;
157
		for(Attribute attr : payment.getAttributes()){
159
		List<Attribute> attributes = payment.getAttributes();
-
 
160
		if(attributes == null)
-
 
161
			return;
-
 
162
		for(Attribute attr : attributes){
158
			if(attr.getName().equals(IPaymentService.PAYMENT_METHOD))
163
			if(attr.getName().equals(IPaymentService.PAYMENT_METHOD))
159
				this.paymentOption = attr.getValue();
164
				this.paymentOption = attr.getValue();
160
		}
165
		}
161
	}
166
	}
162
	
167