{"id":26193228,"url":"https://github.com/flydev-fr/vivawallet-php","last_synced_at":"2026-06-22T18:32:01.340Z","repository":{"id":62505940,"uuid":"326798085","full_name":"flydev-fr/VivaWallet-php","owner":"flydev-fr","description":"VivaWallet Native Checkout v2 Wrapper","archived":false,"fork":false,"pushed_at":"2021-01-04T20:45:41.000Z","size":12,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-07T17:55:16.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flydev-fr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-04T20:18:50.000Z","updated_at":"2021-01-04T20:34:10.000Z","dependencies_parsed_at":"2022-11-02T10:15:40.160Z","dependency_job_id":null,"html_url":"https://github.com/flydev-fr/VivaWallet-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flydev-fr%2FVivaWallet-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flydev-fr%2FVivaWallet-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flydev-fr%2FVivaWallet-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flydev-fr%2FVivaWallet-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flydev-fr","download_url":"https://codeload.github.com/flydev-fr/VivaWallet-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243141286,"owners_count":20242815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-12T01:37:34.717Z","updated_at":"2026-06-22T18:32:01.334Z","avatar_url":"https://github.com/flydev-fr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Viva Wallet Native Checkout V2 API PHP Wrapper Library\n\nThis is a wrapper for Native Checkout V2 API of Viva Wallet: https://developer.vivawallet.com/online-checkouts/native-checkout-v2/\n\n## How to use\n\nThis library is installed via [Composer](http://getcomposer.org/). You will need to require `flydev-fr/viva-php`:\n\n```\ncomposer require flydev-fr/viva-php:~1.0\n```\n\n## Prerequisites\n\nComplete prerequisite steps from https://developer.vivawallet.com/online-checkouts/native-checkout-v2/ and obtain your `Client ID` and `Client Secret`.\nYou'll need to set up a payment source with Native Checkout V2  as the integration method and get a `Source Code`.\n\n## Get card charge token\n\nCreate payment form and `Charge Token` at front end as described here: https://developer.vivawallet.com/online-checkouts/native-checkout-v2/\nYou'll need to have `Access Token` and `Base URL` at front end and you can get them as follows:\n\n```php\n$baseUrl = \\FlydevFr\\Viva\\Transaction\\Url::getUrl(\"[Test Mode]\"); // Test mode, default is false\n\n$accessToken = (new \\FlydevFr\\Viva\\Account\\Authorization())\n\t-\u003esetClientId(\"[Client ID]\") // Client ID, Provided by wallet\n\t-\u003esetClientSecret(\"[Client Secret]\") // Client Secret, Provided by wallet\n\t-\u003esetTestMode(\"[Test Mode]\") // Test mode, default is false, can be skipped\n\t-\u003egetAccessToken();\n```\n\nNow, when you have `Charge Token` you can make actual transactions.\n\n## Transactions\n\n### CHARGE\n\n```php\n$customer = (new \\FlydevFr\\Viva\\Transaction\\Customer())\n\t-\u003esetEmail(\"[Customer Email]\")\n\t-\u003esetPhone(\"[Customer Phone]\")\n\t-\u003esetFullName(\"[Customer Full Name]\");\n\n$transaction = (new FlydevFr\\Viva\\Transaction\\Charge())\n\t-\u003esetClientId(\"[Client ID]\") // Client ID, Provided by wallet\n\t-\u003esetClientSecret(\"[Client Secret]\") // Client Secret, Provided by wallet\n\t-\u003esetTestMode(\"[Test Mode]\") // Test mode, default is false, can be skipped\n\t-\u003esetSourceCode(\"[Source Code]\") // Source code, provided by wallet\n\t-\u003esetAmount((int) \"[Amount]\") // The amount to charge in currency's smallest denomination (e.g amount in pounds x 100)\n\t-\u003esetInstallments((int) \"[Installments]\") // Installments, can be skipped if not used\n\t-\u003esetChargeToken(\"[Charge Token]\") // Charge token obtained at front end\n\t-\u003esetCustomer($customer);\n\n$result = $transaction-\u003esend();\n\nif (!empty($transaction-\u003egetError())) {\n\n\t// Log the error message\n\t// $error = $transaction-\u003egetError();\n\n} else {\n\n\t// Save transaction id\n\t// $transactionId = $result-\u003etransactionId;\n}\n```\n\n### AUTHORIZATION\n\n```php\n$customer = (new \\FlydevFr\\Viva\\Transaction\\Customer())\n\t-\u003esetEmail(\"[Customer Email]\")\n\t-\u003esetPhone(\"[Customer Phone]\")\n\t-\u003esetFullName(\"[Customer Full Name]\");\n\n$transaction = (new FlydevFr\\Viva\\Transaction\\Authorization())\n\t-\u003esetClientId(\"[Client ID]\") // Client ID, Provided by wallet\n\t-\u003esetClientSecret(\"[Client Secret]\") // Client Secret, Provided by wallet\n\t-\u003esetTestMode(\"[Test Mode]\") // Test mode, default is false, can be skipped\n\t-\u003esetSourceCode(\"[Source Code]\") // Source code, provided by wallet\n\t-\u003esetAmount((int) \"[Amount]\") // The amount to pre-auth in currency's smallest denomination (e.g amount in pounds x 100)\n\t-\u003esetInstallments((int) \"[Installments]\") // Installments, can be skipped if not used\n\t-\u003esetChargeToken(\"[Charge Token]\") // Charge token obtained at front end\n\t-\u003esetCustomer($customer);\n\n$result = $transaction-\u003esend();\n\nif (!empty($transaction-\u003egetError())) {\n\n\t// Log the error message\n\t// $error = $transaction-\u003egetError();\n\n} else {\n\n\t// Save transaction id\n\t// $transactionId = $result-\u003etransactionId;\n}\n```\n\n### CAPTURE\n\nMake sure you have recurring payments enabled in your account.\n\n```php\n$transaction = (new \\FlydevFr\\Viva\\Transaction\\Capture())\n\t-\u003esetClientId(\"[Client ID]\") // Client ID, Provided by wallet\n\t-\u003esetClientSecret(\"[Client Secret]\") // Client Secret, Provided by wallet\n\t-\u003esetTestMode(\"[Test Mode]\") // Test mode, default is false, can be skipped\n\t-\u003esetTransactionId(\"[Transaction ID]\") // Transaction id of authorization transaction\n\t-\u003esetAmount((int) \"[Amount]\"); // The amount to capture in currency's smallest denomination (e.g amount in pounds x 100)\n\n$result = $transaction-\u003esend();\n\nif (!empty($transaction-\u003egetError())) {\n\n\t// Log the error message\n\t// $error = $transaction-\u003egetError();\n} else {\n\n\t// Save transaction id\n\t// $transactionId = $result-\u003etransactionId;\n}\n```\n\n### CANCEL\n\nMake sure you have refunds enabled in your account.\n\n```php\n$transaction = (new \\FlydevFr\\Viva\\Transaction\\Cancel())\n\t-\u003esetClientId(\"[Client ID]\") // Client ID, Provided by wallet\n\t-\u003esetClientSecret(\"[Client Secret]\") // Client Secret, Provided by wallet\n\t-\u003esetTestMode(\"[Test Mode]\") // Test mode, default is false, can be skipped\n\t-\u003esetSourceCode(\"[Source Code]\") // Source code, provided by wallet\n\t-\u003esetTransactionId(\"[Transaction ID]\") // Transaction id of charge, authorization or capture transaction\n\t-\u003esetAmount((int) \"[Amount]\"); // The amount to refund in currency's smallest denomination (e.g amount in pounds x 100)\n\n$result = $transaction-\u003esend();\n\nif (!empty($transaction-\u003egetError())) {\n\n\t// Log the error message\n\t// $error = $transaction-\u003egetError();\n} else {\n\n\t// Save transaction id\n\t// $transactionId = $result-\u003etransactionId;\n}\n```\n\n## Get charge token at backend\n\nIt's possible to get charge token at backend. It may be required in custom integration, more details can be found here: https://developer.vivawallet.com/online-checkouts/native-checkout-v2/\n\n```php\n$transaction = (new \\FlydevFr\\Viva\\Transaction\\ChargeToken())\n\t-\u003esetClientId(\"[Client ID]\") // Client ID, Provided by wallet\n\t-\u003esetClientSecret(\"[Client Secret]\") // Client Secret, Provided by wallet\n\t-\u003esetTestMode(\"[Test Mode]\") // Test mode, default is false, can be skipped\n\t-\u003esetAmount((int) \"[Amount]\"); // The amount in currency's smallest denomination (e.g amount in pounds x 100)\n\t-\u003esetCvc(\"[Cvc code]\") // Card cvc code\n\t-\u003esetNumber(\"[Card number]\") // Card number\n\t-\u003esetHolderName(\"[Holder name]\") // Card holder name\n\t-\u003esetExpirationYear((int) \"[Expiration Year]\") // Card expiration year\n\t-\u003esetExpirationMonth((int) \"[Expiration Month]\") // Card expiration month\n\t-\u003esetSessionRedirectUrl(\"[Session redirect url]\"); // Url to redirect when authentication session finished\n\n$result = $transaction-\u003esend();\n\nif (!empty($transaction-\u003egetError())) {\n\n\t// Log the error message\n\t// $error = $transaction-\u003egetError();\n} else {\n\n\t// Get charge token\n\t// $chargeToken = $result-\u003echargeToken;\n\t// $redirectToACSForm = $result-\u003eredirectToACSForm;\n}\n```\n\n## Check for installments\n\nRetrieve the maximum number of installments allowed on a card.\n\n```php\n$transaction = (new \\FlydevFr\\Viva\\Transaction\\Installments())\n\t-\u003esetClientId(\"[Client ID]\") // Client ID, Provided by wallet\n\t-\u003esetClientSecret(\"[Client Secret]\") // Client Secret, Provided by wallet\n\t-\u003esetTestMode(\"[Test Mode]\") // Test mode, default is false, can be skipped\n\t-\u003esetNumber(\"[Card number]\"); // Card number\n\n$result = $transaction-\u003esend();\n\nif (!empty($transaction-\u003egetError())) {\n\n\t// Log the error message\n\t// $error = $transaction-\u003egetError();\n} else {\n\n\t// Get number of installments\n\t// $installments = $result-\u003emaxInstallments;\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflydev-fr%2Fvivawallet-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflydev-fr%2Fvivawallet-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflydev-fr%2Fvivawallet-php/lists"}