apility / vipps
Vipps PHP Library
Installs: 8 757
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 3
Open Issues: 1
Requires
- php: ^7.4.0|^8.0
- netflex/http: *
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.6
- phpunit/phpunit: ^6.5
- squizlabs/php_codesniffer: ^3.4
README
Advanced usage
Official Vipps API documentation
Installation
composer require apility/vipps
Basic usage
<?php use Vipps\Vipps; use Vipps\Config; use Vipps\Ecommerce\Payment; // The given values are just for illustration Vipps::setConfig(Config::create([ 'endpoint' => 'https://apitest.vipps.no', 'clientId' => '12345678-1234-5678-1234-56781234', 'clientSecret' => 'A1bcdEFGHijkL2MNOpQrsTUVW34=', 'merchantSerialNumber' => 10000, 'accessTokenSubscriptionKey' => '123456789abcdef123456789abcdef12', 'ecommerceSubscriptionKey' => '123456789abcdef123456789abcdef12', 'callbackPrefix' => 'https://domain.tld/callback', 'fallBack' => 'https://domain.tld/fallback' ])); $payment = Payment::create([ 'customerInfo' => [ 'mobileNumber' => '12345678' ], 'transaction' => [ 'amount' => 1337 //1337.00 NOK, 'transactionText' => 'Hello World!' ] ]); $payment->charge(); header('Location: ' . $payment->url); die();