Skip to main content

Prepaid Cards

Introduction

The Cards module exposes features for managing prepaid cards, like create card, update fetching list of the cards.

Card Service

The CardService can be used for managing prepaid card related operations.

Get customer prepaid cards

Retrieve a list of all prepaid cards for the current customer. CardParameters are the parameters for filtering the customer's cards. Use include parameter to add additional information into the response: TOKENIZATIONS - include information about the mobile wallets tokenizations. AVAILABLE_ACTIONS - include information about available actions on the card.

This is the represented structure of the request for fetching all customer prepaid cards:

import { CardParameters, CardType, CardStatus, CardIncludesParam } from '@paysafe/paysafe-wallet-saas-web/cards';
import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const cardParameters: CardParameters = {
cardType: CardType.VIRTUAL,
limit: null,
offset: null,
status: [CardStatus.ACTIVE, CardStatus.EXPIRED],
include: [CardIncludesParam.TOKENIZATIONS, CardIncludesParam.AVAILABLE_ACTIONS]
};

Wallet.getInstance().getCardService().getAll(cardParameters)
.then(response => console.log('Cards list', response))
.catch(error => console.error('Error fetching cards', error));
tip

You can achieve pagination by combining the limit and offset filters. For instance, implementing pagination with a page size of 2 results per page would involve configuring:

  • Page 1: limit=2, offset=0
  • Page 2: limit=2, offset=2
  • Page 3: limit=2, offset=4

Retrieve single prepaid card

Provides detailed information about specific card by cardId. The response is a single card object.

import { CardIncludesParam } from '@paysafe/paysafe-wallet-saas-web/cards';
import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const cardId = 'f16ba382-eb42-481a-b08f-c57bdc9aae24';
const include = [CardIncludesParam.TOKENIZATIONS];

Wallet.getInstance().getCardService().get(cardId, include)
.then(response => console.log('Card', response))
.catch(error => console.error('Error fetching card', error));

Retrieve single prepaid card with available actions

Provides detailed information about specific card by cardId along with available actions that can be performed on a card. The response is a single card object.

import { CardIncludesParam } from '@paysafe/paysafe-wallet-saas-web/cards';
import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const cardId = 'f16ba382-eb42-481a-b08f-c57bdc9aae24';
const include = [CardIncludesParam.AVAILABLE_ACTIONS];

Wallet.getInstance().getCardService().get(cardId, include)
.then(response => console.log('Card', response))
.catch(error => console.error('Error fetching card', error));

The response contains an list of 'availableActions' object. It has field action which can be performed on a card.

Create a prepaid card

The CardRequest is used for the creation of a new Physical or Virtual prepaid card for a customer, based on the provided programName.

import { CardRequest } from '@paysafe/paysafe-wallet-saas-web/cards';
import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const cardRequest: CardRequest = {
programName: 'SKRILL-VIRTUAL-MC-EEA',
currency: 'BGN',
mobile: '+1 123456789',
cardPin: null,
externalId: null,
deliveryAddress: null,
termsAndConditionsAccepted: true,
eDisclosureAccepted: true
};

Wallet.getInstance().getCardService().create(cardRequest)
.then(response => console.log('Created card', response))
.catch(error => console.error('Error creating card', error));

The parameters for PHYSICAL card application are the same, but you need to specify the deliveryAddress parameter.

import { CardRequest } from '@paysafe/paysafe-wallet-saas-web/cards';
import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const cardRequest: CardRequest = {
programName: 'SKRILL-PHYSICAL-MC-EEA',
currency: 'BGN',
mobile: '+1 123456789',
cardPin: null,
externalId: null,
deliveryAddress: {
address1: 'Tsarigradsko Shose 73',
address2: null,
address3: null,
city: 'Sofia',
countryCode: 'BG',
state: null,
postalCode: '1000'
},
termsAndConditionsAccepted: true,
eDisclosureAccepted: true
};

Wallet.getInstance().getCardService().create(cardRequest)
.then(response => console.log('Created card', response))
.catch(error => console.error('Error creating card', error));

Activate a prepaid physical card

This endpoint facilitates the activation of a specific prepaid physical card, identified by its unique cardId. The card can be activated only once and only while it is with status ISSUED or DIGITAL. Once activated, the card's status transitions to ACTIVE, enabling users to conveniently utilize their physical card.

