Pulling Data from a Second Source

It’s customary to keep sensitive data like credit card information stored outside our systems, so it’s natural that it wouldn’t be part of the customer records we maintain (and that Shine is allowing users to examine). While we could have our Rails application pull this data when we ask for the customer details, that would be a bad user experience. The user would be waiting for all data to come back before seeing anything. It would be better to show the user the information we have, and let the information from slower requests to the payment processor show up when it’s available.

So, let’s have our Angular app pull the data from both sources. That way, the user can see the customer details first (since it ...

Get Rails, Angular, Postgres, and Bootstrap, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.