getPaymentsController(); } public function testAuthorizationsGetWithStatus404() { // Perform API call $result = self::$controller->authorizationsGet(self::NON_EXISTENT_AUTHORIZATION_ID); $headers = []; $headers['Content-Type'] = ['application/json;charset=UTF-8', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(404) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testCapturesGetWithStatus404() { // Perform API call $result = self::$controller->capturesGet(self::NON_EXISTENT_CAPTURE_ID); $headers = []; $headers['Content-Type'] = ['application/json;charset=UTF-8', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(404) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testRefundsGetWithStatus404() { // Perform API call $result = self::$controller->refundsGet(self::NON_EXISTENT_REFUND_ID); $headers = []; $headers['Content-Type'] = ['application/json', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(404) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testAuthorizationsCaptureWithStatus404() { // Parameters for the API call $request = [ 'body' => CaptureRequestBuilder::init()->finalCapture(false)->build(), 'authorizationId' => self::NON_EXISTENT_AUTHORIZATION_ID, 'prefer' => 'return=minimal' ]; // Perform API call $result = self::$controller->authorizationsCapture($request); $headers = []; $headers['Content-Type'] = ['application/json;charset=UTF-8', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(404) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testAuthorizationsReauthorizeWithStatus404() { // Parameters for the API call $request = [ 'authorizationId' => self::NON_EXISTENT_AUTHORIZATION_ID, 'prefer' => 'return=minimal' ]; // Perform API call $result = self::$controller->authorizationsReauthorize($request); $headers = []; $headers['Content-Type'] = ['application/json;charset=UTF-8', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(404) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testAuthorizationsVoidWithStatus404() { // Parameters for the API call $request = [ 'authorizationId' => self::NON_EXISTENT_AUTHORIZATION_ID, 'prefer' => 'return=minimal' ]; // Perform API call $result = self::$controller->authorizationsVoid($request); $headers = []; $headers['Content-Type'] = ['application/json', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(404) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testAuthorizationsVoidWithStatus422() { // Parameters for the API call $request = [ 'authorizationId' => self::ALREADY_AUTHORIZED_ID, 'prefer' => 'return=minimal' ]; // Perform API call $result = self::$controller->authorizationsVoid($request); $headers = []; $headers['Content-Type'] = ['application/json', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(422) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testCapturesRefundWithStatus404() { // Parameters for the API call $request = [ 'captureId' => self::NON_EXISTENT_CAPTURE_ID, 'prefer' => 'return=minimal', 'body' => RefundRequestBuilder::init() ->amount( MoneyBuilder::init( 'USD', '1.44' )->build() ) ->noteToPayer('Defective product') ->build() ]; // Perform API call $result = self::$controller->capturesRefund($request); $headers = []; $headers['Content-Type'] = ['application/json', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(404) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } }