PaymentSourceRepositoryProtocol
public protocol PaymentSourceRepositoryProtocol
A protocol for managing payment sources.
-
Updates the payment source for the specified consumer.
Declaration
Swift
func updatePaymentSource(consumerId: String, payload: PaymentSourceUpdatePayload) -> AnyPublisher<PaymentSourceUpdateResponse, NetworkError>
Parameters
consumerId
The ID of the consumer.
payload
The payload containing the updated payment source details.
Return Value
A publisher that emits the
PaymentSourceUpdateResponse
or an error of typeNetworkError
. -
Adds a contact item for the specified consumer.
Declaration
Swift
func addContactItem( consumerId: String, payload: AddContactItemPayload ) -> AnyPublisher<AddContactItemResponse, NetworkError>
Parameters
consumerId
The ID of the consumer.
payload
The payload containing the details of the contact item to be added.
Return Value
A publisher that emits the
AddContactItemResponse
or an error of typeNetworkError
. -
Adds a proxy for the specified consumer and instrument profile.
Declaration
Swift
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 details of the proxy to be added.
Return Value
A publisher that emits the
AddProxyResponse
or an error of typeNetworkError
. -
Removes a proxy for the specified consumer and instrument profile.
Declaration
Swift
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 an OTP (One-Time Password) at the specified URL.
Declaration
Swift
func validate(otp: ProxyOTPPayload, at url: URL) -> AnyPublisher<Void, NetworkError>
Parameters
otp
The OTP payload to be validated.
url
The URL where the validation should occur.
Return Value
A publisher that emits
Void
or an error of typeNetworkError
. -
Requests a new OTP (One-Time Password) at the specified URL.
Declaration
Swift
func requestNewOtp(at url: URL) -> AnyPublisher<RequestOTPResponse, NetworkError>
Parameters
url
The URL where the OTP request should be made.
Return Value
A publisher that emits the
RequestOTPResponse
or an error of typeNetworkError
. -
Edits the display name for the specified consumer and instrument profile.
Declaration
Swift
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
.