PaymentSourceRepository
public final class PaymentSourceRepository : PaymentSourceRepositoryProtocol
A repository for managing payment sources.
-
Initializes the
PaymentSourceRepository
with the required dependencies.Declaration
Swift
public init( networkingClient: EPINetworkingClientProtocol, networkingClientFactory: NetworkingFactoryProtocol )
Parameters
networkingClient
The networking client used for API communication.
networkingClientFactory
The factory for creating networking clients.
-
Updates the payment source for the specified consumer.
Declaration
Swift
public func updatePaymentSource( consumerId: String, payload: PaymentSourceUpdatePayload ) -> AnyPublisher<PaymentSourceUpdateResponse, NetworkError>
Parameters
consumerId
The ID of the consumer.
payload
The payload containing the updated payment source information.
Return Value
A publisher that emits the
PaymentSourceUpdateResponse
or an error of typeNetworkError
. -
Adds a contact item to the payment sources of the specified consumer.
Declaration
Swift
public func addContactItem( consumerId: String, payload: AddContactItemPayload ) -> AnyPublisher<AddContactItemResponse, NetworkError>
Parameters
consumerId
The ID of the consumer.
payload
The payload containing the contact item information to be added.
Return Value
A publisher that emits the
AddContactItemResponse
or an error of typeNetworkError
. -
Adds a proxy to the payment sources of the specified consumer.
Declaration
Swift
public func addProxy( consumerId: String, paymentSourceProfileId: String, payload: AddProxyPayload ) -> AnyPublisher<AddProxyResponse, NetworkError>
Parameters
consumerId
The ID of the consumer.
instrumentProfileId
The ID of the instrument profile.
payload
The payload containing the proxy information to be added.
Return Value
A publisher that emits the
AddProxyResponse
or an error of typeNetworkError
. -
Removes a proxy from the payment sources of the specified consumer.
Declaration
Swift
public func removeProxy( consumerId: String, paymentSourceProfileId: String, proxyId: String ) -> AnyPublisher<RemoveProxyResponse, NetworkError>
Parameters
consumerId
The ID of the consumer.
instrumentProfileId
The ID of the instrument profile.
proxyId
The ID of the proxy to be removed.
Return Value
A publisher that emits the
RemoveProxyResponse
or an error of typeNetworkError
. -
Validates the provided OTP (One-Time Password) at the specified HAL URL.
Declaration
Swift
public func validate(otp: ProxyOTPPayload, at url: URL) -> AnyPublisher<Void, NetworkError>
Parameters
otp
The OTP payload to be validated.
url
The URL where the validation request should be sent.
Return Value
A publisher that emits
Void
upon successful validation or an error of typeNetworkError
. -
Requests a new OTP (One-Time Password) at the specified HAL URL.
Declaration
Swift
public func requestNewOtp(at url: URL) -> AnyPublisher<RequestOTPResponse, NetworkError>
Parameters
url
The URL where the OTP request should be sent.
Return Value
A publisher that emits the
RequestOTPResponse
or an error of typeNetworkError
. -
Edits the display name of the payment source for the specified consumer and instrument profile.
Declaration
Swift
public func editDisplayName( consumerId: String, paymentSourceProfileId: String, payload: EditPaymentSourcePayload ) -> AnyPublisher<EditPaymentSourceResponse, NetworkError>
Parameters
consumerId
The ID of the consumer.
instrumentProfileId
The ID of the instrument profile.
payload
The payload containing the updated display name.
Return Value
A publisher that emits the
EditPaymentSourceResponse
or an error of typeNetworkError
.