PaymentService
public protocol PaymentService
Base Protocol to get Payment Information
-
Fetches the list of
InsurancePayer
associated with the tenantDeclaration
Swift
func getInsurancePayers(tenant: String, success: @escaping ([InsurancePayer]) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
tenant
A string to indicate which tenant you want the list of
InsurancePayer
forsuccess
A closure called with a list of
InsurancePayer
failure
A closure called if any FailedReason errors are returned
-
Validates the coupon code (sometimes called service key) and returns the amount of the coupon
Declaration
Swift
func verifyCouponCode(couponCode: String, success: @escaping (Decimal) -> Void, failure: @escaping (CouponCodeFailedReason) -> Void)
Parameters
couponCode
A string to indicate the coupon code (sometimes called service key) used for verification
success
A closure called with a Decimal of the coupon amount in dollars. ie. 49.00 for $49
failure
A closure called if any CouponCodeFailedReason errors are returned
-
getInsurancePayers(tenant:
Asynchronous) Fetches the list of
InsurancePayer
associated with the tenantThrows
FailedReason
Declaration
Swift
func getInsurancePayers(tenant: String) async throws -> [InsurancePayer]
Parameters
tenant
A string to indicate which tenant you want the list of
InsurancePayer
forReturn Value
An array of
InsurancePayer
-
verifyCouponCode(couponCode:
Asynchronous) Validates the coupon code (sometimes called service key) and returns the amount of the coupon
Throws
Throws:CouponCodeFailedReason
Declaration
Swift
func verifyCouponCode(couponCode: String) async throws -> Decimal
Parameters
couponCode
A string to indicate the coupon code (sometimes called service key) used for verification
Return Value
Decimal of the coupon amount in dollars. ie. 49.00 for $49