PaymentService

public protocol PaymentService

Base Protocol to get Payment Information

  • Fetches the list of InsurancePayer associated with the tenant

    Declaration

    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 for

    success

    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

  • Fetches the list of InsurancePayer associated with the tenant

    Throws

    FailedReason

    Declaration

    Swift

    func getInsurancePayers(tenant: String) async throws -> [InsurancePayer]

    Parameters

    tenant

    A string to indicate which tenant you want the list of InsurancePayer for

    Return Value

    An array of InsurancePayer

  • 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