academe / SagePay-Integration

HTTP Messages for the Sage Pay REST (Pi) gateway.
GNU General Public License v3.0
9 stars 5 forks source link

Response message factory #30

Closed judgej closed 8 years ago

judgej commented 8 years ago

Being able to throw a PSR-7 response into a factory, and getting back the appropriate response object would be great, and take away some of the guesswork.

Not sure how feasible this will be. We have the HTTP response code, and the body contents to inspect, so it should all be possible. Guzzle would have its exceptions disabled (which it raises on a non-2xx response) so a PSR-7 response message would always be available for parsing.

judgej commented 8 years ago

Some kind of parsing would be needed here, with a mapping of the parsed results to the appropriate objects.

judgej commented 8 years ago

Message factory is essentially working for all known response types. Needs a little more refactoring and documentation updated to show it action. We'll make this the recommended way to use this package.

judgej commented 8 years ago

Issue #36 was created as a duplicate. Not sure how it took me so long to notice that! Closing.