https://github.com/checkout/networkclient-ios
Interface to network calls that can be consumed in different products that require using the network for their functionality
https://github.com/checkout/networkclient-ios
Last synced: 4 months ago
JSON representation
Interface to network calls that can be consumed in different products that require using the network for their functionality
- Host: GitHub
- URL: https://github.com/checkout/networkclient-ios
- Owner: checkout
- License: mit
- Created: 2022-06-21T10:03:11.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-04T11:19:48.000Z (over 1 year ago)
- Last Synced: 2025-04-08T14:43:36.241Z (about 1 year ago)
- Language: Swift
- Size: 57.6 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# CheckoutNetwork-iOS

SPM distributed shared approach to networking for iOS projects.
Project does not handle any credentials or security, it simply acts as a passthrough for the request, encouraging some similar practices to be implemented for a consistent approach to networking.
***
## Features of component
#### Encourages a single source of truth for endpoints
Consumer should declare an enum conforming to `NetworkPath`, which will enable a single source of truth for endpoints, clear URL formatting and a consistent approach across the project
#### Abstracts complex details inside RequestConfiguration Model
This allows consumer application to not have to declare their own MIME types, handle query parameters, headers or other details differently each time. By requesting the same model to be provided when running, it enforces a consistent, reviewable approach, whilst building in the parsing mechanism to integrate these details in the final request
#### Baked in testing support
Target `CheckoutNetworkFakeClient` can be imported in unit tests to encourage easy and convenient testability of the behaviour.
#### Abstract response handling
Simply receive an error or a Decoded object. No need to validate error, result status on different calls, ensuring a consistent communication in sync with the Checkout.com backend standards.