thephpleague / omnipay-pin

Pin Payments driver for the Omnipay PHP payment processing library
MIT License
12 stars 14 forks source link

AbstractRequest sendRequest should call httpClient->createRequest #4

Closed delatbabel closed 8 years ago

delatbabel commented 9 years ago

AbstractRequest sendRequest currently calls httpClient->post instead of (like most other Omnipay gateways) calling httpClient->createRequest. httpClient->post is shorter if you're only doing POST requests, but many of the requests in the Pin API gateway use other HTTP methods including GET, PUT and DELETE. Forcing everything to POST is probably why no messages to implement such things as list customers / list transactions has not been implemented.

I am working on a PR for adding some class documentation at the moment, I will work on this issue next after the class documentation is done.

delatbabel commented 9 years ago

I have submitted 2 PRs with the documentation as well as a more important fix to rename the previously incorrectly named get*Token functions. Once those are through I will PR a fix for this problem. It will require one fairly significant change to the AbstractRequest class and the classes that depend on it to use the same internal structure as (for example) the stripe and Paypal REST gateways to support other methods than POST. That will allow the other gateway methods such as updateCard and deleteCard to be implemented.

Question: Should I submit (a) a PR to fix the way that the HTTP request is generated to allow methods other than POST and then (b) a separate PR to implement the additional request classes, or submit them both together in one PR? PR (b) will require PR (a) in order to be able to work and would be a branch on a branch, which may make merging more complex and might cause the travis build for b to break until a is merged.

delatbabel commented 8 years ago

Already fixed by @VictorGarcia in #9