-
- Downloads
Convert Authorize.net doDirectPayment to use guzzle & add test
This brings the main Authorize.net payment function under testing, putting us in a better position to bring it into line with more recommended coding practices. Note the trick to writing tests for Guzzle is to first add the lines ``` $this->setUpClientWithHistoryContainer(); $this->processor->setGuzzleClient($this->getGuzzleClient()); ... do the stuff $responses = $this->getResponseBodies(); $requests = $this->getRequestBodies(); ``` That allows you to capture the outgoing & incoming responses that form the expectations. Obviously some credential wrangling is needed to get an OK response but it's also possible with some processors (e.g ones that are basically done for) to just worry about ensuring the outgoing is captured
Please register or sign in to comment