PHPackages                             flydev-fr/vivawallet-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. flydev-fr/vivawallet-php

ActiveLibrary[API Development](/categories/api)

flydev-fr/vivawallet-php
========================

Viva Wallet Native Checkout V2 API PHP Wrapper Library

1.0.0(5y ago)014MITPHPPHP &gt;=7.3.0

Since Jan 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/flydev-fr/VivaWallet-php)[ Packagist](https://packagist.org/packages/flydev-fr/vivawallet-php)[ Docs](https://github.com/flydev-fr/viva-walletwphp)[ RSS](/packages/flydev-fr-vivawallet-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Viva Wallet Native Checkout V2 API PHP Wrapper Library
======================================================

[](#viva-wallet-native-checkout-v2-api-php-wrapper-library)

This is a wrapper for Native Checkout V2 API of Viva Wallet:

How to use
----------

[](#how-to-use)

This library is installed via [Composer](http://getcomposer.org/). You will need to require `flydev-fr/viva-php`:

```
composer require flydev-fr/viva-php:~1.0

```

Prerequisites
-------------

[](#prerequisites)

Complete prerequisite steps from  and obtain your `Client ID` and `Client Secret`. You'll need to set up a payment source with Native Checkout V2 as the integration method and get a `Source Code`.

Get card charge token
---------------------

[](#get-card-charge-token)

Create payment form and `Charge Token` at front end as described here: You'll need to have `Access Token` and `Base URL` at front end and you can get them as follows:

```
$baseUrl = \FlydevFr\Viva\Transaction\Url::getUrl("[Test Mode]"); // Test mode, default is false

$accessToken = (new \FlydevFr\Viva\Account\Authorization())
	->setClientId("[Client ID]") // Client ID, Provided by wallet
	->setClientSecret("[Client Secret]") // Client Secret, Provided by wallet
	->setTestMode("[Test Mode]") // Test mode, default is false, can be skipped
	->getAccessToken();
```

Now, when you have `Charge Token` you can make actual transactions.

Transactions
------------

[](#transactions)

### CHARGE

[](#charge)

```
$customer = (new \FlydevFr\Viva\Transaction\Customer())
	->setEmail("[Customer Email]")
	->setPhone("[Customer Phone]")
	->setFullName("[Customer Full Name]");

$transaction = (new FlydevFr\Viva\Transaction\Charge())
	->setClientId("[Client ID]") // Client ID, Provided by wallet
	->setClientSecret("[Client Secret]") // Client Secret, Provided by wallet
	->setTestMode("[Test Mode]") // Test mode, default is false, can be skipped
	->setSourceCode("[Source Code]") // Source code, provided by wallet
	->setAmount((int) "[Amount]") // The amount to charge in currency's smallest denomination (e.g amount in pounds x 100)
	->setInstallments((int) "[Installments]") // Installments, can be skipped if not used
	->setChargeToken("[Charge Token]") // Charge token obtained at front end
	->setCustomer($customer);

$result = $transaction->send();

if (!empty($transaction->getError())) {

	// Log the error message
	// $error = $transaction->getError();

} else {

	// Save transaction id
	// $transactionId = $result->transactionId;
}
```

### AUTHORIZATION

[](#authorization)

```
$customer = (new \FlydevFr\Viva\Transaction\Customer())
	->setEmail("[Customer Email]")
	->setPhone("[Customer Phone]")
	->setFullName("[Customer Full Name]");

$transaction = (new FlydevFr\Viva\Transaction\Authorization())
	->setClientId("[Client ID]") // Client ID, Provided by wallet
	->setClientSecret("[Client Secret]") // Client Secret, Provided by wallet
	->setTestMode("[Test Mode]") // Test mode, default is false, can be skipped
	->setSourceCode("[Source Code]") // Source code, provided by wallet
	->setAmount((int) "[Amount]") // The amount to pre-auth in currency's smallest denomination (e.g amount in pounds x 100)
	->setInstallments((int) "[Installments]") // Installments, can be skipped if not used
	->setChargeToken("[Charge Token]") // Charge token obtained at front end
	->setCustomer($customer);

$result = $transaction->send();

if (!empty($transaction->getError())) {

	// Log the error message
	// $error = $transaction->getError();

} else {

	// Save transaction id
	// $transactionId = $result->transactionId;
}
```

### CAPTURE

[](#capture)

Make sure you have recurring payments enabled in your account.

```
$transaction = (new \FlydevFr\Viva\Transaction\Capture())
	->setClientId("[Client ID]") // Client ID, Provided by wallet
	->setClientSecret("[Client Secret]") // Client Secret, Provided by wallet
	->setTestMode("[Test Mode]") // Test mode, default is false, can be skipped
	->setTransactionId("[Transaction ID]") // Transaction id of authorization transaction
	->setAmount((int) "[Amount]"); // The amount to capture in currency's smallest denomination (e.g amount in pounds x 100)

$result = $transaction->send();

if (!empty($transaction->getError())) {

	// Log the error message
	// $error = $transaction->getError();
} else {

	// Save transaction id
	// $transactionId = $result->transactionId;
}
```

### CANCEL

[](#cancel)

Make sure you have refunds enabled in your account.

```
$transaction = (new \FlydevFr\Viva\Transaction\Cancel())
	->setClientId("[Client ID]") // Client ID, Provided by wallet
	->setClientSecret("[Client Secret]") // Client Secret, Provided by wallet
	->setTestMode("[Test Mode]") // Test mode, default is false, can be skipped
	->setSourceCode("[Source Code]") // Source code, provided by wallet
	->setTransactionId("[Transaction ID]") // Transaction id of charge, authorization or capture transaction
	->setAmount((int) "[Amount]"); // The amount to refund in currency's smallest denomination (e.g amount in pounds x 100)

$result = $transaction->send();

if (!empty($transaction->getError())) {

	// Log the error message
	// $error = $transaction->getError();
} else {

	// Save transaction id
	// $transactionId = $result->transactionId;
}
```

Get charge token at backend
---------------------------

[](#get-charge-token-at-backend)

It's possible to get charge token at backend. It may be required in custom integration, more details can be found here:

```
$transaction = (new \FlydevFr\Viva\Transaction\ChargeToken())
	->setClientId("[Client ID]") // Client ID, Provided by wallet
	->setClientSecret("[Client Secret]") // Client Secret, Provided by wallet
	->setTestMode("[Test Mode]") // Test mode, default is false, can be skipped
	->setAmount((int) "[Amount]"); // The amount in currency's smallest denomination (e.g amount in pounds x 100)
	->setCvc("[Cvc code]") // Card cvc code
	->setNumber("[Card number]") // Card number
	->setHolderName("[Holder name]") // Card holder name
	->setExpirationYear((int) "[Expiration Year]") // Card expiration year
	->setExpirationMonth((int) "[Expiration Month]") // Card expiration month
	->setSessionRedirectUrl("[Session redirect url]"); // Url to redirect when authentication session finished

$result = $transaction->send();

if (!empty($transaction->getError())) {

	// Log the error message
	// $error = $transaction->getError();
} else {

	// Get charge token
	// $chargeToken = $result->chargeToken;
	// $redirectToACSForm = $result->redirectToACSForm;
}
```

Check for installments
----------------------

[](#check-for-installments)

Retrieve the maximum number of installments allowed on a card.

```
$transaction = (new \FlydevFr\Viva\Transaction\Installments())
	->setClientId("[Client ID]") // Client ID, Provided by wallet
	->setClientSecret("[Client Secret]") // Client Secret, Provided by wallet
	->setTestMode("[Test Mode]") // Test mode, default is false, can be skipped
	->setNumber("[Card number]"); // Card number

$result = $transaction->send();

if (!empty($transaction->getError())) {

	// Log the error message
	// $error = $transaction->getError();
} else {

	// Get number of installments
	// $installments = $result->maxInstallments;
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1951d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ee3fedde5a52f28ba561eac6ba6ca5403e40f6e57769a0d5ec88c122d4c5048?d=identicon)[flydev-fr](/maintainers/flydev-fr)

---

Top Contributors

[![flydev-fr](https://avatars.githubusercontent.com/u/11658616?v=4)](https://github.com/flydev-fr "flydev-fr (3 commits)")

---

Tags

apipaymentwalletcheckoutnativev2viva

### Embed Badge

![Health badge](/badges/flydev-fr-vivawallet-php/health.svg)

```
[![Health](https://phpackages.com/badges/flydev-fr-vivawallet-php/health.svg)](https://phpackages.com/packages/flydev-fr-vivawallet-php)
```

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[blocktrail/blocktrail-sdk

The BlockTrail PHP SDK, for integration of Bitcoin functionality through the BlockTrail API

4921.1k3](/packages/blocktrail-blocktrail-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
