03.12.2015 Views

laravel4cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

E-Commerce 272<br />

124 <br />

125 <br />

126 <br />

127 <br />

128 <br />

129 <br />

.<br />

This was extracted from app/views/index.blade.php.<br />

We’re using those ng-class directives to hide/show various table rows (in our basket). This lets us<br />

toggle the fields that users need to complete; and provides us with different buttons to dispatch the<br />

different methods in our basket controller.<br />

.<br />

You can learn more about AngularJS at: http://angularjs.org.<br />

Finally; we need to tie this into our OrderController, where the orders are completed and the<br />

payments are processed…<br />

Accepting Payments<br />

We’re going to create a service provider to handle the payment side of things, and while we could<br />

go into great detail about how to do this; we don’t have the time. Read Taylor’s book, or mime, or<br />

the docs.<br />

Creating Orders<br />

Before we start hitting Stripe up; we should create the endpoint for creating orders:

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

Saved successfully!

Ooh no, something went wrong!