Interface StripeConnectService

  • All Known Implementing Classes:
    StripeConnectServiceImpl

    public interface StripeConnectService
    Part of Stripe integration for Stripe Connect.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String checkConnectAccountStatus()
      Returns the status of the current seller's account
      com.stripe.model.Account createAccount​(java.lang.String businessType, java.lang.String businessStructure, java.lang.String tosIp)
      This method creates a Stripe Connect Account
      StripeAccountDTO createAccount​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> metaInfo)
      This method creates a Stripe Connect Account based on meta information
      boolean createExternalBankAccount​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> bankData)
      Creates ExternalAccount of a bank type.
      boolean createExternalCardAccount​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> cardData)
      Creates ExternalAccount of a card type.
      java.util.List<java.lang.String> getBusinessStructures​(java.lang.String businessType)
      Gets list of suitable company AccountCreateParams.Company.Structure's for current Seller's country and given AccountCreateParams.BusinessType.
      java.util.List<java.lang.String> getBusinessTypes()
      Gets list of AccountCreateParams.BusinessType's values for current Seller's country.
      StripePersonDTO getInitialPerson()
      Gets person with fields, pre-filled from current logged Profile.
      java.util.Map<java.lang.String,​java.lang.String> getMCCs()
      Gets map of merchant category names and codes.
      java.lang.String obtainConnectOnboardingLink​(java.lang.String refreshUrl, java.lang.String returnUrl)
      Obtains AccountLink and returns single-use Stripe URL that the platform can redirect the current user to in order to take them through the Connect Onboarding flow.
      com.stripe.model.Account updateAccount​(java.lang.String accountId, StripeAccountDTO accountDTO)
      This method update a Stripe Connect Account
      StripeAccountDTO verifyAccount​(java.lang.String refreshUrl, java.lang.String returnUrl, java.util.LinkedHashMap<java.lang.String,​java.lang.Object> metaInfo)
      This method does update for Seller Seller entity with meta information which contains necessary data for Stripe Connect Account
    • Method Detail

      • checkConnectAccountStatus

        java.lang.String checkConnectAccountStatus()
        Returns the status of the current seller's account
        Returns:
        status
      • createAccount

        com.stripe.model.Account createAccount​(java.lang.String businessType,
                                               java.lang.String businessStructure,
                                               java.lang.String tosIp)
                                        throws com.stripe.exception.StripeException
        This method creates a Stripe Connect Account
        Parameters:
        businessType - type of business
        businessStructure - structure of business
        tosIp - client ip-address
        Returns:
        created stripe account entity Account
        Throws:
        com.stripe.exception.StripeException - different Stripe errors
      • createAccount

        StripeAccountDTO createAccount​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> metaInfo)
        This method creates a Stripe Connect Account based on meta information
        Parameters:
        metaInfo - map with extra information which is necessary to have
        Returns:
        created stripe account entity StripeAccountDTO
      • updateAccount

        com.stripe.model.Account updateAccount​(java.lang.String accountId,
                                               StripeAccountDTO accountDTO)
                                        throws com.stripe.exception.StripeException
        This method update a Stripe Connect Account
        Parameters:
        accountId - stripe connect account id
        accountDTO - data to update
        Returns:
        created stripe account entity Account
        Throws:
        com.stripe.exception.StripeException - different Stripe errors
      • getInitialPerson

        StripePersonDTO getInitialPerson()
        Gets person with fields, pre-filled from current logged Profile. This person has representative status
        Returns:
        dto with fields
      • createExternalBankAccount

        boolean createExternalBankAccount​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> bankData)
                                   throws com.stripe.exception.StripeException
        Creates ExternalAccount of a bank type. Binds it with current's Seller Account
        Parameters:
        bankData - data, format described in BankExternalAccountDTO
        Returns:
        true if successful
        Throws:
        com.stripe.exception.StripeException - different Stripe errors
      • createExternalCardAccount

        boolean createExternalCardAccount​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> cardData)
        Creates ExternalAccount of a card type. Binds it with current's Seller Account
        Parameters:
        cardData - data, format described in CardExternalAccountDTO
        Returns:
        true if successful
      • getBusinessTypes

        java.util.List<java.lang.String> getBusinessTypes()
        Gets list of AccountCreateParams.BusinessType's values for current Seller's country.
        Returns:
        list of business types
      • getBusinessStructures

        java.util.List<java.lang.String> getBusinessStructures​(java.lang.String businessType)
        Gets list of suitable company AccountCreateParams.Company.Structure's for current Seller's country and given AccountCreateParams.BusinessType.
        Parameters:
        businessType - business type
        Returns:
        list of structures
      • getMCCs

        java.util.Map<java.lang.String,​java.lang.String> getMCCs()
        Gets map of merchant category names and codes.
        Returns:
        map
      • verifyAccount

        StripeAccountDTO verifyAccount​(java.lang.String refreshUrl,
                                       java.lang.String returnUrl,
                                       java.util.LinkedHashMap<java.lang.String,​java.lang.Object> metaInfo)
        This method does update for Seller Seller entity with meta information which contains necessary data for Stripe Connect Account
        Parameters:
        refreshUrl - The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link’s URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user.
        returnUrl - The URL that the user will be redirected to upon leaving or completing the linked flow
        metaInfo - stripe data for Stripe Connect Account
        Returns:
        updated entity
      • obtainConnectOnboardingLink

        java.lang.String obtainConnectOnboardingLink​(java.lang.String refreshUrl,
                                                     java.lang.String returnUrl)
        Obtains AccountLink and returns single-use Stripe URL that the platform can redirect the current user to in order to take them through the Connect Onboarding flow. If Stripe Connect Account does not exist for the current user - creates new Account with the part of prefilled fields.
        Parameters:
        refreshUrl - The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link’s URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user.
        returnUrl - The URL that the user will be redirected to upon leaving or completing the linked flow
        Returns:
        link