The following code is representing the CardActivationRequest

import { CardActivationRequest } from '@paysafe/paysafe-wallet-saas-web/cards';
import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const cardId = 'f16ba382-eb42-481a-b08f-c57bdc9aae24';
const cardActivationRequest: CardActivationRequest = {
lastFourDigits: '1234',
cvv: '567'
};

Wallet.getInstance().getCardService().activate(cardId, cardActivationRequest)
.then(response => console.log('Activated card', response))
.catch(error => console.error('Error activating card', error));

Update prepaid card status

The customer can change/update the status of their prepaid cards, and as a result, lock/unlock or cancel their prepaid card.

In the table below, you can find information about the statuses that the user can change.

From \ ToACTIVECANCELLEDLOCKEDDIGITAL
ACTIVE-
CANCELLED-
LOCKED-
DIGITAL✅ (By PIN & CHIP)-

The CardUpdateRequest includes additional functionality that allows the customer to change the card pin.

import { CardUpdateRequest, CardStatus } from '@paysafe/paysafe-wallet-saas-web/cards';
import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const cardUpdateRequest: CardUpdateRequest = {
status: CardStatus.ACTIVE,
statusReason: 'User Activate Card from LOCKED status',
pin: '1243'
};
const cardId = 'f16ba382-eb42-481a-b08f-c57bdc9aae24';

Wallet.getInstance().getCardService().update(cardId, cardUpdateRequest)
.then(response => console.log('Updated card', response))
.catch(error => console.error('Error updating card', error));

Get prepaid card details

note

The API is only available if you are PCI DSS compliant. Contact your Implementation Manager for details.

Card sensitive information can be retrieved. The response contains card sensitive information such as pan, cvv, expiry, cardHolderName.

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

Wallet.getInstance().getCardService().getDetails('f16ba382-eb42-481a-b08f-c57bdc9aae24')
.then(response => console.log('Card details', response))
.catch(error => console.error('Error getting card details', error));

Get prepaid card details url

Sensitive card information can be retrieved using a special url which can be retrieved by the following method. Language parameter is optional and default to en-US. The response contains the url which will load sensitive card details.

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

Wallet.getInstance().getCardService().getDetailsUrl('f16ba382-eb42-481a-b08f-c57bdc9aae24', 'en-GB')
.then(response => console.log('Card details url', response))
.catch(error => console.error('Error getting card details url', error));

Get prepaid card view pin url

Pin can be retrieved using a special url which can be retrieved by the following method. Language parameter is optional and default to en-US. The response contains the url which will load pin.

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

Wallet.getInstance().getCardService().getViewPinUrl('f16ba382-eb42-481a-b08f-c57bdc9aae24', 'en-GB')
.then(response => console.log('View pin url', response))
.catch(error => console.error('Error getting card view pin url.', error));

Retrieve customer eligible prepaid cards programs

Retrieve eligible programs for a customer. The result list can be filtered by program type. If the customer is eligible for a Prepaid card, the response will contain a non-empty programs array. The number of cards that can be issued of a given type can be seen in the allowableCards field.

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

Wallet.getInstance().getCardService().getPrograms()
.then(response => console.log('Programs list', response))
.catch(error => console.error('Error fetching programs', error));

Reset PIN/CVV verification attempts.

The customer can unblock card PIN/CVV by resetting verification attempts.

note

This API is only available for card programs in Europe.

The ResetCardVerificationAttemptsRequest includes action name that allows the customer to reset card PIN/CVV verification attempts. The AttemptResetAction includes a required action PIN_CVV_RETRIES. The CardAttemptResetInfo response of the method.

import { ResetCardVerificationAttemptsRequest, AttemptResetAction } from '@paysafe/paysafe-wallet-saas-web/cards';
import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const resetCardVerificationAttemptsRequest: ResetCardVerificationAttemptsRequest = {
action: AttemptResetAction.PIN_CVV_RETRIES
};
const cardId = 'f16ba382-eb42-481a-b08f-c57bdc9aae24';

Wallet.getInstance().getCardService().resetVerificationAttempts(cardId, resetCardVerificationAttemptsRequest)
.then(response => console.log('CardAttemptResetInfo details', response))
.catch(error => console.error('Error resetting PIN/CVV verification attempts', error));