You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@mangopay/vault-sdk

Package Overview
Dependencies
Maintainers
3
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mangopay/vault-sdk

Mangopay SDK - Vault

1.3.7
latest
npmnpm
Version published
Weekly downloads
6.3K
-11.4%
Maintainers
3
Weekly downloads
 
Created
Source

MangopayVault SDK - User integration guide

Installation

The MangoPay MangopayVault SDK is available on npm. See @mangopay/vault-sdk for an API reference.

npm install --save @mangopay/vault-sdk
# or
yarn add @mangopay/vault-sdk

Create a Card Registration

Send the request to https://api.mangopay.com/v2.01/clientId/cardregistrations with the input JSON data, where clientId is the ID of your MangoPay client account.

CreateCardRegistrationResult

Promise<CreateCardRegistrationResult>;
PropType
IdString
CardRegistrationURL
The URL to submit the card details form to
String
AccessKey
A special key to use when registering a card
String
PreregistrationData
A specific value to pass to the CardRegistrationURL
String
errorsMgpTypedError

MgpTypedError

type MgpTypedError<T> = {
  [Property in keyof T]: string;
};

Initialisation

import { MangopayVault } from '@mangopay/vault-sdk';

const options = {
  clientId: 'MANGOPAY_CLIENT_ACCOUNT_ID',
  environment: 'SANDBOX | PRODUCTION',
};

const vault = MangopayVault.initialize(options);

How it works

The MangopayVault API provides you with tokenizePaymentMethod( );

Tokenize Payment Method

CardInfoObject

PropType
cardNumber
The card number, as a string without any separators
String
cardExpirationDate
Card expiration date - should be in format MMYY
String
cardCvx
Card security code
String
const cardInfoObject = {
  cardNumber: '4970107111111119',
  cardExpirationDate: '1127',
  cardCvx: '123',
};

const preregistrationData = {
  id: createCardRegistrationResult.Id,
  cardRegistrationURL: createCardRegistrationResult.CardRegistrationURL,
  accessKeyRef: createCardRegistrationResult.AccessKey,
  data: createCardRegistrationResult.PreregistrationData,
};

const tokenizePaymentMethodResult = await vault.tokenizePaymentMethod(cardInfoObject, preregistrationData);

TokenizePaymentMethodResult

Promise<UpdateCardRegistrationOutput>;

UpdateCardRegistrationOutput

PropType
IdString
CardRegistrationURL
The URL to submit the card details form to
String
AccessKey
A special key to use when registering a card
String
PreregistrationData
A specific value to pass to the CardRegistrationURL
String
CardId
The ID of a card
String
errorsMgpTypedError

Keywords

Mangopay

FAQs

Package last updated on 04 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts