Download the PHP package stadem/viva-payments without Composer

On this page you can find all versions of the php package stadem/viva-payments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package viva-payments

Viva Payments - Minimal Dependencies

Latest Version on Packagist Build Status Code Quality Code Intelligence Status

This package provides a streamlined interface for the Viva Wallet Payment API, enabling seamless integration with Smart Checkout, Webhooks, and support for both API v1 and API v2 calls.

Features

Installation

Install the package through Composer.

This package requires PHP 8.2 + and no other dependencies.

Configuration

Rename viva-config.php.example to viva-config.php and add your credentials.

Add the following data on your viva-config.php.

And for you local environment

And for you production

The total file config.php

Read more about API authentication on the Developer Portal: https://developer.vivawallet.com/getting-started/find-your-account-credentials/client-smart-checkout-credentials/

Usage

Full example

Get the Access Token

Here’s a quick example of how to get started:

To interact with the Viva Wallet API, you'll first need to obtain an access token. Here’s a quick example of how to get started:

'vivaPROD' => [ Create a file and add the following code, you can switch from the vivaDEMO to vivaProd evn.

Additionaly you can access to token and status code by using

Create new customer

You can set the requestLang with multiple ways by type or value. For further details refer to src\VivaPayments\Enums\RequestLang

Create Payment order


amount \ The amount associated with this payment order *100. Must be a positive, non-zero number
customerTrns \ This optional parameter adds a friendly description to the payment order that you want to display to the customer on the payment form. It should be a short description of the
paymentTimeout \ By using this parameter, you can define a different life span for the Payment Order in sec
preauth \ This will hold the selected amount as unavailable (without the customer being charged) for a period of time
allowRecurring \ If this parameter is set to true, recurring payments are enabled so that the initial transaction ID can be used for subsequent payments. https://developer.viva.com/tutorials/payments/create-a-recurring-payment/
maxInstallments \ The maximum number of installments that the customer can choose for this transaction
forceMaxInstallments \ If this parameter is set to true, the customer will be forced to pay with installments and with the specific number indicated in maxInstallments parameter
paymentNotification \ If you wish to create a payment order, and then send out an email to the customer to request payment
tipAmount \ The tip value (if Applicable for the customer's purchase) which is already included in the amount of the payment order and marked as tip
disableExactAmount \ If this parameter is set to true, then any amount specified in the payment order is ignored (although still mandatory), and the customer is asked to indicate the amount they will pay
disableCash \ If this parameter is set to true, the customer will not have the option to pay in cash at a Viva Spot
disableWallet \ If this parameter is set to true, the customer will not have the option to pay using their Viva personal account (wallet)
cardTokens \ You can provide the card tokens you have saved on your backend for this customer. The card tokens will then be presented to the customer on Smart Checkout to pay with. For details, view our Handle Card
merchantTrns \ This can be either an ID or a short description that helps you uniquely identify the transaction in the viva banking App
tags \ You can add several tags to a transaction that will help in grouping and filtering in the viva banking App

Create the payment order

The amount requested in cents is required. All the other parameters are optional. Check out the request body schema.

Run tests via PEST & PHP STAN

You can run tests via PEST with the following command

Upcoming Features

Marketplace API Support: Future updates will include support for marketplace-related API calls.

Documentation

For comprehensive documentation, please visit the Viva Wallet Developer Portal.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss potential changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Disclaimer

Note: This is an unofficial package, and its usage is at your own discretion.


All versions of viva-payments with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stadem/viva-payments contains the following files

Loading the files please wait ....