03.12.2015 Views

laravel4cookbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

E-Commerce 268<br />

11 this.email = "";<br />

12 this.password = "";<br />

13 this.number = "";<br />

14 this.expiry = "";<br />

15 this.secutiry = "";<br />

16<br />

17 this.authenticate = function() {<br />

18<br />

19 var details = AccountService.authenticate(self.email, self.password);<br />

20<br />

21 details.success(function(data) {<br />

22 if (data.status == "ok") {<br />

23 self.state = "paying";<br />

24 }<br />

25 });<br />

26<br />

27 }<br />

28<br />

29 this.pay = function() {<br />

30<br />

31 var details = OrderService.pay(<br />

32 self.number,<br />

33 self.expiry,<br />

34 self.security<br />

35 );<br />

36<br />

37 details.success(function(data) {<br />

38 BasketService.clear();<br />

39 self.state = "shopping";<br />

40 });<br />

41<br />

42 }<br />

43<br />

44 // ...<br />

45<br />

46 });<br />

.<br />

This was extracted from public/js/shared.js.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!