Class TokenRequest


  • public abstract class TokenRequest
    extends java.lang.Object
    • Constructor Detail

      • TokenRequest

        public TokenRequest()
    • Method Detail

      • getTokenRequestPayload

        public abstract io.token.proto.common.token.TokenProtos.TokenRequestPayload getTokenRequestPayload()
      • getTokenRequestOptions

        public abstract io.token.proto.common.token.TokenProtos.TokenRequestOptions getTokenRequestOptions()
      • accessTokenRequestBuilder

        public static TokenRequest.AccessBuilder accessTokenRequestBuilder​(io.token.proto.common.token.TokenProtos.TokenRequestPayload.AccessBody.ResourceType... resources)
        Create a new Builder instance for an access token request.
        Parameters:
        resources - access token resources
        Returns:
        Builder instance
      • accessTokenRequestBuilder

        public static TokenRequest.AccessBuilder accessTokenRequestBuilder​(io.token.proto.common.token.TokenProtos.TokenRequestPayload.AccessBody.AccountResourceList list)
        Create a new Builder instance for an access token request with account-specific resources.
        Parameters:
        list - list of account-specific access token resources
        Returns:
        Builder instance
      • fundsConfirmationRequestBuilder

        public static TokenRequest.AccessBuilder fundsConfirmationRequestBuilder​(java.lang.String bankId,
                                                                                 io.token.proto.common.account.AccountProtos.BankAccount account)
        Create a Builder instance for a funds confirmation request.
        Parameters:
        bankId - bank ID
        account - the user's account
        Returns:
        Builder instance
      • fundsConfirmationRequestBuilder

        public static TokenRequest.AccessBuilder fundsConfirmationRequestBuilder​(java.lang.String bankId,
                                                                                 io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                 java.util.Optional<io.token.proto.common.transferinstructions.TransferInstructionsProtos.CustomerData> data)
        Create a Builder instance for a funds confirmation request.
        Parameters:
        bankId - bank ID
        account - the user's account
        data - customer data
        Returns:
        Builder instance
      • transferTokenRequestBuilder

        public static TokenRequest.TransferBuilder transferTokenRequestBuilder​(double amount,
                                                                               java.lang.String currency)
        Create a new Builder instance for a transfer token request.
        Parameters:
        amount - lifetime amount of the token request
        currency - currency of the token request
        Returns:
        Builder instance
      • standingOrderRequestBuilder

        public static TokenRequest.StandingOrderBuilder standingOrderRequestBuilder​(double amount,
                                                                                    java.lang.String currency,
                                                                                    java.lang.String frequency,
                                                                                    java.lang.String startDate,
                                                                                    java.lang.String endDate,
                                                                                    java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferDestination> destinations)
        Create a new Builder instance for a standing order token request.
        Parameters:
        amount - amount per charge
        currency - currency per charge
        frequency - frequency of the standing order. ISO 20022: DAIL, WEEK, TOWK, MNTH, TOMN, QUTR, SEMI, YEAR
        startDate - start date of the standing order. ISO 8601: YYYY-MM-DD or YYYYMMDD.
        endDate - end date of the standing order. ISO 8601: YYYY-MM-DD or YYYYMMDD.
        destinations - destination account of the standing order
        Returns:
        Builder instance
      • bulkTransferRequestBuilder

        public static TokenRequest.BulkTransferBuilder bulkTransferRequestBuilder​(java.util.List<io.token.proto.common.token.TokenProtos.BulkTransferBody.Transfer> transfers,
                                                                                  double totalAmount)
        Create a new Builder instance for a bulk transfer token request.
        Parameters:
        transfers - list of transfers
        totalAmount - total amount irrespective of currency. Used for redundancy check.
        Returns:
        Builder instance
      • fromProtos

        public static TokenRequest fromProtos​(io.token.proto.common.token.TokenProtos.TokenRequestPayload payload,
                                              io.token.proto.common.token.TokenProtos.TokenRequestOptions options)
        Construct an instance from the TokenRequestPayload and TokenRequestOptions protos.
        Parameters:
        payload - TokenRequestPayload
        options - TokenRequestOptions
        Returns:
        TokenRequest instance