import { Component, OnInit, Inject } from '@angular/core';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { ContactService } from '../../contact.service';

@Component({
  selector: 'app-billing-info',
  templateUrl: './billing-info.component.html',
  styleUrls: ['./billing-info.component.scss']
})
export class BillingInfoComponent implements OnInit {
  first_name:any;
  last_name:any;
  phone_number:any;
  email_add:any;
  shipping_address:any;
  city:any;
  state:any;
  country:any;
  pin_code:any;
  constructor(public dialogRef: MdDialogRef<BillingInfoComponent>,@Inject(MD_DIALOG_DATA) public data: any,private contactService: ContactService) { }
  errFlag:any;
  ngOnInit() {

  }

  ProceedandBuy(){
    var billingInfoPayload = {
      first_name : this.first_name,
      last_name : this.last_name,
      phone : this.phone_number,
      email:this.email_add,
      shipping_address:this.shipping_address,
      city : this.city,
      state:this.state,
      country:this.country,
      pin_code:this.pin_code,
    
    }
    this.dialogRef.close(JSON.stringify(billingInfoPayload));

  }
  close(){
    this.dialogRef.close('cancel');
  }

}
