Subversion Repositories SmartDukaan

Rev

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

Rev 6960 Rev 6985
Line 79... Line 79...
79
    private List<Address>        addresses;
79
    private List<Address>        addresses;
80
    private Set<OrderStatus>     setOfcancellableStates;
80
    private Set<OrderStatus>     setOfcancellableStates;
81
    private String               cancellationInitiator;
81
    private String               cancellationInitiator;
82
    private String               cancelReason;
82
    private String               cancelReason;
83
    private String               body;
83
    private String               body;
-
 
84
    private String               line1;
-
 
85
    private String               line2;
-
 
86
    private String               city;
-
 
87
    private String               state;
-
 
88
    private String               pin;
84
 
89
 
85
    public UserOrderInfoController() {
90
    public UserOrderInfoController() {
86
        super();
91
        super();
87
        setOfcancellableStates = new HashSet<OrderStatus>();
92
        setOfcancellableStates = new HashSet<OrderStatus>();
88
        setOfcancellableStates.add(OrderStatus.SUBMITTED_FOR_PROCESSING);
93
        setOfcancellableStates.add(OrderStatus.SUBMITTED_FOR_PROCESSING);
Line 363... Line 368...
363
    }
368
    }
364
 
369
 
365
    public String getAddress(Order order) {
370
    public String getAddress(Order order) {
366
        return ModelUtils.extractAddressFromOrder(order);
371
        return ModelUtils.extractAddressFromOrder(order);
367
    }
372
    }
-
 
373
    
-
 
374
    public String changeShippingAddress() {
-
 
375
        try {
-
 
376
            TransactionClient transactionServiceClient = new TransactionClient();
-
 
377
            transactionServiceClient.getClient().changeShippingAddress(orderId, line1, line2, city, state, pin);
-
 
378
        } catch(Exception e) {
-
 
379
            log.error("Unable to update address for orderId : " + orderId + "and address : " + 
-
 
380
                    line1 + ", " + line2+ ", " + city + ", " + state + ", " + pin, e);
-
 
381
        }
-
 
382
        return null;
-
 
383
    }
-
 
384
    
-
 
385
    public Address getShippingAddress(Order order) {
-
 
386
        Address address = new Address();
-
 
387
        address.setLine1(order.getCustomer_address1());
-
 
388
        address.setLine2(order.getCustomer_address2());
-
 
389
        address.setCity(order.getCustomer_city());
-
 
390
        address.setState(order.getCustomer_state());
-
 
391
        address.setPin(order.getCustomer_pincode());
-
 
392
        return address;
-
 
393
    }
368
 
394
 
369
    public String getPaymentMethod(List<Attribute> paymentAttributes) {
395
    public String getPaymentMethod(List<Attribute> paymentAttributes) {
370
        String paymentMethod = null;
396
        String paymentMethod = null;
371
        if (paymentAttributes == null || paymentAttributes.isEmpty()) {
397
        if (paymentAttributes == null || paymentAttributes.isEmpty()) {
372
            return "N/A";
398
            return "N/A";
Line 455... Line 481...
455
    }
481
    }
456
 
482
 
457
    public void setBody(String body) {
483
    public void setBody(String body) {
458
        this.body = body;
484
        this.body = body;
459
    }
485
    }
-
 
486
 
-
 
487
    public String getLine1() {
-
 
488
        return line1;
-
 
489
    }
-
 
490
 
-
 
491
    public void setLine1(String line1) {
-
 
492
        this.line1 = line1;
-
 
493
    }
-
 
494
 
-
 
495
    public String getLine2() {
-
 
496
        return line2;
-
 
497
    }
-
 
498
 
-
 
499
    public void setLine2(String line2) {
-
 
500
        this.line2 = line2;
-
 
501
    }
-
 
502
 
-
 
503
    public String getCity() {
-
 
504
        return city;
-
 
505
    }
-
 
506
 
-
 
507
    public void setCity(String city) {
-
 
508
        this.city = city;
-
 
509
    }
-
 
510
 
-
 
511
    public String getState() {
-
 
512
        return state;
-
 
513
    }
-
 
514
 
-
 
515
    public void setState(String state) {
-
 
516
        this.state = state;
-
 
517
    }
-
 
518
 
-
 
519
    public String getPin() {
-
 
520
        return pin;
-
 
521
    }
-
 
522
 
-
 
523
    public void setPin(String pin) {
-
 
524
        this.pin = pin;
-
 
525
    }
460
}
526
}
461
527