Skip to content

Virtual Cards

Abraham Olaobaju edited this page Aug 4, 2023 · 6 revisions

Overview

A virtual card is a payment method that is virtual rather than physical. Virtual cards offer enhanced security compared to physical cards. Since the virtual card details are unique and different from the user's physical card, the risk of fraud or identity theft is reduced. Virtual cards can also be disabled or deleted if they are lost or stolen.

Create A Virtual Card

How to create a virtual card on Flutterwave.

<?php

use Flutterwave\Payload;
use Flutterwave\Service\VirtualCard;
use Flutterwave\Util\Currency;

$payload = new Payload();
$service = new new VirtualCard();
$payload->set("first_name","PHP");
$payload->set("last_name","SDK");
$payload->set("date_of_birth","1994-03-01");
$payload->set("title","Mr");
$payload->set("gender","M"); //M or F
$payload->set("email","developers@flutterwavego.com");
$payload->set("currency", Currency::NGN);
$payload->set("amount", "5000");
$payload->set("debit_currency", Currency::NGN);
$payload->set("phone", "+234505394568");
$payload->set("billing_name", "Abraham Ola");
$payload->set("firstname", "Abraham");
$response = $service->create($payload);
print_r($response);

Get All Virtual Cards

Fetches all virtual cards you have created.

<?php
use Flutterwave\Service\VirtualCard;

$service = new VirtualCard();
$request = $service->list();
print_r($request);

Get A Virtual Card

This call gets a specific virtual card by ID.

<?php
use Flutterwave\Service\VirtualCard;

$service = new VirtualCard();
$request = $service->get($id);
print_r($request);

Fund A Virtual Card

This funds a specific virtual card.

<?php
use Flutterwave\Service\VirtualCard;

$data = [
      "amount"=>"3500",
      "debit_currency" => Currency::NGN
];
$service = new VirtualCard();
$request = $service->fund($id, $data);

Clone this wiki locally