Collecting Payment Information

Whether you’re starting a Virtual Visit, a Retail Visit, or a Provider Visit, one of the required properties is a PaymentMethod. Not all payment methods are supported for each service, and some payment methods require setup from your DexCare contact.

  Retail Virtual Provider
Credit Card - Stripe Token :o: Coming soon… :heavy_check_mark: :x:
Insurance - By Insurance Provider :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Insurance - Card Upload :question: Supported by some clinics :x: :x:
Self Pay (Pay on arrival) :heavy_check_mark: :x: :heavy_check_mark:
Coupon Code :x: :heavy_check_mark: :x:
  • Upon failure to collect valid payment information, a standard medical bill will be mailed to the patient.
  • Your app is not required to use all of these - it can use a subset if desired.

Credit Card

DexCare supports credit card payments with Stripe. Please contact your DexCareSDK contact for more information on how to provide this for your clients.

  • let paymentMethod = PaymentMethod.creditCard(stripeToken: "TokenFromStripe")
    
  • val paymentMethod = CreditCard("TokenFromStripe")
    

Manual Insurance - By Provider

A list of Insurance providers can be set up by your DexCareSDK contact. These providers can be retrieved by calling PaymentService.getInsurancePayers and the providerId is required from the former call.

Use InsuranceManualSelf when using your insurance for the main logged in user.

  • let paymentMethod = PaymentMethod.insuranceManualSelf(memberId: "NumberOrStringOfMemberIdOfProvder", providerId: "providerIdFromGetInsurancePayers")
    
  • val paymentMethod = InsuranceManualSelf("MemberId", "providerIdFromGetInsurancePayers")
    

Use InsuranceManualOther when the insurance is owned by someone other than the app user. Additional demographic information needs to be collected about said insurance owner to use this payment method.

  • let paymentMethod = PaymentMethod.insuranceManualOther(firstName: "InsuranceOwnerFirstName", lastName: "InsuranceOwnerLastName", gender: .male, dateOfBirth: Date.birthdate, memberId:"MemberIdOnInsurance", providerId: "providerIdFromGetInsurancePayers")
    
  • val paymentMethod = InsuranceManualOther("InsuranceOwnerFirstName", "InsuranceOwnerLastName", gender, dateOfBirth, "MemberIdOnInsurance", "providerIdFromGetInsurancePayers")
    

Insurance - Card Upload

When supported by a Retail Clinic, the SDK can be used to send up pictures of a user’s Insurance Card. These images will then be able to be seen by the provider.

It is up to your app to capture the images necessary for this API.

Before you can use an .insuranceImageSelf or insuranceImageOther payment type, you must upload the insurance card images. This is done via the PaymentService.uploadInsuranceCard function.

  • let frontImage = // set the image as an UIImage from a camera/photos
    let frontImage = // set the image as an UIImage from a camera/photos
    let dexcareSDK = DexcareSDK(configuration: ...)
    
    dexcareSDK.paymentService.uploadInsuranceCard(
      frontImage: frontImage,
      backImage: backImage,
      success: { cardId in
        // save `cardId` for use in `PaymentMethod.insuranceImageSelf` or `PaymentMethod.insuranceImageOther`
      },
      failure: { error in
        // sdk couldn't upload the images.
      }
    )
    
    let paymentMethod = PaymentMethod.insuranceImageSelf(cardId: "idFromPreviousUploadCall")
    
  • DexCareSDK.paymentService.uploadInsuranceCard(
            frontBitmap,
            backBitmap
        ).subscribe({ cardId ->
            // save `cardId` for use in `PaymentMethod.insuranceImageSelf` or `PaymentMethod.insuranceImageOther`
        }, {
            // image upload failed
        })
    
    val paymentMethod = InsuranceImageSelf(cardId)
    

Use .insuranceImageOther when the insurance is not owned by the app user.

  • let frontImage = // set the image as an UIImage from a camera/photos
    let frontImage = // set the image as an UIImage from a camera/photos
    let dexcareSDK = DexcareSDK(configuration: ...)
    
    dexcareSDK.paymentService.uploadInsuranceCard(
      frontImage: frontImage,
      backImage: backImage,
      success: { cardId in
        // save `cardId` for use in `PaymentMethod.insuranceImageSelf` or `PaymentMethod.insuranceImageOther`
      },
      failure: { error in
        // sdk couldn't upload the images.
      }
    )
    
    let paymentMethod = PaymentMethod.insuranceImageOther(firstName: "InsuranceOwnerFirstName", lastName: "InsuranceOwnerLastName", gender: .male, dateOfBirth: Date.birthdate, cardId: "idFromPreviousUploadCall")
    
  • DexCareSDK.paymentService.uploadInsuranceCard(
            frontBitmap,
            backBitmap
        ).subscribe({ cardId ->
            // save `cardId` for use in `PaymentMethod.insuranceImageSelf` or `PaymentMethod.insuranceImageOther`
        }, {
            // image upload failed
        })
    
    val paymentMethod = InsuranceImageOther("InsuranceOwnerFirstName", "InsuranceOwnerLastName", gender, dateOfBirth, cardId)
    

Self pay

Pay on arrival at a clinic or department. No extra information is required to use this payment method.

  • let paymentMethod = PaymentMethod.self
    
  • val paymentMethod = SelfPayment()
    

Coupon Code/Service Key

A Service key is a payment method that can be used to apply a discount to the standard virtual visit price.

The discount amount can be anything up to 100% off the visit price. When the discount amount is less than 100%, the remaining cost is expected to be paid at the time of visit.

Verifying a user-input string as a service key

In order to check if a string is a valid service key, the DexCare SDK provides a method DexCareSDK.paymentService.verifyCouponCode(couponCode: String).

If the string is a valid service key, then a double representing the discount amount is returned.

If the string is an invalid service key, then an InvalidCouponCodeError error is returned.

  • let dexcareSDK = DexcareSDK(configuration: ...)
    dexcareSDK.paymentService.verifyCouponCode(
        couponCode: "user's input string",
        success: { discountAmount in
            // discountAmount is a decimal - ie 24.00 for $24
        },
        failure: { error in
            // an error is returned when the user's input string is not a valid coupon code
        }
    )
    
    
  • DexCareSDK.paymentService.verifyCouponCode("user's input string")
        .subscribe({ discountAmount ->
            // discountAmount is a Double
        }, {
            // an error is returned when the user's input string is not a valid coupon code
        })
    

Note that sending an invalid key will not prevent scheduling the visit, but it will show an error on the Provider’s side.

  • let paymentMethod = PaymentMethod.couponCode("aSecretServiceKey")
    
  • val paymentMethod = CouponCode("aSecretServiceKey")