Physical Card Request

usePhysicalCardRequest

The following environment variables are required:

API_BAAS_PHYSICAL_CARD_REQUEST='/baas/debit-cards/physical'

How to use?

  • Import usePhysicalCardRequest:

import {usePhysicalCardRequest} from 'LinkerStudio/modules/baas/common/hooks';
  • Add this code block:

const [
    sendPhysicalCardRequest,
    sendPhysicalCardIsLoading,
    renderSuccessView,
  ] = usePhysicalCardRequest()

How to request a physical card?

  • Use the sendPhysicalCardRequest function, and invoke CardsService from LinkerStudio/modules/baas/common/services/CardsService to make a physical card request:

const sendPhysicalCardRequest = async (address?: Address) => {
    try {
      const cardId = (cards?.length > 0 && cards[0].id) || '';
      await CardsService.physicalCardRequest(cardId, address);
    } catch (error) {
     return error
    }
  };

Last updated