komola / paymill-node

Node.JS wrapper for the Paymill v2 API
MIT License
24 stars 11 forks source link

Make the code DRY #10

Closed Prinzhorn closed 10 years ago

Prinzhorn commented 11 years ago

Note: This is untested code. I'm not expecting this to get pulled (now).

I've updated the code to be DRY, because the code for the different entities was basically the same all over.

If you like the idea we can try to get this pulled after the tests (#9) are in place.

Prinzhorn commented 11 years ago

You'll note that I've remove the checks like if (!(payment_id && typeof payment_id === 'string')) {, because I didn't see a point in them. Either don't check the params or check all of them.

sebastianhoitz commented 10 years ago

Closed since this does not really work with the latest additions anymore. We would also lose the descriptive error messages that were added.