├── .gitignore ├── composer.json ├── composer.lock ├── config ├── api.php └── dragonpay.php ├── phpunit.xml ├── src ├── DragonpayApi.php ├── Facades │ └── Dragonpay.php ├── Providers │ └── DragonpayServiceProvider.php ├── Transaction │ ├── RestTransaction.php │ └── TransactionInterface.php └── UrlGenerator │ ├── RestUrlGenerator.php │ └── UrlGeneratorInterface.php └── tests ├── DragonpayApiTest.php ├── RestTransactionTest.php └── RestUrlGeneratorTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | vendor/ 3 | *.TODO 4 | *logs/ 5 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "coreproc/dragonpay", 3 | "authors": [ 4 | { 5 | "name": "Justin de Leon", 6 | "email": "jusmdeleon@gmail.com" 7 | } 8 | ], 9 | "autoload": { 10 | "psr-4": { 11 | "Coreproc\\Dragonpay\\": "src" 12 | }, 13 | "files": [ 14 | "config/api.php" 15 | ] 16 | }, 17 | "require": { 18 | "guzzlehttp/guzzle": "^6.0", 19 | "katzgrau/klogger": "^1.2" 20 | }, 21 | "require-dev": { 22 | "phpunit/phpunit": "^4.7", 23 | "mockery/mockery": "^0.9.4" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "12d52d67a5a0650c92e21d37bcddcb4b", 8 | "packages": [ 9 | { 10 | "name": "guzzlehttp/guzzle", 11 | "version": "6.0.2", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/guzzle/guzzle.git", 15 | "reference": "a8dfeff00eb84616a17fea7a4d72af35e750410f" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a8dfeff00eb84616a17fea7a4d72af35e750410f", 20 | "reference": "a8dfeff00eb84616a17fea7a4d72af35e750410f", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "guzzlehttp/promises": "~1.0", 25 | "guzzlehttp/psr7": "~1.1", 26 | "php": ">=5.5.0" 27 | }, 28 | "require-dev": { 29 | "ext-curl": "*", 30 | "phpunit/phpunit": "~4.0", 31 | "psr/log": "~1.0" 32 | }, 33 | "type": "library", 34 | "extra": { 35 | "branch-alias": { 36 | "dev-master": "6.0-dev" 37 | } 38 | }, 39 | "autoload": { 40 | "files": [ 41 | "src/functions_include.php" 42 | ], 43 | "psr-4": { 44 | "GuzzleHttp\\": "src/" 45 | } 46 | }, 47 | "notification-url": "https://packagist.org/downloads/", 48 | "license": [ 49 | "MIT" 50 | ], 51 | "authors": [ 52 | { 53 | "name": "Michael Dowling", 54 | "email": "mtdowling@gmail.com", 55 | "homepage": "https://github.com/mtdowling" 56 | } 57 | ], 58 | "description": "Guzzle is a PHP HTTP client library", 59 | "homepage": "http://guzzlephp.org/", 60 | "keywords": [ 61 | "client", 62 | "curl", 63 | "framework", 64 | "http", 65 | "http client", 66 | "rest", 67 | "web service" 68 | ], 69 | "time": "2015-07-04 20:09:24" 70 | }, 71 | { 72 | "name": "guzzlehttp/promises", 73 | "version": "1.0.2", 74 | "source": { 75 | "type": "git", 76 | "url": "https://github.com/guzzle/promises.git", 77 | "reference": "97fe7210def29451ec74923b27e552238defd75a" 78 | }, 79 | "dist": { 80 | "type": "zip", 81 | "url": "https://api.github.com/repos/guzzle/promises/zipball/97fe7210def29451ec74923b27e552238defd75a", 82 | "reference": "97fe7210def29451ec74923b27e552238defd75a", 83 | "shasum": "" 84 | }, 85 | "require": { 86 | "php": ">=5.5.0" 87 | }, 88 | "require-dev": { 89 | "phpunit/phpunit": "~4.0" 90 | }, 91 | "type": "library", 92 | "extra": { 93 | "branch-alias": { 94 | "dev-master": "1.0-dev" 95 | } 96 | }, 97 | "autoload": { 98 | "psr-4": { 99 | "GuzzleHttp\\Promise\\": "src/" 100 | }, 101 | "files": [ 102 | "src/functions_include.php" 103 | ] 104 | }, 105 | "notification-url": "https://packagist.org/downloads/", 106 | "license": [ 107 | "MIT" 108 | ], 109 | "authors": [ 110 | { 111 | "name": "Michael Dowling", 112 | "email": "mtdowling@gmail.com", 113 | "homepage": "https://github.com/mtdowling" 114 | } 115 | ], 116 | "description": "Guzzle promises library", 117 | "keywords": [ 118 | "promise" 119 | ], 120 | "time": "2015-08-15 19:37:21" 121 | }, 122 | { 123 | "name": "guzzlehttp/psr7", 124 | "version": "1.2.0", 125 | "source": { 126 | "type": "git", 127 | "url": "https://github.com/guzzle/psr7.git", 128 | "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e" 129 | }, 130 | "dist": { 131 | "type": "zip", 132 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", 133 | "reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e", 134 | "shasum": "" 135 | }, 136 | "require": { 137 | "php": ">=5.4.0", 138 | "psr/http-message": "~1.0" 139 | }, 140 | "provide": { 141 | "psr/http-message-implementation": "1.0" 142 | }, 143 | "require-dev": { 144 | "phpunit/phpunit": "~4.0" 145 | }, 146 | "type": "library", 147 | "extra": { 148 | "branch-alias": { 149 | "dev-master": "1.0-dev" 150 | } 151 | }, 152 | "autoload": { 153 | "psr-4": { 154 | "GuzzleHttp\\Psr7\\": "src/" 155 | }, 156 | "files": [ 157 | "src/functions_include.php" 158 | ] 159 | }, 160 | "notification-url": "https://packagist.org/downloads/", 161 | "license": [ 162 | "MIT" 163 | ], 164 | "authors": [ 165 | { 166 | "name": "Michael Dowling", 167 | "email": "mtdowling@gmail.com", 168 | "homepage": "https://github.com/mtdowling" 169 | } 170 | ], 171 | "description": "PSR-7 message implementation", 172 | "keywords": [ 173 | "http", 174 | "message", 175 | "stream", 176 | "uri" 177 | ], 178 | "time": "2015-08-15 19:32:36" 179 | }, 180 | { 181 | "name": "katzgrau/klogger", 182 | "version": "dev-master", 183 | "source": { 184 | "type": "git", 185 | "url": "https://github.com/katzgrau/KLogger.git", 186 | "reference": "6e530b7c0579c69488fabbff9f307d2d2591039e" 187 | }, 188 | "dist": { 189 | "type": "zip", 190 | "url": "https://api.github.com/repos/katzgrau/KLogger/zipball/6e530b7c0579c69488fabbff9f307d2d2591039e", 191 | "reference": "6e530b7c0579c69488fabbff9f307d2d2591039e", 192 | "shasum": "" 193 | }, 194 | "require": { 195 | "php": ">=5.3", 196 | "psr/log": "1.0.0" 197 | }, 198 | "require-dev": { 199 | "phpunit/phpunit": "4.0.*" 200 | }, 201 | "type": "library", 202 | "autoload": { 203 | "psr-4": { 204 | "Katzgrau\\KLogger\\": "src/" 205 | }, 206 | "classmap": [ 207 | "src/" 208 | ] 209 | }, 210 | "notification-url": "https://packagist.org/downloads/", 211 | "license": [ 212 | "MIT" 213 | ], 214 | "authors": [ 215 | { 216 | "name": "Kenny Katzgrau", 217 | "email": "katzgrau@gmail.com" 218 | }, 219 | { 220 | "name": "Dan Horrigan", 221 | "email": "dan@dhorrigan.com" 222 | } 223 | ], 224 | "description": "A Simple Logging Class", 225 | "keywords": [ 226 | "logging" 227 | ], 228 | "time": "2015-04-27 14:06:51" 229 | }, 230 | { 231 | "name": "psr/http-message", 232 | "version": "1.0", 233 | "source": { 234 | "type": "git", 235 | "url": "https://github.com/php-fig/http-message.git", 236 | "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" 237 | }, 238 | "dist": { 239 | "type": "zip", 240 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", 241 | "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", 242 | "shasum": "" 243 | }, 244 | "require": { 245 | "php": ">=5.3.0" 246 | }, 247 | "type": "library", 248 | "extra": { 249 | "branch-alias": { 250 | "dev-master": "1.0.x-dev" 251 | } 252 | }, 253 | "autoload": { 254 | "psr-4": { 255 | "Psr\\Http\\Message\\": "src/" 256 | } 257 | }, 258 | "notification-url": "https://packagist.org/downloads/", 259 | "license": [ 260 | "MIT" 261 | ], 262 | "authors": [ 263 | { 264 | "name": "PHP-FIG", 265 | "homepage": "http://www.php-fig.org/" 266 | } 267 | ], 268 | "description": "Common interface for HTTP messages", 269 | "keywords": [ 270 | "http", 271 | "http-message", 272 | "psr", 273 | "psr-7", 274 | "request", 275 | "response" 276 | ], 277 | "time": "2015-05-04 20:22:00" 278 | }, 279 | { 280 | "name": "psr/log", 281 | "version": "1.0.0", 282 | "source": { 283 | "type": "git", 284 | "url": "https://github.com/php-fig/log.git", 285 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" 286 | }, 287 | "dist": { 288 | "type": "zip", 289 | "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", 290 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", 291 | "shasum": "" 292 | }, 293 | "type": "library", 294 | "autoload": { 295 | "psr-0": { 296 | "Psr\\Log\\": "" 297 | } 298 | }, 299 | "notification-url": "https://packagist.org/downloads/", 300 | "license": [ 301 | "MIT" 302 | ], 303 | "authors": [ 304 | { 305 | "name": "PHP-FIG", 306 | "homepage": "http://www.php-fig.org/" 307 | } 308 | ], 309 | "description": "Common interface for logging libraries", 310 | "keywords": [ 311 | "log", 312 | "psr", 313 | "psr-3" 314 | ], 315 | "time": "2012-12-21 11:40:51" 316 | } 317 | ], 318 | "packages-dev": [ 319 | { 320 | "name": "doctrine/instantiator", 321 | "version": "1.0.5", 322 | "source": { 323 | "type": "git", 324 | "url": "https://github.com/doctrine/instantiator.git", 325 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" 326 | }, 327 | "dist": { 328 | "type": "zip", 329 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", 330 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", 331 | "shasum": "" 332 | }, 333 | "require": { 334 | "php": ">=5.3,<8.0-DEV" 335 | }, 336 | "require-dev": { 337 | "athletic/athletic": "~0.1.8", 338 | "ext-pdo": "*", 339 | "ext-phar": "*", 340 | "phpunit/phpunit": "~4.0", 341 | "squizlabs/php_codesniffer": "~2.0" 342 | }, 343 | "type": "library", 344 | "extra": { 345 | "branch-alias": { 346 | "dev-master": "1.0.x-dev" 347 | } 348 | }, 349 | "autoload": { 350 | "psr-4": { 351 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 352 | } 353 | }, 354 | "notification-url": "https://packagist.org/downloads/", 355 | "license": [ 356 | "MIT" 357 | ], 358 | "authors": [ 359 | { 360 | "name": "Marco Pivetta", 361 | "email": "ocramius@gmail.com", 362 | "homepage": "http://ocramius.github.com/" 363 | } 364 | ], 365 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 366 | "homepage": "https://github.com/doctrine/instantiator", 367 | "keywords": [ 368 | "constructor", 369 | "instantiate" 370 | ], 371 | "time": "2015-06-14 21:17:01" 372 | }, 373 | { 374 | "name": "hamcrest/hamcrest-php", 375 | "version": "v1.2.2", 376 | "source": { 377 | "type": "git", 378 | "url": "https://github.com/hamcrest/hamcrest-php.git", 379 | "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" 380 | }, 381 | "dist": { 382 | "type": "zip", 383 | "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", 384 | "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", 385 | "shasum": "" 386 | }, 387 | "require": { 388 | "php": ">=5.3.2" 389 | }, 390 | "replace": { 391 | "cordoval/hamcrest-php": "*", 392 | "davedevelopment/hamcrest-php": "*", 393 | "kodova/hamcrest-php": "*" 394 | }, 395 | "require-dev": { 396 | "phpunit/php-file-iterator": "1.3.3", 397 | "satooshi/php-coveralls": "dev-master" 398 | }, 399 | "type": "library", 400 | "autoload": { 401 | "classmap": [ 402 | "hamcrest" 403 | ], 404 | "files": [ 405 | "hamcrest/Hamcrest.php" 406 | ] 407 | }, 408 | "notification-url": "https://packagist.org/downloads/", 409 | "license": [ 410 | "BSD" 411 | ], 412 | "description": "This is the PHP port of Hamcrest Matchers", 413 | "keywords": [ 414 | "test" 415 | ], 416 | "time": "2015-05-11 14:41:42" 417 | }, 418 | { 419 | "name": "mockery/mockery", 420 | "version": "0.9.4", 421 | "source": { 422 | "type": "git", 423 | "url": "https://github.com/padraic/mockery.git", 424 | "reference": "70bba85e4aabc9449626651f48b9018ede04f86b" 425 | }, 426 | "dist": { 427 | "type": "zip", 428 | "url": "https://api.github.com/repos/padraic/mockery/zipball/70bba85e4aabc9449626651f48b9018ede04f86b", 429 | "reference": "70bba85e4aabc9449626651f48b9018ede04f86b", 430 | "shasum": "" 431 | }, 432 | "require": { 433 | "hamcrest/hamcrest-php": "~1.1", 434 | "lib-pcre": ">=7.0", 435 | "php": ">=5.3.2" 436 | }, 437 | "require-dev": { 438 | "phpunit/phpunit": "~4.0" 439 | }, 440 | "type": "library", 441 | "extra": { 442 | "branch-alias": { 443 | "dev-master": "0.9.x-dev" 444 | } 445 | }, 446 | "autoload": { 447 | "psr-0": { 448 | "Mockery": "library/" 449 | } 450 | }, 451 | "notification-url": "https://packagist.org/downloads/", 452 | "license": [ 453 | "BSD-3-Clause" 454 | ], 455 | "authors": [ 456 | { 457 | "name": "Pádraic Brady", 458 | "email": "padraic.brady@gmail.com", 459 | "homepage": "http://blog.astrumfutura.com" 460 | }, 461 | { 462 | "name": "Dave Marshall", 463 | "email": "dave.marshall@atstsolutions.co.uk", 464 | "homepage": "http://davedevelopment.co.uk" 465 | } 466 | ], 467 | "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", 468 | "homepage": "http://github.com/padraic/mockery", 469 | "keywords": [ 470 | "BDD", 471 | "TDD", 472 | "library", 473 | "mock", 474 | "mock objects", 475 | "mockery", 476 | "stub", 477 | "test", 478 | "test double", 479 | "testing" 480 | ], 481 | "time": "2015-04-02 19:54:00" 482 | }, 483 | { 484 | "name": "phpdocumentor/reflection-docblock", 485 | "version": "2.0.4", 486 | "source": { 487 | "type": "git", 488 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 489 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" 490 | }, 491 | "dist": { 492 | "type": "zip", 493 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", 494 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", 495 | "shasum": "" 496 | }, 497 | "require": { 498 | "php": ">=5.3.3" 499 | }, 500 | "require-dev": { 501 | "phpunit/phpunit": "~4.0" 502 | }, 503 | "suggest": { 504 | "dflydev/markdown": "~1.0", 505 | "erusev/parsedown": "~1.0" 506 | }, 507 | "type": "library", 508 | "extra": { 509 | "branch-alias": { 510 | "dev-master": "2.0.x-dev" 511 | } 512 | }, 513 | "autoload": { 514 | "psr-0": { 515 | "phpDocumentor": [ 516 | "src/" 517 | ] 518 | } 519 | }, 520 | "notification-url": "https://packagist.org/downloads/", 521 | "license": [ 522 | "MIT" 523 | ], 524 | "authors": [ 525 | { 526 | "name": "Mike van Riel", 527 | "email": "mike.vanriel@naenius.com" 528 | } 529 | ], 530 | "time": "2015-02-03 12:10:50" 531 | }, 532 | { 533 | "name": "phpspec/prophecy", 534 | "version": "v1.4.1", 535 | "source": { 536 | "type": "git", 537 | "url": "https://github.com/phpspec/prophecy.git", 538 | "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" 539 | }, 540 | "dist": { 541 | "type": "zip", 542 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", 543 | "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", 544 | "shasum": "" 545 | }, 546 | "require": { 547 | "doctrine/instantiator": "^1.0.2", 548 | "phpdocumentor/reflection-docblock": "~2.0", 549 | "sebastian/comparator": "~1.1" 550 | }, 551 | "require-dev": { 552 | "phpspec/phpspec": "~2.0" 553 | }, 554 | "type": "library", 555 | "extra": { 556 | "branch-alias": { 557 | "dev-master": "1.4.x-dev" 558 | } 559 | }, 560 | "autoload": { 561 | "psr-0": { 562 | "Prophecy\\": "src/" 563 | } 564 | }, 565 | "notification-url": "https://packagist.org/downloads/", 566 | "license": [ 567 | "MIT" 568 | ], 569 | "authors": [ 570 | { 571 | "name": "Konstantin Kudryashov", 572 | "email": "ever.zet@gmail.com", 573 | "homepage": "http://everzet.com" 574 | }, 575 | { 576 | "name": "Marcello Duarte", 577 | "email": "marcello.duarte@gmail.com" 578 | } 579 | ], 580 | "description": "Highly opinionated mocking framework for PHP 5.3+", 581 | "homepage": "https://github.com/phpspec/prophecy", 582 | "keywords": [ 583 | "Double", 584 | "Dummy", 585 | "fake", 586 | "mock", 587 | "spy", 588 | "stub" 589 | ], 590 | "time": "2015-04-27 22:15:08" 591 | }, 592 | { 593 | "name": "phpunit/php-code-coverage", 594 | "version": "2.2.2", 595 | "source": { 596 | "type": "git", 597 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 598 | "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c" 599 | }, 600 | "dist": { 601 | "type": "zip", 602 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2d7c03c0e4e080901b8f33b2897b0577be18a13c", 603 | "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c", 604 | "shasum": "" 605 | }, 606 | "require": { 607 | "php": ">=5.3.3", 608 | "phpunit/php-file-iterator": "~1.3", 609 | "phpunit/php-text-template": "~1.2", 610 | "phpunit/php-token-stream": "~1.3", 611 | "sebastian/environment": "^1.3.2", 612 | "sebastian/version": "~1.0" 613 | }, 614 | "require-dev": { 615 | "ext-xdebug": ">=2.1.4", 616 | "phpunit/phpunit": "~4" 617 | }, 618 | "suggest": { 619 | "ext-dom": "*", 620 | "ext-xdebug": ">=2.2.1", 621 | "ext-xmlwriter": "*" 622 | }, 623 | "type": "library", 624 | "extra": { 625 | "branch-alias": { 626 | "dev-master": "2.2.x-dev" 627 | } 628 | }, 629 | "autoload": { 630 | "classmap": [ 631 | "src/" 632 | ] 633 | }, 634 | "notification-url": "https://packagist.org/downloads/", 635 | "license": [ 636 | "BSD-3-Clause" 637 | ], 638 | "authors": [ 639 | { 640 | "name": "Sebastian Bergmann", 641 | "email": "sb@sebastian-bergmann.de", 642 | "role": "lead" 643 | } 644 | ], 645 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 646 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 647 | "keywords": [ 648 | "coverage", 649 | "testing", 650 | "xunit" 651 | ], 652 | "time": "2015-08-04 03:42:39" 653 | }, 654 | { 655 | "name": "phpunit/php-file-iterator", 656 | "version": "1.4.1", 657 | "source": { 658 | "type": "git", 659 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 660 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" 661 | }, 662 | "dist": { 663 | "type": "zip", 664 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 665 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", 666 | "shasum": "" 667 | }, 668 | "require": { 669 | "php": ">=5.3.3" 670 | }, 671 | "type": "library", 672 | "extra": { 673 | "branch-alias": { 674 | "dev-master": "1.4.x-dev" 675 | } 676 | }, 677 | "autoload": { 678 | "classmap": [ 679 | "src/" 680 | ] 681 | }, 682 | "notification-url": "https://packagist.org/downloads/", 683 | "license": [ 684 | "BSD-3-Clause" 685 | ], 686 | "authors": [ 687 | { 688 | "name": "Sebastian Bergmann", 689 | "email": "sb@sebastian-bergmann.de", 690 | "role": "lead" 691 | } 692 | ], 693 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 694 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 695 | "keywords": [ 696 | "filesystem", 697 | "iterator" 698 | ], 699 | "time": "2015-06-21 13:08:43" 700 | }, 701 | { 702 | "name": "phpunit/php-text-template", 703 | "version": "1.2.1", 704 | "source": { 705 | "type": "git", 706 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 707 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 708 | }, 709 | "dist": { 710 | "type": "zip", 711 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 712 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 713 | "shasum": "" 714 | }, 715 | "require": { 716 | "php": ">=5.3.3" 717 | }, 718 | "type": "library", 719 | "autoload": { 720 | "classmap": [ 721 | "src/" 722 | ] 723 | }, 724 | "notification-url": "https://packagist.org/downloads/", 725 | "license": [ 726 | "BSD-3-Clause" 727 | ], 728 | "authors": [ 729 | { 730 | "name": "Sebastian Bergmann", 731 | "email": "sebastian@phpunit.de", 732 | "role": "lead" 733 | } 734 | ], 735 | "description": "Simple template engine.", 736 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 737 | "keywords": [ 738 | "template" 739 | ], 740 | "time": "2015-06-21 13:50:34" 741 | }, 742 | { 743 | "name": "phpunit/php-timer", 744 | "version": "1.0.7", 745 | "source": { 746 | "type": "git", 747 | "url": "https://github.com/sebastianbergmann/php-timer.git", 748 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" 749 | }, 750 | "dist": { 751 | "type": "zip", 752 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", 753 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", 754 | "shasum": "" 755 | }, 756 | "require": { 757 | "php": ">=5.3.3" 758 | }, 759 | "type": "library", 760 | "autoload": { 761 | "classmap": [ 762 | "src/" 763 | ] 764 | }, 765 | "notification-url": "https://packagist.org/downloads/", 766 | "license": [ 767 | "BSD-3-Clause" 768 | ], 769 | "authors": [ 770 | { 771 | "name": "Sebastian Bergmann", 772 | "email": "sb@sebastian-bergmann.de", 773 | "role": "lead" 774 | } 775 | ], 776 | "description": "Utility class for timing", 777 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 778 | "keywords": [ 779 | "timer" 780 | ], 781 | "time": "2015-06-21 08:01:12" 782 | }, 783 | { 784 | "name": "phpunit/php-token-stream", 785 | "version": "1.4.3", 786 | "source": { 787 | "type": "git", 788 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 789 | "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" 790 | }, 791 | "dist": { 792 | "type": "zip", 793 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", 794 | "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", 795 | "shasum": "" 796 | }, 797 | "require": { 798 | "ext-tokenizer": "*", 799 | "php": ">=5.3.3" 800 | }, 801 | "require-dev": { 802 | "phpunit/phpunit": "~4.2" 803 | }, 804 | "type": "library", 805 | "extra": { 806 | "branch-alias": { 807 | "dev-master": "1.4-dev" 808 | } 809 | }, 810 | "autoload": { 811 | "classmap": [ 812 | "src/" 813 | ] 814 | }, 815 | "notification-url": "https://packagist.org/downloads/", 816 | "license": [ 817 | "BSD-3-Clause" 818 | ], 819 | "authors": [ 820 | { 821 | "name": "Sebastian Bergmann", 822 | "email": "sebastian@phpunit.de" 823 | } 824 | ], 825 | "description": "Wrapper around PHP's tokenizer extension.", 826 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 827 | "keywords": [ 828 | "tokenizer" 829 | ], 830 | "time": "2015-06-19 03:43:16" 831 | }, 832 | { 833 | "name": "phpunit/phpunit", 834 | "version": "4.7.7", 835 | "source": { 836 | "type": "git", 837 | "url": "https://github.com/sebastianbergmann/phpunit.git", 838 | "reference": "9b97f9d807b862c2de2a36e86690000801c85724" 839 | }, 840 | "dist": { 841 | "type": "zip", 842 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", 843 | "reference": "9b97f9d807b862c2de2a36e86690000801c85724", 844 | "shasum": "" 845 | }, 846 | "require": { 847 | "ext-dom": "*", 848 | "ext-json": "*", 849 | "ext-pcre": "*", 850 | "ext-reflection": "*", 851 | "ext-spl": "*", 852 | "php": ">=5.3.3", 853 | "phpspec/prophecy": "~1.3,>=1.3.1", 854 | "phpunit/php-code-coverage": "~2.1", 855 | "phpunit/php-file-iterator": "~1.4", 856 | "phpunit/php-text-template": "~1.2", 857 | "phpunit/php-timer": ">=1.0.6", 858 | "phpunit/phpunit-mock-objects": "~2.3", 859 | "sebastian/comparator": "~1.1", 860 | "sebastian/diff": "~1.2", 861 | "sebastian/environment": "~1.2", 862 | "sebastian/exporter": "~1.2", 863 | "sebastian/global-state": "~1.0", 864 | "sebastian/version": "~1.0", 865 | "symfony/yaml": "~2.1|~3.0" 866 | }, 867 | "suggest": { 868 | "phpunit/php-invoker": "~1.1" 869 | }, 870 | "bin": [ 871 | "phpunit" 872 | ], 873 | "type": "library", 874 | "extra": { 875 | "branch-alias": { 876 | "dev-master": "4.7.x-dev" 877 | } 878 | }, 879 | "autoload": { 880 | "classmap": [ 881 | "src/" 882 | ] 883 | }, 884 | "notification-url": "https://packagist.org/downloads/", 885 | "license": [ 886 | "BSD-3-Clause" 887 | ], 888 | "authors": [ 889 | { 890 | "name": "Sebastian Bergmann", 891 | "email": "sebastian@phpunit.de", 892 | "role": "lead" 893 | } 894 | ], 895 | "description": "The PHP Unit Testing framework.", 896 | "homepage": "https://phpunit.de/", 897 | "keywords": [ 898 | "phpunit", 899 | "testing", 900 | "xunit" 901 | ], 902 | "time": "2015-07-13 11:28:34" 903 | }, 904 | { 905 | "name": "phpunit/phpunit-mock-objects", 906 | "version": "2.3.6", 907 | "source": { 908 | "type": "git", 909 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 910 | "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42" 911 | }, 912 | "dist": { 913 | "type": "zip", 914 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/18dfbcb81d05e2296c0bcddd4db96cade75e6f42", 915 | "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42", 916 | "shasum": "" 917 | }, 918 | "require": { 919 | "doctrine/instantiator": "~1.0,>=1.0.2", 920 | "php": ">=5.3.3", 921 | "phpunit/php-text-template": "~1.2", 922 | "sebastian/exporter": "~1.2" 923 | }, 924 | "require-dev": { 925 | "phpunit/phpunit": "~4.4" 926 | }, 927 | "suggest": { 928 | "ext-soap": "*" 929 | }, 930 | "type": "library", 931 | "extra": { 932 | "branch-alias": { 933 | "dev-master": "2.3.x-dev" 934 | } 935 | }, 936 | "autoload": { 937 | "classmap": [ 938 | "src/" 939 | ] 940 | }, 941 | "notification-url": "https://packagist.org/downloads/", 942 | "license": [ 943 | "BSD-3-Clause" 944 | ], 945 | "authors": [ 946 | { 947 | "name": "Sebastian Bergmann", 948 | "email": "sb@sebastian-bergmann.de", 949 | "role": "lead" 950 | } 951 | ], 952 | "description": "Mock Object library for PHPUnit", 953 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 954 | "keywords": [ 955 | "mock", 956 | "xunit" 957 | ], 958 | "time": "2015-07-10 06:54:24" 959 | }, 960 | { 961 | "name": "sebastian/comparator", 962 | "version": "1.2.0", 963 | "source": { 964 | "type": "git", 965 | "url": "https://github.com/sebastianbergmann/comparator.git", 966 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" 967 | }, 968 | "dist": { 969 | "type": "zip", 970 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", 971 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", 972 | "shasum": "" 973 | }, 974 | "require": { 975 | "php": ">=5.3.3", 976 | "sebastian/diff": "~1.2", 977 | "sebastian/exporter": "~1.2" 978 | }, 979 | "require-dev": { 980 | "phpunit/phpunit": "~4.4" 981 | }, 982 | "type": "library", 983 | "extra": { 984 | "branch-alias": { 985 | "dev-master": "1.2.x-dev" 986 | } 987 | }, 988 | "autoload": { 989 | "classmap": [ 990 | "src/" 991 | ] 992 | }, 993 | "notification-url": "https://packagist.org/downloads/", 994 | "license": [ 995 | "BSD-3-Clause" 996 | ], 997 | "authors": [ 998 | { 999 | "name": "Jeff Welch", 1000 | "email": "whatthejeff@gmail.com" 1001 | }, 1002 | { 1003 | "name": "Volker Dusch", 1004 | "email": "github@wallbash.com" 1005 | }, 1006 | { 1007 | "name": "Bernhard Schussek", 1008 | "email": "bschussek@2bepublished.at" 1009 | }, 1010 | { 1011 | "name": "Sebastian Bergmann", 1012 | "email": "sebastian@phpunit.de" 1013 | } 1014 | ], 1015 | "description": "Provides the functionality to compare PHP values for equality", 1016 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 1017 | "keywords": [ 1018 | "comparator", 1019 | "compare", 1020 | "equality" 1021 | ], 1022 | "time": "2015-07-26 15:48:44" 1023 | }, 1024 | { 1025 | "name": "sebastian/diff", 1026 | "version": "1.3.0", 1027 | "source": { 1028 | "type": "git", 1029 | "url": "https://github.com/sebastianbergmann/diff.git", 1030 | "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" 1031 | }, 1032 | "dist": { 1033 | "type": "zip", 1034 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", 1035 | "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", 1036 | "shasum": "" 1037 | }, 1038 | "require": { 1039 | "php": ">=5.3.3" 1040 | }, 1041 | "require-dev": { 1042 | "phpunit/phpunit": "~4.2" 1043 | }, 1044 | "type": "library", 1045 | "extra": { 1046 | "branch-alias": { 1047 | "dev-master": "1.3-dev" 1048 | } 1049 | }, 1050 | "autoload": { 1051 | "classmap": [ 1052 | "src/" 1053 | ] 1054 | }, 1055 | "notification-url": "https://packagist.org/downloads/", 1056 | "license": [ 1057 | "BSD-3-Clause" 1058 | ], 1059 | "authors": [ 1060 | { 1061 | "name": "Kore Nordmann", 1062 | "email": "mail@kore-nordmann.de" 1063 | }, 1064 | { 1065 | "name": "Sebastian Bergmann", 1066 | "email": "sebastian@phpunit.de" 1067 | } 1068 | ], 1069 | "description": "Diff implementation", 1070 | "homepage": "http://www.github.com/sebastianbergmann/diff", 1071 | "keywords": [ 1072 | "diff" 1073 | ], 1074 | "time": "2015-02-22 15:13:53" 1075 | }, 1076 | { 1077 | "name": "sebastian/environment", 1078 | "version": "1.3.2", 1079 | "source": { 1080 | "type": "git", 1081 | "url": "https://github.com/sebastianbergmann/environment.git", 1082 | "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" 1083 | }, 1084 | "dist": { 1085 | "type": "zip", 1086 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", 1087 | "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", 1088 | "shasum": "" 1089 | }, 1090 | "require": { 1091 | "php": ">=5.3.3" 1092 | }, 1093 | "require-dev": { 1094 | "phpunit/phpunit": "~4.4" 1095 | }, 1096 | "type": "library", 1097 | "extra": { 1098 | "branch-alias": { 1099 | "dev-master": "1.3.x-dev" 1100 | } 1101 | }, 1102 | "autoload": { 1103 | "classmap": [ 1104 | "src/" 1105 | ] 1106 | }, 1107 | "notification-url": "https://packagist.org/downloads/", 1108 | "license": [ 1109 | "BSD-3-Clause" 1110 | ], 1111 | "authors": [ 1112 | { 1113 | "name": "Sebastian Bergmann", 1114 | "email": "sebastian@phpunit.de" 1115 | } 1116 | ], 1117 | "description": "Provides functionality to handle HHVM/PHP environments", 1118 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1119 | "keywords": [ 1120 | "Xdebug", 1121 | "environment", 1122 | "hhvm" 1123 | ], 1124 | "time": "2015-08-03 06:14:51" 1125 | }, 1126 | { 1127 | "name": "sebastian/exporter", 1128 | "version": "1.2.1", 1129 | "source": { 1130 | "type": "git", 1131 | "url": "https://github.com/sebastianbergmann/exporter.git", 1132 | "reference": "7ae5513327cb536431847bcc0c10edba2701064e" 1133 | }, 1134 | "dist": { 1135 | "type": "zip", 1136 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", 1137 | "reference": "7ae5513327cb536431847bcc0c10edba2701064e", 1138 | "shasum": "" 1139 | }, 1140 | "require": { 1141 | "php": ">=5.3.3", 1142 | "sebastian/recursion-context": "~1.0" 1143 | }, 1144 | "require-dev": { 1145 | "phpunit/phpunit": "~4.4" 1146 | }, 1147 | "type": "library", 1148 | "extra": { 1149 | "branch-alias": { 1150 | "dev-master": "1.2.x-dev" 1151 | } 1152 | }, 1153 | "autoload": { 1154 | "classmap": [ 1155 | "src/" 1156 | ] 1157 | }, 1158 | "notification-url": "https://packagist.org/downloads/", 1159 | "license": [ 1160 | "BSD-3-Clause" 1161 | ], 1162 | "authors": [ 1163 | { 1164 | "name": "Jeff Welch", 1165 | "email": "whatthejeff@gmail.com" 1166 | }, 1167 | { 1168 | "name": "Volker Dusch", 1169 | "email": "github@wallbash.com" 1170 | }, 1171 | { 1172 | "name": "Bernhard Schussek", 1173 | "email": "bschussek@2bepublished.at" 1174 | }, 1175 | { 1176 | "name": "Sebastian Bergmann", 1177 | "email": "sebastian@phpunit.de" 1178 | }, 1179 | { 1180 | "name": "Adam Harvey", 1181 | "email": "aharvey@php.net" 1182 | } 1183 | ], 1184 | "description": "Provides the functionality to export PHP variables for visualization", 1185 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1186 | "keywords": [ 1187 | "export", 1188 | "exporter" 1189 | ], 1190 | "time": "2015-06-21 07:55:53" 1191 | }, 1192 | { 1193 | "name": "sebastian/global-state", 1194 | "version": "1.0.0", 1195 | "source": { 1196 | "type": "git", 1197 | "url": "https://github.com/sebastianbergmann/global-state.git", 1198 | "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" 1199 | }, 1200 | "dist": { 1201 | "type": "zip", 1202 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", 1203 | "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", 1204 | "shasum": "" 1205 | }, 1206 | "require": { 1207 | "php": ">=5.3.3" 1208 | }, 1209 | "require-dev": { 1210 | "phpunit/phpunit": "~4.2" 1211 | }, 1212 | "suggest": { 1213 | "ext-uopz": "*" 1214 | }, 1215 | "type": "library", 1216 | "extra": { 1217 | "branch-alias": { 1218 | "dev-master": "1.0-dev" 1219 | } 1220 | }, 1221 | "autoload": { 1222 | "classmap": [ 1223 | "src/" 1224 | ] 1225 | }, 1226 | "notification-url": "https://packagist.org/downloads/", 1227 | "license": [ 1228 | "BSD-3-Clause" 1229 | ], 1230 | "authors": [ 1231 | { 1232 | "name": "Sebastian Bergmann", 1233 | "email": "sebastian@phpunit.de" 1234 | } 1235 | ], 1236 | "description": "Snapshotting of global state", 1237 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1238 | "keywords": [ 1239 | "global state" 1240 | ], 1241 | "time": "2014-10-06 09:23:50" 1242 | }, 1243 | { 1244 | "name": "sebastian/recursion-context", 1245 | "version": "1.0.1", 1246 | "source": { 1247 | "type": "git", 1248 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1249 | "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" 1250 | }, 1251 | "dist": { 1252 | "type": "zip", 1253 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", 1254 | "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", 1255 | "shasum": "" 1256 | }, 1257 | "require": { 1258 | "php": ">=5.3.3" 1259 | }, 1260 | "require-dev": { 1261 | "phpunit/phpunit": "~4.4" 1262 | }, 1263 | "type": "library", 1264 | "extra": { 1265 | "branch-alias": { 1266 | "dev-master": "1.0.x-dev" 1267 | } 1268 | }, 1269 | "autoload": { 1270 | "classmap": [ 1271 | "src/" 1272 | ] 1273 | }, 1274 | "notification-url": "https://packagist.org/downloads/", 1275 | "license": [ 1276 | "BSD-3-Clause" 1277 | ], 1278 | "authors": [ 1279 | { 1280 | "name": "Jeff Welch", 1281 | "email": "whatthejeff@gmail.com" 1282 | }, 1283 | { 1284 | "name": "Sebastian Bergmann", 1285 | "email": "sebastian@phpunit.de" 1286 | }, 1287 | { 1288 | "name": "Adam Harvey", 1289 | "email": "aharvey@php.net" 1290 | } 1291 | ], 1292 | "description": "Provides functionality to recursively process PHP variables", 1293 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1294 | "time": "2015-06-21 08:04:50" 1295 | }, 1296 | { 1297 | "name": "sebastian/version", 1298 | "version": "1.0.6", 1299 | "source": { 1300 | "type": "git", 1301 | "url": "https://github.com/sebastianbergmann/version.git", 1302 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" 1303 | }, 1304 | "dist": { 1305 | "type": "zip", 1306 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 1307 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 1308 | "shasum": "" 1309 | }, 1310 | "type": "library", 1311 | "autoload": { 1312 | "classmap": [ 1313 | "src/" 1314 | ] 1315 | }, 1316 | "notification-url": "https://packagist.org/downloads/", 1317 | "license": [ 1318 | "BSD-3-Clause" 1319 | ], 1320 | "authors": [ 1321 | { 1322 | "name": "Sebastian Bergmann", 1323 | "email": "sebastian@phpunit.de", 1324 | "role": "lead" 1325 | } 1326 | ], 1327 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1328 | "homepage": "https://github.com/sebastianbergmann/version", 1329 | "time": "2015-06-21 13:59:46" 1330 | }, 1331 | { 1332 | "name": "symfony/yaml", 1333 | "version": "v2.7.3", 1334 | "source": { 1335 | "type": "git", 1336 | "url": "https://github.com/symfony/Yaml.git", 1337 | "reference": "71340e996171474a53f3d29111d046be4ad8a0ff" 1338 | }, 1339 | "dist": { 1340 | "type": "zip", 1341 | "url": "https://api.github.com/repos/symfony/Yaml/zipball/71340e996171474a53f3d29111d046be4ad8a0ff", 1342 | "reference": "71340e996171474a53f3d29111d046be4ad8a0ff", 1343 | "shasum": "" 1344 | }, 1345 | "require": { 1346 | "php": ">=5.3.9" 1347 | }, 1348 | "require-dev": { 1349 | "symfony/phpunit-bridge": "~2.7" 1350 | }, 1351 | "type": "library", 1352 | "extra": { 1353 | "branch-alias": { 1354 | "dev-master": "2.7-dev" 1355 | } 1356 | }, 1357 | "autoload": { 1358 | "psr-4": { 1359 | "Symfony\\Component\\Yaml\\": "" 1360 | } 1361 | }, 1362 | "notification-url": "https://packagist.org/downloads/", 1363 | "license": [ 1364 | "MIT" 1365 | ], 1366 | "authors": [ 1367 | { 1368 | "name": "Fabien Potencier", 1369 | "email": "fabien@symfony.com" 1370 | }, 1371 | { 1372 | "name": "Symfony Community", 1373 | "homepage": "https://symfony.com/contributors" 1374 | } 1375 | ], 1376 | "description": "Symfony Yaml Component", 1377 | "homepage": "https://symfony.com", 1378 | "time": "2015-07-28 14:07:07" 1379 | } 1380 | ], 1381 | "aliases": [], 1382 | "minimum-stability": "stable", 1383 | "stability-flags": { 1384 | "katzgrau/klogger": 20 1385 | }, 1386 | "prefer-stable": false, 1387 | "prefer-lowest": false, 1388 | "platform": [], 1389 | "platform-dev": [] 1390 | } 1391 | -------------------------------------------------------------------------------- /config/api.php: -------------------------------------------------------------------------------- 1 | '', 5 | 'merchantPassword' => '', 6 | 'logging' => true, 7 | 'logDirectory' => '', 8 | 'testing' => true, 9 | ]; -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | tests 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/DragonpayApi.php: -------------------------------------------------------------------------------- 1 | logging = true; 78 | $this->log = $log ?: new Logger($config['logDirectory']); 79 | } 80 | 81 | $this->merchantId = $config['merchantId']; 82 | $this->merchantPassword = $config['merchantPassword']; 83 | $this->urlGenerator = $urlGenerator ?: new RestUrlGenerator($config['testing']); 84 | $this->transaction = $transaction ?: new RestTransaction(null, $config['testing']); 85 | } 86 | 87 | /** 88 | * Get the generated URL to Dragonpay Payment Switch. 89 | * 90 | * @param array $params 91 | * @param null $paymentChannel 92 | * @return string 93 | */ 94 | public function getUrl(array $params, $paymentChannel = null) 95 | { 96 | $url = $this->urlGenerator->generate( 97 | array_merge($params, $this->getMerchantCredentials()), 98 | $paymentChannel 99 | ); 100 | 101 | if ($this->loggingIsEnabled()) { 102 | $this->log->info("Generated URL to Dragonpay Payment Switch. URL: $url"); 103 | } 104 | 105 | return $url; 106 | } 107 | 108 | /** 109 | * @param array $params 110 | * @return bool 111 | */ 112 | public function transactionIsValid(array $params) 113 | { 114 | $isValid = $this->transaction->isValid(array_merge($params, $this->getMerchantCredentials())); 115 | 116 | if ($this->loggingIsEnabled()) { 117 | $valid = $isValid ? 'Valid' : 'Invalid'; 118 | $this->log->info("Checked if Dragonpay request params are valid. (Transaction ID: {$params['transactionId']}) Result: $valid"); 119 | } 120 | 121 | return $isValid; 122 | } 123 | 124 | /** 125 | * @param array $params 126 | * @return string 127 | */ 128 | public function inquire(array $params) 129 | { 130 | $status = $this->transaction->inquire(array_merge($params, $this->getMerchantCredentials())); 131 | 132 | if ($this->loggingIsEnabled()) { 133 | $this->log->info("Inquired for the status of transaction ID {$params['transactionId']}. Status: {$status}"); 134 | } 135 | 136 | return $status; 137 | } 138 | 139 | /** 140 | * @param array $params 141 | * @return string 142 | */ 143 | public function cancel(array $params) 144 | { 145 | $status = $this->transaction->cancel(array_merge($params, $this->getMerchantCredentials())); 146 | 147 | if ($this->loggingIsEnabled()) { 148 | $this->log->info("Cancelled the transaction with ID: {$params['transactionId']}. Status: {$status}"); 149 | } 150 | 151 | return $status; 152 | } 153 | 154 | /** 155 | * @return array 156 | */ 157 | protected function getMerchantCredentials() 158 | { 159 | return [ 160 | 'merchantId' => $this->merchantId, 161 | 'merchantPassword' => $this->merchantPassword, 162 | ]; 163 | } 164 | 165 | /** 166 | * @return bool 167 | */ 168 | protected function loggingIsEnabled() 169 | { 170 | return $this->logging; 171 | } 172 | 173 | } 174 | -------------------------------------------------------------------------------- /src/Facades/Dragonpay.php: -------------------------------------------------------------------------------- 1 | publishes([ 18 | realpath(__DIR__ . '/../../config/dragonpay.php') => config_path('dragonpay.php'), 19 | ]); 20 | } 21 | 22 | /** 23 | * Register the service provider. 24 | * 25 | * @return void 26 | */ 27 | public function register() 28 | { 29 | if (file_exists(config_path('dragonpay.php'))) { 30 | $this->app->bind('dragonpay', function () { 31 | return new DragonpayApi([ 32 | 'merchantId' => config('dragonpay.merchantId'), 33 | 'merchantPassword' => config('dragonpay.merchantPassword'), 34 | 'logging' => config('dragonpay.logging'), 35 | 'logDirectory' => config('dragonpay.logDirectory'), 36 | 'testing' => config('dragonpay.testing'), 37 | ]); 38 | }); 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/Transaction/RestTransaction.php: -------------------------------------------------------------------------------- 1 | baseUri = $testing ? TESTING_BASE_URI : PRODUCTION_BASE_URI; 19 | $this->client = $client ?: new Client(['base_uri' => $this->baseUri]); 20 | } 21 | 22 | /** 23 | * @param array $params 24 | * @return bool 25 | */ 26 | public function isValid(array $params) 27 | { 28 | return $this->buildDigest($params) === $params['digest']; 29 | } 30 | 31 | /** 32 | * @param array $params 33 | * @return string Status response 34 | */ 35 | public function inquire(array $params) 36 | { 37 | return $this->merchantRequest('GETSTATUS', $params); 38 | } 39 | 40 | /** 41 | * @param array $params 42 | * @return string Status response 43 | */ 44 | public function cancel(array $params) 45 | { 46 | return $this->merchantRequest('VOID', $params); 47 | } 48 | 49 | /** 50 | * @param $operation 51 | * @param array $params 52 | * @return string Status response 53 | */ 54 | private function merchantRequest($operation, array $params) 55 | { 56 | $response = $this->client->get('MerchantRequest.aspx', [ 57 | 'query' => [ 58 | 'op' => $operation, 59 | 'merchantid' => $params['merchantId'], 60 | 'merchantpwd' => $params['merchantPassword'], 61 | 'txnid' => $params['transactionId'], 62 | ] 63 | ]); 64 | 65 | return $response->getBody()->getContents(); 66 | } 67 | 68 | /** 69 | * @param $params 70 | * @return string 71 | */ 72 | private function buildDigest($params) 73 | { 74 | $message = sprintf( 75 | '%s:%s:%s:%s:%s', 76 | $params['transactionId'], 77 | $params['referenceNumber'], 78 | $params['status'], 79 | $params['message'], 80 | $params['merchantPassword'] 81 | ); 82 | 83 | return sha1($message); 84 | } 85 | 86 | } -------------------------------------------------------------------------------- /src/Transaction/TransactionInterface.php: -------------------------------------------------------------------------------- 1 | baseUri = $testing ? TESTING_BASE_URI : PRODUCTION_BASE_URI; 16 | } 17 | 18 | /** 19 | * @param array $params 20 | * @param null $filter 21 | * @return string 22 | * @TODO Add functionality for additional optional params 23 | */ 24 | public function generate(array $params, $filter = null) 25 | { 26 | $queryString = sprintf( 27 | '?merchantid=%s&txnid=%s&amount=%s&ccy=%s&description=%s&email=%s', 28 | urlencode($params['merchantId']), 29 | urlencode($params['transactionId']), 30 | urlencode($params['amount']), 31 | urlencode($params['currency']), 32 | urlencode($params['description']), 33 | urlencode($params['email']) 34 | ); 35 | 36 | // Generate digest and append it to the query string 37 | $queryString .= '&digest=' . $this->generateDigest($params); 38 | 39 | // If there's a filter, append its code to the query string 40 | if ($filter !== null) { 41 | $queryString .= $this->getFilterCode($filter); 42 | } 43 | 44 | // Return the full URL 45 | return $this->baseUri . '/Pay.aspx' . $queryString; 46 | } 47 | 48 | /** 49 | * @param $params 50 | * @return string 51 | */ 52 | private function generateDigest($params) 53 | { 54 | $message = sprintf( 55 | '%s:%s:%s:%s:%s:%s:%s', 56 | $params['merchantId'], 57 | $params['transactionId'], 58 | $params['amount'], 59 | $params['currency'], 60 | $params['description'], 61 | $params['email'], 62 | $params['merchantPassword'] 63 | ); 64 | 65 | return sha1($message); 66 | } 67 | 68 | /** 69 | * Note: Is the switch case an indication of code smell? 70 | * (Use polymorphism instead?) 71 | * 72 | * @param $filter 73 | * @return string 74 | */ 75 | private function getFilterCode($filter) 76 | { 77 | switch ($filter) { 78 | case 'online_banking': 79 | $code = '&mode=1'; 80 | break; 81 | case 'otc_banking_atm': 82 | $code = '&mode=2'; 83 | break; 84 | case 'otc_non_bank': 85 | $code = '&mode=4'; 86 | break; 87 | case 'paypal': 88 | $code = '&mode=32'; 89 | break; 90 | case 'credit_card': 91 | $code = '&mode=64'; 92 | break; 93 | case 'mobile': 94 | $code = '&mode=128'; 95 | break; 96 | case 'international_otc': 97 | $code = '&mode=256'; 98 | break; 99 | case 'gcash_direct': 100 | $code = '&procid=GCSH'; 101 | break; 102 | case 'credit_card_direct': 103 | $code = '&procid=CC'; 104 | break; 105 | case 'paypal_direct': 106 | $code = '&procid=PYPL'; 107 | break; 108 | default: 109 | $code = ''; 110 | break; 111 | } 112 | 113 | return $code; 114 | } 115 | 116 | } -------------------------------------------------------------------------------- /src/UrlGenerator/UrlGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | 'ID']); 26 | } 27 | 28 | /** 29 | * @test 30 | * @expectedException Exception 31 | */ 32 | public function it_throws_when_logging_is_enabled_and_you_dont_provide_a_log_directory() 33 | { 34 | new Coreproc\Dragonpay\DragonpayApi([ 35 | 'merchantId' => 'ID', 36 | 'merchantPassword' => 'PASSWORD', 37 | 'logging' => true 38 | ]); 39 | } 40 | 41 | /** 42 | * @test 43 | */ 44 | public function it_gets_the_generated_url_to_dragonpay_payment_switch() 45 | { 46 | $expected = 'url'; 47 | 48 | $generator = Mockery::mock(Coreproc\Dragonpay\UrlGenerator\UrlGeneratorInterface::class); 49 | 50 | $generator->shouldReceive('generate') 51 | ->with(anything(), anything()) 52 | ->once() 53 | ->andReturn($expected); 54 | 55 | $dragonpay = new DragonpayApi($this->getMerchantCredentials(), $generator); 56 | 57 | $actual = $dragonpay->getUrl([]); 58 | 59 | $this->assertEquals($expected, $actual); 60 | } 61 | 62 | /** 63 | * @test 64 | */ 65 | public function it_logs_the_generation_of_url_to_dragonpay_payment_switch() 66 | { 67 | $generator = Mockery::mock(Coreproc\Dragonpay\UrlGenerator\UrlGeneratorInterface::class); 68 | 69 | $generator->shouldReceive('generate') 70 | ->with(anything(), anything()) 71 | ->once() 72 | ->andReturn('url'); 73 | 74 | $logger = $this->getLoggerMock(); 75 | 76 | $logger->shouldReceive('info')->once(); 77 | 78 | $dragonpay = new DragonpayApi( 79 | array_merge($this->getMerchantCredentials(), $this->getLoggingConfig()), 80 | $generator, 81 | null, 82 | $logger 83 | ); 84 | 85 | $actual = $dragonpay->getUrl([]); 86 | } 87 | 88 | /** 89 | * @test 90 | */ 91 | public function it_allows_for_checking_if_the_transaction_result_response_is_valid() 92 | { 93 | $transaction = $this->getTransactionInterfaceMock(); 94 | 95 | $transaction->shouldReceive('isValid') 96 | ->with(anything()) 97 | ->once() 98 | ->andReturn(true); 99 | 100 | $dragonpay = new DragonpayApi($this->getMerchantCredentials(), null, $transaction); 101 | 102 | $actual = $dragonpay->transactionIsValid([]); 103 | 104 | $this->assertTrue($actual); 105 | } 106 | 107 | /** 108 | * @test 109 | */ 110 | public function it_logs_the_checking_of_the_transaction_result_responses_validity() 111 | { 112 | $transaction = $this->getTransactionInterfaceMock(); 113 | 114 | $transaction->shouldReceive('isValid') 115 | ->with(anything()) 116 | ->once(); 117 | 118 | $logger = $this->getLoggerMock(); 119 | 120 | $logger->shouldReceive('info')->once(); 121 | 122 | $dragonpay = new DragonpayApi( 123 | array_merge($this->getMerchantCredentials(), $this->getLoggingConfig()), 124 | null, 125 | $transaction, 126 | $logger 127 | ); 128 | 129 | $dragonpay->transactionIsValid(['transactionId' => 1]); 130 | } 131 | 132 | /** 133 | * @test 134 | */ 135 | public function it_inquires_for_a_transactions_status() 136 | { 137 | // S = Success 138 | // *Refer to "Appendix 3 - Status Codes" (API Docs) 139 | $expected = 'S'; 140 | 141 | $mock = $this->getTransactionInterfaceMock(); 142 | 143 | $mock->shouldReceive('inquire') 144 | ->with(anything()) 145 | ->once() 146 | ->andReturn($expected); 147 | 148 | $dragonpay = new DragonpayApi($this->getMerchantCredentials(), null, $mock); 149 | 150 | $actual = $dragonpay->inquire([]); 151 | 152 | $this->assertEquals($expected, $actual); 153 | } 154 | 155 | /** 156 | * @test 157 | */ 158 | public function it_logs_the_inquiry_of_a_transactions_status() 159 | { 160 | $transaction = $this->getTransactionInterfaceMock(); 161 | 162 | $transaction->shouldReceive('inquire') 163 | ->with(anything()) 164 | ->once(); 165 | 166 | $logger = $this->getLoggerMock(); 167 | 168 | $logger->shouldReceive('info')->once(); 169 | 170 | $dragonpay = new DragonpayApi( 171 | array_merge($this->getMerchantCredentials(), $this->getLoggingConfig()), 172 | null, 173 | $transaction, 174 | $logger 175 | ); 176 | 177 | $dragonpay->inquire(['transactionId' => 1]); 178 | } 179 | 180 | /** 181 | * @test 182 | */ 183 | public function it_cancels_transactions() 184 | { 185 | // 0 = Success 186 | // *Refer to "Cancellation of Transaction - Response Parameters" (API Docs) 187 | $expected = 0; 188 | 189 | $mock = $this->getTransactionInterfaceMock(); 190 | 191 | $mock->shouldReceive('cancel') 192 | ->with(anything()) 193 | ->once() 194 | ->andReturn($expected); 195 | 196 | $dragonpay = new DragonpayApi($this->getMerchantCredentials(), null, $mock); 197 | 198 | $actual = $dragonpay->cancel([]); 199 | 200 | $this->assertEquals($expected, $actual); 201 | } 202 | 203 | public function it_logs_the_cancellation_of_a_transaction() 204 | { 205 | $transaction = $this->getTransactionInterfaceMock(); 206 | 207 | $transaction->shouldReceive('cancel') 208 | ->with(anything()) 209 | ->once() 210 | ->andReturn($expected); 211 | 212 | $logger = $this->getLoggerMock(); 213 | 214 | $logger->shouldReceive('info')->once(); 215 | 216 | $dragonpay = new DragonpayApi( 217 | array_merge($this->getMerchantCredentials(), $this->getLoggingConfig()), 218 | null, 219 | $transaction, 220 | $logger 221 | ); 222 | 223 | $dragonpay->cancel([]); 224 | } 225 | 226 | protected function getMerchantCredentials() 227 | { 228 | return [ 229 | 'merchantId' => 'ID', 230 | 'merchantPassword' => 'PASSWORD', 231 | ]; 232 | } 233 | 234 | protected function getLoggingConfig() 235 | { 236 | return [ 237 | 'logging' => true, 238 | 'logDirectory' => 'logs' 239 | ]; 240 | } 241 | 242 | /** 243 | * @return \Mockery\MockInterface 244 | */ 245 | protected function getTransactionInterfaceMock() 246 | { 247 | return Mockery::mock(Coreproc\Dragonpay\Transaction\TransactionInterface::class); 248 | } 249 | 250 | /** 251 | * @return \Mockery\MockInterface 252 | */ 253 | protected function getLoggerMock() 254 | { 255 | return Mockery::mock(Psr\Log\LoggerInterface::class); 256 | } 257 | 258 | public function tearDown() 259 | { 260 | Mockery::close(); 261 | } 262 | 263 | } 264 | -------------------------------------------------------------------------------- /tests/RestTransactionTest.php: -------------------------------------------------------------------------------- 1 | transaction = new \Coreproc\Dragonpay\Transaction\RestTransaction(null, true); 11 | } 12 | 13 | /** 14 | * @test 15 | */ 16 | public function it_allows_for_checking_if_the_transaction_result_response_is_valid() 17 | { 18 | $actual = $this->transaction->isValid([ 19 | 'transactionId' => '1', 20 | 'referenceNumber' => 'refno', 21 | 'status' => 'U', 22 | 'message' => 'message', 23 | 'digest' => 'digest', 24 | 'merchantPassword' => 'PASSWORD', 25 | ]); 26 | 27 | $this->assertFalse($actual); 28 | } 29 | 30 | /** 31 | * @test 32 | */ 33 | public function it_successfully_inquires_for_a_transactions_status() 34 | { 35 | $status = $this->transaction->inquire([ 36 | 'merchantId' => 'ID', 37 | 'merchantPassword' => 'PASSWORD', 38 | 'transactionId' => '12345', 39 | ]); 40 | 41 | $this->assertEquals('U', $status); 42 | } 43 | 44 | /** 45 | * @test 46 | */ 47 | public function it_allows_for_cancellations_of_a_transaction() 48 | { 49 | $status = $this->transaction->cancel([ 50 | 'merchantId' => 'ID', 51 | 'merchantPassword' => 'PASSWORD', 52 | 'transactionId' => '12345', 53 | ]); 54 | 55 | $this->assertEquals('-1', $status); 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /tests/RestUrlGeneratorTest.php: -------------------------------------------------------------------------------- 1 | generator = new \Coreproc\Dragonpay\UrlGenerator\RestUrlGenerator(true); 12 | } 13 | 14 | /** 15 | * Note: Should we do the generation of the expected value instead of stubbing it? 16 | * 17 | * @test 18 | */ 19 | public function it_generates_the_url_to_dragonpay_payment_switch() 20 | { 21 | $actual = $this->generator->generate([ 22 | 'merchantId' => 'ID', 23 | 'merchantPassword' => 'PASSWORD', 24 | 'transactionId' => '1', 25 | 'amount' => '1000.00', 26 | 'currency' => 'PHP', 27 | 'description' => 'Lorem Ipsum Dolor Amet.', 28 | 'email' => 'john.doe@email.com', 29 | ]); 30 | 31 | $expected = 'http://test.dragonpay.ph/Pay.aspx?' 32 | . 'merchantid=ID' 33 | . '&txnid=1' 34 | . '&amount=1000.00' 35 | . '&ccy=PHP' 36 | . '&description=Lorem+Ipsum+Dolor+Amet.' 37 | . '&email=john.doe%40email.com' 38 | . '&digest=3fe95df2d43b96783df55b94bd6f80d964910fcb'; 39 | 40 | $this->assertEquals($expected, $actual); 41 | } 42 | 43 | /** 44 | * Note: Do a test for each payment channel type? 45 | * 46 | * @test 47 | */ 48 | public function generation_of_url_allows_for_filtering_by_payment_channel_type() 49 | { 50 | $actual = $this->generator->generate([ 51 | 'merchantId' => 'ID', 52 | 'merchantPassword' => 'PASSWORD', 53 | 'transactionId' => '1', 54 | 'amount' => '1000.00', 55 | 'currency' => 'PHP', 56 | 'description' => 'Lorem Ipsum Dolor Amet.', 57 | 'email' => 'john.doe@email.com', 58 | ], 'online_banking'); 59 | 60 | $expected = 'http://test.dragonpay.ph/Pay.aspx?' 61 | . 'merchantid=ID' 62 | . '&txnid=1' 63 | . '&amount=1000.00' 64 | . '&ccy=PHP' 65 | . '&description=Lorem+Ipsum+Dolor+Amet.' 66 | . '&email=john.doe%40email.com' 67 | . '&digest=3fe95df2d43b96783df55b94bd6f80d964910fcb' 68 | . '&mode=1'; 69 | 70 | $this->assertEquals($expected, $actual); 71 | } 72 | 73 | } --------------------------------------------------------------------------------