getOrdersController(); } public function testOrdersCreateWithStatus400() { // Parameters for the API call $request = [ 'body' => OrderRequestBuilder::init( CheckoutPaymentIntent::CAPTURE, [] )->build(), 'payPalRequestId' => 'PayPal-Request-Id', 'payPalPartnerAttributionId' => 'PayPal-Partner-Attribution-Id2', 'payPalClientMetadataId' => 'PayPal-Client-Metadata-Id', 'prefer' => 'return=minimal' ]; // Perform API call $result = self::$controller->ordersCreate($request); $headers = []; $headers['Content-Type'] = ['application/json', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(400) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testOrdersPatchWithStatus400() { // Parameters for the API call $request = [ 'body' => PatchBuilder::init( PatchOp::ADD )->build(), 'id' => self::NON_EXISTENT_ORDER_ID, ]; // Perform API call $result = self::$controller->ordersPatch($request); $headers = []; $headers['Content-Type'] = ['application/json', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(400) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testOrdersGetWithStatus204() { // Parameters for the API call $request = [ 'id' => self::NON_EXISTENT_ORDER_ID ]; // Perform API call $result = self::$controller->ordersPatch($request); // Assert result with expected response $this->assertTrue($result->isSuccess()); $this->newTestCase($result->getResult()) ->expectStatus(204) ->assert(); } public function testOrdersConfirmWithStatus404() { // Parameters for the API call $request = [ 'body' => ConfirmOrderRequestBuilder::init( PaymentSourceBuilder::init()->build() )->build(), 'id' => self::NON_EXISTENT_ORDER_ID, 'prefer' => 'return=minimal' ]; // Perform API call $result = self::$controller->ordersConfirm($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 testOrdersAuthorizeWithStatus404() { // Parameters for the API call $request = [ 'id' => self::NON_EXISTENT_ORDER_ID, 'prefer' => 'return=minimal' ]; // Perform API call $result = self::$controller->ordersAuthorize($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 testOrdersTrackCreateWithStatus404() { // Parameters for the API call $request = [ 'id' => self::NON_EXISTENT_ORDER_ID, 'body' => OrderTrackerRequestBuilder::init( self::ALREADY_CAPTURED_ID )->notifyPayer(false)->build(), ]; // Perform API call $result = self::$controller->ordersTrackCreate($request); $headers = []; $headers['Content-Type'] = ['application/json', true]; // Assert result with expected response $this->assertTrue($result->isError()); $this->newTestCase($result->getResult()) ->expectStatus(400) ->allowExtraHeaders() ->expectHeaders($headers) ->assert(); } public function testOrdersTrackersPatchWithStatus404() { // Parameters for the API call $request = [ 'id' => self::NON_EXISTENT_ORDER_ID, 'trackerId' => self::NON_EXISTENT_TRACKER_ID, 'body' => [ PatchBuilder::init( PatchOp::REPLACE ) ->path('/notify_payer') ->value(true) ->build() ] ]; // Perform API call $result = self::$controller->ordersTrackersPatch($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(); } }