Commit f13ef990 authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174286 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9171a5ea
......@@ -80,7 +80,7 @@ export class EcmCheckoutComponent implements OnInit ,DoCheck {
this.store.select('Address').subscribe( addressList => {
console.log( 'loadUser addressList >> ', addressList );
this.addressList = addressList;
//this.selectedAddress = addressList[0];
this.selectedAddressOpt = addressList[0];
});
this.store.select('savedCards').subscribe( cardList => {
......@@ -135,33 +135,6 @@ export class EcmCheckoutComponent implements OnInit ,DoCheck {
);
});
}
placeOrder(data)
{
console.log( 'PlaceOrder dat[' + data + ']' );
this.checkoutService.sendData(data, this.userData.TOKEN_ID).subscribe(
result => {
if(result.Response.status == 'Unauthorized')
{
this.unAuthorized=true;
}
else
{
this.unAuthorized=false;
alert('Form sumited');
//this.store.dispatch(this.cartActions.resetCart());
this._location.back();
}
console.log( 'comp results[' + result.Response.results + ']status[' + result.Response.status + ']' );
console.log( 'comp result.results.indexOf [' + result.Response.results.indexOf('{') + ']' );
},
error => {
let errorMessage = <any>error;
console.log( 'comp errorMessage[' + errorMessage + ']' );
}
);
}
executePayment() {
let paymentInfo;
......@@ -193,6 +166,36 @@ export class EcmCheckoutComponent implements OnInit ,DoCheck {
let order = { "token_id": this.userData.TOKEN_ID, "billAddress": this.selectedAddress, "orderedItems":this.cartItems, "paymentInfo": paymentInfo};
console.log('-----order-----',order);
this.placeOrder(order);
}
placeOrder(data)
{
console.log( 'PlaceOrder dat[' + data + ']' );
this.checkoutService.sendData(data, this.userData.TOKEN_ID).subscribe(
result => {
if(result.Response.status == 'Unauthorized')
{
this.unAuthorized=true;
}
else
{
this.unAuthorized=false;
alert('Form sumited');
//this.store.dispatch(this.cartActions.resetCart());
this._location.back();
}
console.log( 'comp results[' + result.Response.results + ']status[' + result.Response.status + ']' );
console.log( 'comp result.results.indexOf [' + result.Response.results.indexOf('{') + ']' );
},
error => {
let errorMessage = <any>error;
console.log( 'comp errorMessage[' + errorMessage + ']' );
}
);
}
saveAddress(){
......@@ -206,12 +209,16 @@ export class EcmCheckoutComponent implements OnInit ,DoCheck {
selectAddress(address){
this.selectedAddress = address;
setTimeout(() => {
this.stepper.next();
}, 500);
}
confirmOrder(){
this.orderReviewed = true;
setTimeout(() => {
this.stepper.next();
}, 500);
}
increment(item : ItemDetail) {
......
......@@ -63,13 +63,12 @@ export class UserReviewService {
}
getUserReview( itemCode ) {
this.userActionUrl = this.userActionUrl + '/'+ itemCode;
console.log( "URL: " + this.hostUrlService.hostUrl+this.userActionUrl );
let headers = new Headers( { 'Content-Type': 'application/json' });
let options = new RequestOptions( { headers: headers });
return this.http.get( this.hostUrlService.hostUrl+this.userActionUrl, options )
return this.http.get( this.hostUrlService.hostUrl+this.userActionUrl + '/'+ itemCode, options )
.map( this.extractData )
.catch( this.handleError );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment