-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from peoray/cards-methods
Cards methods
- Loading branch information
Showing
21 changed files
with
700 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Bloc, IBlockCardRequest } from '../../dist' | ||
|
||
const bloc = new Bloc('secret-keyasfasfbahfb', 'public-key') | ||
|
||
const blockCard = async () => { | ||
try { | ||
const data: IBlockCardRequest = { | ||
account_id: '64cb260d73152af277afcb53', | ||
reason: 'lost', | ||
} | ||
const response = await bloc.blockCard('card-id', data) | ||
console.log(response) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
blockCard() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Bloc, IChangeCardPinRequest } from '../../dist' | ||
|
||
const bloc = new Bloc('secret-keyasfasfbahfb', 'public-key') | ||
|
||
const changeCardPIN = async () => { | ||
try { | ||
const data: IChangeCardPinRequest = { | ||
old_pin: '4639', | ||
new_pin: '1332', | ||
} | ||
const response = await bloc.changeCardPIN('card-id', data) | ||
console.log(response) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
changeCardPIN() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Bloc } from '../../dist' | ||
|
||
const bloc = new Bloc('secret-keyasfasfbahfb', 'public-key') | ||
|
||
const freezeCard = async () => { | ||
try { | ||
const response = await bloc.freezeCard('card-id') | ||
console.log(response) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
freezeCard() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Bloc, IFundCardRequest } from '../../dist' | ||
|
||
const bloc = new Bloc('secret-keyasfasfbahfb', 'public-key') | ||
|
||
const fundCard = async () => { | ||
try { | ||
const data: IFundCardRequest = { | ||
amount: 100000, | ||
from_account_id: '64cb260d73152af277afcb53', | ||
currency: 'NGN', | ||
} | ||
const response = await bloc.fundCard('card-id', data) | ||
console.log(response) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
fundCard() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Bloc } from '../../dist' | ||
|
||
const bloc = new Bloc('secret-keyasfasfbahfb', 'public-key') | ||
|
||
const getCardById = async () => { | ||
try { | ||
const card = await bloc.getCardById('card-id') | ||
console.log(card) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
getCardById() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Bloc } from '../../dist' | ||
|
||
const bloc = new Bloc('secret-keyasfasfbahfb', 'public-key') | ||
|
||
const getCardSecureData = async () => { | ||
try { | ||
const card = await bloc.getCardSecureData('card-id') | ||
console.log(card) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
getCardSecureData() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Bloc } from '../../dist' | ||
|
||
const bloc = new Bloc('secret-keyasfasfbahfb', 'public-key') | ||
|
||
const getCards = async () => { | ||
try { | ||
const cards = await bloc.getCards() | ||
console.log(cards) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
getCards() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Bloc } from '../../dist' | ||
|
||
const bloc = new Bloc('secret-keyasfasfbahfb', 'public-key') | ||
|
||
const getCustomerCards = async () => { | ||
try { | ||
const cards = await bloc.getCustomerCards('customer-id') | ||
console.log(cards) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
getCustomerCards() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Bloc, IIssueCardRequest } from '../../dist' | ||
|
||
const bloc = new Bloc('secret-keyasfasfbahfb', 'public-key') | ||
|
||
const issueCard = async () => { | ||
try { | ||
const data: IIssueCardRequest = { | ||
customer_id: '64c9e81497880d4b259cec77', | ||
brand: 'Verve', | ||
} | ||
const response = await bloc.issueCard(data) | ||
console.log(response) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
issueCard() |
Oops, something went wrong.