├── .gitignore ├── .gitlab-ci.yml ├── README.md ├── composer.json └── src └── BigFish ├── PaymentGateway.php └── PaymentGateway ├── Autoload.php ├── Config.php ├── Data ├── Info.php ├── Info │ ├── InfoAbstract.php │ ├── InfoCustomerBrowser.php │ ├── InfoCustomerGeneral.php │ ├── InfoCustomerStoreSpecific.php │ ├── InfoInterface.php │ ├── InfoOrderBillingData.php │ ├── InfoOrderGeneral.php │ ├── InfoOrderProductItem.php │ ├── InfoOrderRecurringPayment.php │ └── InfoOrderShippingData.php ├── PayWallAbstract.php ├── PayWallSettings.php └── PayWallStoreSettings.php ├── Exception.php ├── Request ├── Cancel.php ├── CancelAllPaymentRegistrations.php ├── CancelPaymentRegistration.php ├── Close.php ├── Details.php ├── Finalize.php ├── GetPaymentRegistrations.php ├── Init.php ├── InitRP.php ├── Invoice.php ├── Log.php ├── OneClickOptions.php ├── OneClickTokenCancel.php ├── OneClickTokenCancelAll.php ├── PayWallPaymentDetails.php ├── PayWallPaymentInit.php ├── PayWallPaymentUpdate.php ├── PaymentLinkCancel.php ├── PaymentLinkCreate.php ├── PaymentLinkDetails.php ├── Payout.php ├── Providers.php ├── Refund.php ├── RequestAbstract.php ├── Result.php ├── Settlement.php ├── SettlementRefund.php ├── Start.php └── StartRP.php └── Response.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | Syntax Check PHP 5.6: 2 | image: php:5.6-cli 3 | script: 4 | - find . -type f -name "*.php" -print0 | xargs -0L1 php -l 5 | stage: test 6 | tags: 7 | - docker 8 | 9 | Syntax Check PHP 7.4: 10 | image: php:7.4-cli 11 | script: 12 | - find . -type f -name "*.php" -print0 | xargs -0L1 php -l 13 | stage: test 14 | tags: 15 | - docker 16 | 17 | Syntax Check PHP 8.0: 18 | image: php:8.0-cli 19 | script: 20 | - find . -type f -name "*.php" -print0 | xargs -0L1 php -l 21 | stage: test 22 | tags: 23 | - docker 24 | 25 | Syntax Check PHP 8.1: 26 | image: php:8.1-cli 27 | script: 28 | - find . -type f -name "*.php" -print0 | xargs -0L1 php -l 29 | stage: test 30 | tags: 31 | - docker 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > Repository github.com/bigfish-hu/payment-gateway-php-sdk (bigfish/paymentgateway) is abandoned, you should avoid using it.
2 | >
3 | > Use https://github.com/pmgw-hu/payment-gateway-php-sdk ([pmgw/payment-gateway-php-sdk](https://packagist.org/packages/pmgw/payment-gateway-php-sdk)) instead. 4 | 5 | # BIG FISH Payment Gateway - PHP SDK 6 | 7 | ## Version 8 | 9 | 4.1.0 10 | 11 | ## Requirements 12 | 13 | * PHP 5.3+ 14 | 15 | ## Installation 16 | 17 | BIG FISH Payment Gateway is available at packagist.org, so you can use composer to download this library. 18 | 19 | ``` 20 | { 21 | "require": { 22 | "pmgw/payment-gateway-php-sdk": "4.*" 23 | } 24 | } 25 | ``` 26 | 27 | ## Source code 28 | 29 | https://github.com/pmgw-hu/payment-gateway-php-sdk 30 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pmgw/payment-gateway-php-sdk", 3 | "description": "BIG FISH Payment Gateway - PHP SDK", 4 | "type": "library", 5 | "keywords": ["payment", "ecommerce", "webshop", "php", "sdk"], 6 | "homepage": "https://www.paymentgateway.hu/", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "BIG FISH Payment Services Ltd.", 11 | "email": "it@paymentgateway.hu" 12 | } 13 | ], 14 | "support": { 15 | "email": "it@paymentgateway.hu" 16 | }, 17 | "require": { 18 | "php": "~5.3|~7.0|~8.0" 19 | }, 20 | "autoload": { 21 | "psr-4": { 22 | "BigFish\\": "src/BigFish" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway.php: -------------------------------------------------------------------------------- 1 | getParams(); 394 | } 395 | 396 | /** 397 | * Query transaction results from Payment Gateway 398 | * 399 | * @param \BigFish\PaymentGateway\Request\Result $request Result request object 400 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 401 | * @access public 402 | * @static 403 | * @throws \BigFish\PaymentGateway\Exception 404 | */ 405 | public static function result(ResultRequest $request) 406 | { 407 | return self::sendRequest(self::REQUEST_RESULT, $request); 408 | } 409 | 410 | /** 411 | * Close a previously started transaction 412 | * 413 | * @param \BigFish\PaymentGateway\Request\Close $request Close request object 414 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 415 | * @access public 416 | * @static 417 | * @throws \BigFish\PaymentGateway\Exception 418 | */ 419 | public static function close(CloseRequest $request) 420 | { 421 | return self::sendRequest(self::REQUEST_CLOSE, $request); 422 | } 423 | 424 | /** 425 | * Cancel a previously started transaction 426 | * 427 | * @param \BigFish\PaymentGateway\Request\Cancel $request Cancel request object 428 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 429 | * @access public 430 | * @static 431 | * @throws \BigFish\PaymentGateway\Exception 432 | */ 433 | public static function cancel(CancelRequest $request) 434 | { 435 | return self::sendRequest(self::REQUEST_CANCEL, $request); 436 | } 437 | 438 | /** 439 | * Refund a transaction 440 | * 441 | * @param \BigFish\PaymentGateway\Request\Refund $request Refund request object 442 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 443 | * @access public 444 | * @static 445 | * @throws \BigFish\PaymentGateway\Exception 446 | */ 447 | public static function refund(RefundRequest $request) 448 | { 449 | return self::sendRequest(self::REQUEST_REFUND, $request); 450 | } 451 | 452 | /** 453 | * Recurring payment transaction initialization 454 | * 455 | * @param \BigFish\PaymentGateway\Request\InitRP $request Recurring payment init request object 456 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 457 | * @access public 458 | * @static 459 | * @throws \BigFish\PaymentGateway\Exception 460 | */ 461 | public static function initRP(InitRPRequest $request) 462 | { 463 | return self::sendRequest(self::REQUEST_INIT_RP, $request); 464 | } 465 | 466 | /** 467 | * Start recurring payment transaction 468 | * 469 | * @param \BigFish\PaymentGateway\Request\StartRP $request Recurring payment start request object 470 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 471 | * @access public 472 | * @static 473 | * @throws \BigFish\PaymentGateway\Exception 474 | */ 475 | public static function startRP(StartRPRequest $request) 476 | { 477 | return self::sendRequest(self::REQUEST_START_RP, $request); 478 | } 479 | 480 | /** 481 | * Finalize a transaction 482 | * 483 | * @param \BigFish\PaymentGateway\Request\Finalize $request Finalize request object 484 | * @return void 485 | * @access public 486 | * @static 487 | * @throws \BigFish\PaymentGateway\Exception 488 | */ 489 | public static function finalize(FinalizeRequest $request) 490 | { 491 | header('Location: ' . self::getFinalizeUrl($request)); 492 | exit(); 493 | } 494 | 495 | /** 496 | * Get payment finalize URL 497 | * 498 | * @param \BigFish\PaymentGateway\Request\Finalize $request Finalize request object 499 | * @return string 500 | * @access public 501 | * @static 502 | * @throws \BigFish\PaymentGateway\Exception 503 | */ 504 | public static function getFinalizeUrl(FinalizeRequest $request) 505 | { 506 | return self::getUrl() . '/Finalize?' . $request->getParams(); 507 | } 508 | 509 | /** 510 | * Get one click payment options 511 | * 512 | * @param \BigFish\PaymentGateway\Request\OneClickOptions $request 513 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 514 | * @access public 515 | * @static 516 | * @throws \BigFish\PaymentGateway\Exception 517 | */ 518 | public static function oneClickOptions(OneClickOptionsRequest $request) 519 | { 520 | return self::sendRequest(self::REQUEST_ONE_CLICK_OPTIONS, $request); 521 | } 522 | 523 | /** 524 | * Get Payment Registrations 525 | * 526 | * @param \BigFish\PaymentGateway\Request\GetPaymentRegistrations $request 527 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 528 | * @access public 529 | * @static 530 | * @throws \BigFish\PaymentGateway\Exception 531 | */ 532 | public static function getPaymentRegistrations(GetPaymentRegistrationsRequest $request) 533 | { 534 | return self::sendRequest(self::REQUEST_GET_PAYMENT_REGISTRATIONS, $request); 535 | } 536 | 537 | /** 538 | * One Click Token Cancel 539 | * 540 | * @param \BigFish\PaymentGateway\Request\OneClickTokenCancel $request OneClickTokenCancel request object 541 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 542 | * @access public 543 | * @static 544 | * @throws \BigFish\PaymentGateway\Exception 545 | */ 546 | public static function oneClickTokenCancel(OneClickTokenCancelRequest $request) 547 | { 548 | return self::sendRequest(self::REQUEST_ONE_CLICK_TOKEN_CANCEL, $request); 549 | } 550 | 551 | /** 552 | * Cancel Payment Registration 553 | * 554 | * @param \BigFish\PaymentGateway\Request\CancelPaymentRegistration $request CancelPaymentRegistration request object 555 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 556 | * @access public 557 | * @static 558 | * @throws \BigFish\PaymentGateway\Exception 559 | */ 560 | public static function cancelPaymentRegistration(CancelPaymentRegistrationRequest $request) 561 | { 562 | return self::sendRequest(self::REQUEST_CANCEL_PAYMENT_REGISTRATION, $request); 563 | } 564 | 565 | /** 566 | * One Click Token Cancel All 567 | * 568 | * @param \BigFish\PaymentGateway\Request\OneClickTokenCancelAll $request OneClickTokenCancelAll request object 569 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 570 | * @access public 571 | * @static 572 | * @throws \BigFish\PaymentGateway\Exception 573 | */ 574 | public static function oneClickTokenCancelAll(OneClickTokenCancelAllRequest $request) 575 | { 576 | return self::sendRequest(self::REQUEST_ONE_CLICK_TOKEN_CANCEL_ALL, $request); 577 | } 578 | 579 | /** 580 | * Cancel All Payment Registrations 581 | * 582 | * @param \BigFish\PaymentGateway\Request\CancelAllPaymentRegistrations $request CancelAllPaymentRegistrations request object 583 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 584 | * @access public 585 | * @static 586 | * @throws \BigFish\PaymentGateway\Exception 587 | */ 588 | public static function cancelAllPaymentRegistrations(CancelAllPaymentRegistrationsRequest $request) 589 | { 590 | return self::sendRequest(self::REQUEST_CANCEL_ALL_PAYMENT_REGISTRATIONS, $request); 591 | } 592 | 593 | /** 594 | * Get invoice 595 | * 596 | * @param \BigFish\PaymentGateway\Request\Invoice $request 597 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 598 | * @access public 599 | * @static 600 | * @throws \BigFish\PaymentGateway\Exception 601 | */ 602 | public static function invoice(InvoiceRequest $request) 603 | { 604 | return self::sendRequest(self::REQUEST_INVOICE, $request); 605 | } 606 | 607 | /** 608 | * Get providers 609 | * 610 | * @param \BigFish\PaymentGateway\Request\Providers $request 611 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 612 | * @access public 613 | * @static 614 | * @throws \BigFish\PaymentGateway\Exception 615 | */ 616 | public static function providers(ProvidersRequest $request) 617 | { 618 | return self::sendRequest(self::REQUEST_PROVIDERS, $request); 619 | } 620 | 621 | /** 622 | * Query transaction details from Payment Gateway 623 | * 624 | * @param \BigFish\PaymentGateway\Request\Details $request Details request object 625 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 626 | * @access public 627 | * @static 628 | * @throws \BigFish\PaymentGateway\Exception 629 | */ 630 | public static function details(DetailsRequest $request) 631 | { 632 | return self::sendRequest(self::REQUEST_DETAILS, $request); 633 | } 634 | 635 | /** 636 | * Payment link create 637 | * 638 | * @param \BigFish\PaymentGateway\Request\PaymentLinkCreate $request Payment link create request object 639 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 640 | * @access public 641 | * @static 642 | * @throws \BigFish\PaymentGateway\Exception 643 | */ 644 | public static function paymentLinkCreate(PaymentLinkCreateRequest $request) 645 | { 646 | return self::sendRequest(self::REQUEST_PAYMENT_LINK_CREATE, $request); 647 | } 648 | 649 | /** 650 | * Payment link cancel 651 | * 652 | * @param \BigFish\PaymentGateway\Request\PaymentLinkCancel $request Payment link cancel request object 653 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 654 | * @access public 655 | * @static 656 | * @throws \BigFish\PaymentGateway\Exception 657 | */ 658 | public static function paymentLinkCancel(PaymentLinkCancelRequest $request) 659 | { 660 | return self::sendRequest(self::REQUEST_PAYMENT_LINK_CANCEL, $request); 661 | } 662 | 663 | /** 664 | * Payment link details 665 | * 666 | * @param \BigFish\PaymentGateway\Request\PaymentLinkDetails $request Payment link details request object 667 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 668 | * @access public 669 | * @static 670 | * @throws \BigFish\PaymentGateway\Exception 671 | */ 672 | public static function paymentLinkDetails(PaymentLinkDetailsRequest $request) 673 | { 674 | return self::sendRequest(self::REQUEST_PAYMENT_LINK_DETAILS, $request); 675 | } 676 | 677 | /** 678 | * Get Settlement data 679 | * 680 | * @param \BigFish\PaymentGateway\Request\Settlement $request Settlement request object 681 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 682 | * @access public 683 | * @static 684 | * @throws \BigFish\PaymentGateway\Exception 685 | */ 686 | public static function settlement(SettlementRequest $request) 687 | { 688 | return self::sendRequest(self::REQUEST_SETTLEMENT, $request); 689 | } 690 | 691 | /** 692 | * Get Settlement refund data 693 | * 694 | * @param \BigFish\PaymentGateway\Request\SettlementRefund $request Settlement refund request object 695 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 696 | * @access public 697 | * @static 698 | * @throws \BigFish\PaymentGateway\Exception 699 | */ 700 | public static function settlementRefund(SettlementRefundRequest $request) 701 | { 702 | return self::sendRequest(self::REQUEST_SETTLEMENT_REFUND, $request); 703 | } 704 | 705 | /** 706 | * Payout 707 | * 708 | * @param \BigFish\PaymentGateway\Request\Payout $request 709 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 710 | * @access public 711 | * @static 712 | * @throws \BigFish\PaymentGateway\Exception 713 | */ 714 | public static function payout(PayoutRequest $request) 715 | { 716 | return self::sendRequest(self::REQUEST_PAYOUT, $request); 717 | } 718 | 719 | /** 720 | * Query transaction log from Payment Gateway 721 | * 722 | * @param \BigFish\PaymentGateway\Request\Log $request Log request object 723 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 724 | * @access public 725 | * @static 726 | * @throws \BigFish\PaymentGateway\Exception 727 | */ 728 | public static function log(LogRequest $request) 729 | { 730 | return self::sendRequest(self::REQUEST_LOG, $request); 731 | } 732 | 733 | /** 734 | * Initialize PayWall payment 735 | * 736 | * @param \BigFish\PaymentGateway\Request\PayWallPaymentInit $request PayWall payment init request object 737 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 738 | * @access public 739 | * @static 740 | * @throws \BigFish\PaymentGateway\Exception 741 | */ 742 | public static function payWallPaymentInit(PayWallPaymentInitRequest $request) 743 | { 744 | return self::sendRequest(self::REQUEST_PAYWALL_PAYMENT_INIT, $request); 745 | } 746 | 747 | /** 748 | * Update PayWall payment 749 | * 750 | * @param \BigFish\PaymentGateway\Request\PayWallPaymentUpdate $request PayWall payment update request object 751 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 752 | * @access public 753 | * @static 754 | * @throws \BigFish\PaymentGateway\Exception 755 | */ 756 | public static function payWallPaymentUpdate(PayWallPaymentUpdateRequest $request) 757 | { 758 | return self::sendRequest(self::REQUEST_PAYWALL_PAYMENT_UPDATE, $request); 759 | } 760 | 761 | /** 762 | * PayWall payment details 763 | * 764 | * @param \BigFish\PaymentGateway\Request\PayWallPaymentDetails $request PayWall payment details request object 765 | * @return \BigFish\PaymentGateway\Response Payment Gateway response object 766 | * @access public 767 | * @static 768 | * @throws \BigFish\PaymentGateway\Exception 769 | */ 770 | public static function payWallPaymentDetails(PayWallPaymentDetailsRequest $request) 771 | { 772 | return self::sendRequest(self::REQUEST_PAYWALL_PAYMENT_DETAILS, $request); 773 | } 774 | 775 | /** 776 | * Get service URL 777 | * 778 | * @return string 779 | * @access protected 780 | * @static 781 | * @throws \BigFish\PaymentGateway\Exception 782 | */ 783 | protected static function getUrl() 784 | { 785 | if (self::getConfig()->testMode === true) { 786 | return self::getConfig()->gatewayUrlTest; 787 | } else { 788 | return self::GATEWAY_URL_PRODUCTION; 789 | } 790 | } 791 | 792 | /** 793 | * Send request 794 | * 795 | * @param string $method 796 | * @param \BigFish\PaymentGateway\Request\RequestAbstract $request 797 | * @return \BigFish\PaymentGateway\Response 798 | * @access private 799 | * @static 800 | * @throws \BigFish\PaymentGateway\Exception 801 | */ 802 | private static function sendRequest($method, Request $request) 803 | { 804 | if (!function_exists('curl_init')) { 805 | throw new Exception('cURL PHP module is not loaded'); 806 | } 807 | 808 | $url = self::getUrl() . '/api/payment/'; 809 | 810 | $request->encodeValues(); 811 | 812 | if ($request instanceof InitRequest || $request instanceof PaymentLinkCreateRequest) { 813 | $request->setExtra(); 814 | } 815 | 816 | $request->ucfirstProps(); 817 | 818 | $ch = curl_init(); 819 | 820 | curl_setopt($ch, CURLOPT_URL, $url); 821 | curl_setopt($ch, CURLOPT_HTTPHEADER, array(self::getAuthorizationHeader())); 822 | 823 | if ($method == self::REQUEST_CLOSE || $method == self::REQUEST_REFUND) { 824 | /** 825 | * OTPay close and refund (extra timeout) 826 | * 827 | */ 828 | curl_setopt($ch, CURLOPT_TIMEOUT, 600); 829 | } else { 830 | curl_setopt($ch, CURLOPT_TIMEOUT, 30); 831 | } 832 | 833 | curl_setopt($ch, CURLOPT_MAXREDIRS, 4); 834 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 835 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 836 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 837 | 838 | $httpHost = self::getHttpHost(); 839 | 840 | if (!empty($httpHost)) { 841 | curl_setopt($ch, CURLOPT_REFERER, $httpHost); 842 | } 843 | 844 | $postData = array( 845 | 'method' => $method, 846 | 'json' => json_encode(get_object_vars($request)), 847 | ); 848 | 849 | curl_setopt($ch, CURLOPT_POST, true); 850 | curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); 851 | curl_setopt($ch, CURLOPT_USERAGENT, self::getUserAgent($method)); 852 | 853 | if (self::isDebugCommunication()) { 854 | curl_setopt($ch, CURLINFO_HEADER_OUT, true); 855 | } 856 | 857 | if (self::getConfig()->gatewayProxy != '') { 858 | curl_setopt($ch, CURLOPT_PROXY, self::getConfig()->gatewayProxy); 859 | } 860 | 861 | $httpResponse = curl_exec($ch); 862 | 863 | if ($httpResponse === false) { 864 | $e = new Exception(sprintf('Communication error: %s', curl_error($ch))); 865 | 866 | curl_close($ch); 867 | 868 | throw $e; 869 | } 870 | 871 | $sdkDebugInfo = array(); 872 | 873 | if (self::isDebugCommunication()) { 874 | $sdkDebugInfo = array( 875 | 'curl_getinfo' => curl_getinfo($ch), 876 | 'post_data' => $postData 877 | ); 878 | } 879 | 880 | curl_close($ch); 881 | 882 | return new Response($httpResponse, $sdkDebugInfo); 883 | } 884 | 885 | /** 886 | * Get authorization header 887 | * 888 | * @return string 889 | * @access private 890 | * @static 891 | * @throws \BigFish\PaymentGateway\Exception 892 | */ 893 | private static function getAuthorizationHeader() 894 | { 895 | return 'Authorization: Basic ' . base64_encode(self::getConfig()->storeName . ':' . self::getConfig()->apiKey); 896 | } 897 | 898 | /** 899 | * Get user agent string 900 | * 901 | * @param string $method 902 | * @return string 903 | * @access private 904 | * @static 905 | * @throws \BigFish\PaymentGateway\Exception 906 | */ 907 | private static function getUserAgent($method) 908 | { 909 | return sprintf('%s | %s | %s | %s', $method, self::getHttpHost(), 'PHP', phpversion()); 910 | } 911 | 912 | /** 913 | * Get HTTP host 914 | * 915 | * @return string 916 | * @access private 917 | * @static 918 | */ 919 | private static function getHttpHost() 920 | { 921 | if (isset($_SERVER['HTTP_HOST']) && !empty($_SERVER['HTTP_HOST'])) { 922 | return $_SERVER['HTTP_HOST']; 923 | } 924 | 925 | if (function_exists('php_uname')) { 926 | return php_uname('n'); 927 | } 928 | 929 | return 'localhost'; 930 | } 931 | 932 | } 933 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Autoload.php: -------------------------------------------------------------------------------- 1 | $value) { 113 | $this->__set($key, $value); 114 | } 115 | } 116 | } 117 | 118 | /** 119 | * Set magic method 120 | * 121 | * @param string $name 122 | * @param string $value 123 | * @return void 124 | * @access public 125 | */ 126 | public function __set($name, $value) 127 | { 128 | if (property_exists($this, $name)) { 129 | if ($name == 'testMode') { 130 | $this->{$name} = (boolean)$value; 131 | } else { 132 | $this->{$name} = (string)$value; 133 | } 134 | } 135 | } 136 | 137 | /** 138 | * Get magic method 139 | * 140 | * @param string $name 141 | * @return string | null 142 | * @access public 143 | */ 144 | public function __get($name) 145 | { 146 | if (property_exists($this, $name)) { 147 | return $this->{$name}; 148 | } 149 | return null; 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/Info.php: -------------------------------------------------------------------------------- 1 | data[$infoObject->getStructurePath()])) { 32 | $this->data[$infoObject->getStructurePath()] = array(); 33 | } 34 | array_push($this->data[$infoObject->getStructurePath()], $infoObject->getUcFirstData()); 35 | return $this; 36 | } 37 | 38 | if ($infoObject instanceof InfoAbstract) { 39 | $this->data[$infoObject->getStructurePath()] = $infoObject->getUcFirstData(); 40 | } 41 | 42 | return $this; 43 | } 44 | 45 | /** 46 | * @return array 47 | */ 48 | public function getData() 49 | { 50 | $finalData = array(); 51 | 52 | foreach ($this->data as $pathString => $value) { 53 | $pathArray = explode('/', $pathString); 54 | $temp = &$finalData; 55 | 56 | foreach($pathArray as $key) { 57 | $temp = &$temp[$key]; 58 | } 59 | $temp = $value; 60 | unset($temp); 61 | } 62 | 63 | return isset($finalData[$this->getStructurePath()]) ? $finalData[$this->getStructurePath()] : array(); 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getStructurePath() 70 | { 71 | return PaymentGateway::PATH_INFO; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/Info/InfoAbstract.php: -------------------------------------------------------------------------------- 1 | data; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function getStructurePath() 39 | { 40 | return ''; 41 | } 42 | 43 | /** 44 | * @return array 45 | */ 46 | public function getUcFirstData() 47 | { 48 | $data = array(); 49 | foreach ($this->getData() as $key => $item) { 50 | $data[ucfirst($key)] = $item; 51 | } 52 | return $data; 53 | } 54 | 55 | /** 56 | * @param string $value 57 | * @param string $fieldName 58 | * @return $this 59 | * @throws Exception 60 | */ 61 | protected function setData($value, $fieldName) 62 | { 63 | $this->data[$fieldName] = $value; 64 | return $this; 65 | } 66 | } -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/Info/InfoCustomerBrowser.php: -------------------------------------------------------------------------------- 1 | setData($acceptHeader, 'acceptHeader'); 32 | } 33 | 34 | /** 35 | * @param string $javaEnabled 36 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerBrowser 37 | */ 38 | public function setJavaEnabled($javaEnabled) 39 | { 40 | return $this->setData($javaEnabled, 'javaEnabled'); 41 | } 42 | 43 | /** 44 | * @param string $language 45 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerBrowser 46 | */ 47 | public function setLanguage($language) 48 | { 49 | return $this->setData($language, 'language'); 50 | } 51 | 52 | /** 53 | * @param string $colorDepth 54 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerBrowser 55 | */ 56 | public function setColorDepth($colorDepth) 57 | { 58 | return $this->setData($colorDepth, 'colorDepth'); 59 | } 60 | 61 | /** 62 | * @param string $screenHeight 63 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerBrowser 64 | */ 65 | public function setScreenHeight($screenHeight) 66 | { 67 | return $this->setData($screenHeight, 'screenHeight'); 68 | } 69 | 70 | /** 71 | * @param string $screenWidth 72 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerBrowser 73 | */ 74 | public function setScreenWidth($screenWidth) 75 | { 76 | return $this->setData($screenWidth, 'screenWidth'); 77 | } 78 | 79 | /** 80 | * @param string $timeZone 81 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerBrowser 82 | */ 83 | public function setTimeZone($timeZone) 84 | { 85 | return $this->setData($timeZone, 'timeZone'); 86 | } 87 | 88 | /** 89 | * @param string $userAgent 90 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerBrowser 91 | */ 92 | public function setUserAgent($userAgent) 93 | { 94 | return $this->setData($userAgent, 'userAgent'); 95 | } 96 | 97 | /** 98 | * @param string $value 99 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerBrowser 100 | */ 101 | public function setWindowSize($value) 102 | { 103 | return $this->setData($value, 'windowSize'); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/Info/InfoCustomerGeneral.php: -------------------------------------------------------------------------------- 1 | setData($firstName, 'firstName'); 32 | } 33 | 34 | /** 35 | * @param string $lastName 36 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerGeneral 37 | */ 38 | public function setLastName($lastName) 39 | { 40 | return $this->setData($lastName, 'lastName'); 41 | } 42 | 43 | /** 44 | * @param string $email 45 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerGeneral 46 | */ 47 | public function setEmail($email) 48 | { 49 | return $this->setData($email, 'email'); 50 | } 51 | 52 | /** 53 | * @param string $ip 54 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerGeneral 55 | */ 56 | public function setIp($ip) 57 | { 58 | return $this->setData($ip, 'ip'); 59 | } 60 | 61 | /** 62 | * @param string $homePhoneCc 63 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerGeneral 64 | */ 65 | public function setHomePhoneCc($homePhoneCc) 66 | { 67 | return $this->setData($homePhoneCc, 'homePhoneCc'); 68 | } 69 | 70 | /** 71 | * @param string $homePhone 72 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerGeneral 73 | */ 74 | public function setHomePhone($homePhone) 75 | { 76 | return $this->setData($homePhone, 'homePhone'); 77 | } 78 | 79 | /** 80 | * @param string $mobilePhoneCc 81 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerGeneral 82 | */ 83 | public function setMobilePhoneCc($mobilePhoneCc) 84 | { 85 | return $this->setData($mobilePhoneCc, 'mobilePhoneCc'); 86 | } 87 | 88 | /** 89 | * @param string $mobilePhone 90 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerGeneral 91 | */ 92 | public function setMobilePhone($mobilePhone) 93 | { 94 | return $this->setData($mobilePhone, 'mobilePhone'); 95 | } 96 | 97 | /** 98 | * @param string $workPhoneCc 99 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerGeneral 100 | */ 101 | public function setWorkPhoneCc($workPhoneCc) 102 | { 103 | return $this->setData($workPhoneCc, 'workPhoneCc'); 104 | } 105 | 106 | /** 107 | * @param string $workPhone 108 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerGeneral 109 | */ 110 | public function setWorkPhone($workPhone) 111 | { 112 | return $this->setData($workPhone, 'workPhone'); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/Info/InfoCustomerStoreSpecific.php: -------------------------------------------------------------------------------- 1 | setData($updateDate, 'updateDate'); 32 | } 33 | 34 | /** 35 | * @param string $updateDateIndicator 36 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 37 | */ 38 | public function setUpdateDateIndicator($updateDateIndicator) 39 | { 40 | return $this->setData($updateDateIndicator, 'updateDateIndicator'); 41 | } 42 | 43 | /** 44 | * @param string $creationDate 45 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 46 | */ 47 | public function setCreationDate($creationDate) 48 | { 49 | return $this->setData($creationDate, 'creationDate'); 50 | } 51 | 52 | /** 53 | * @param string $creationDateIndicator 54 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 55 | */ 56 | public function setCreationDateIndicator($creationDateIndicator) 57 | { 58 | return $this->setData($creationDateIndicator, 'creationDateIndicator'); 59 | } 60 | 61 | /** 62 | * @param string $passwordChangeDate 63 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 64 | */ 65 | public function setPasswordChangeDate($passwordChangeDate) 66 | { 67 | return $this->setData($passwordChangeDate, 'passwordChangeDate'); 68 | } 69 | 70 | /** 71 | * @param string $passwordChangeDateIndicator 72 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 73 | */ 74 | public function setPasswordChangeDateIndicator($passwordChangeDateIndicator) 75 | { 76 | return $this->setData($passwordChangeDateIndicator, 'passwordChangeDateIndicator'); 77 | } 78 | 79 | /** 80 | * @param string $authenticationTimestamp 81 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 82 | */ 83 | public function setAuthenticationTimestamp($authenticationTimestamp) 84 | { 85 | return $this->setData($authenticationTimestamp, 'authenticationTimestamp'); 86 | } 87 | 88 | /** 89 | * @param string $authenticationMethod 90 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 91 | */ 92 | public function setAuthenticationMethod($authenticationMethod) 93 | { 94 | return $this->setData($authenticationMethod, 'authenticationMethod'); 95 | } 96 | 97 | /** 98 | * @param string $challengeIndicator 99 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 100 | */ 101 | public function setChallengeIndicator($challengeIndicator) 102 | { 103 | return $this->setData($challengeIndicator, 'challengeIndicator'); 104 | } 105 | 106 | /** 107 | * @param string $shippingAddressFirstUse 108 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 109 | */ 110 | public function setShippingAddressFirstUse($shippingAddressFirstUse) 111 | { 112 | return $this->setData($shippingAddressFirstUse, 'shippingAddressFirstUse'); 113 | } 114 | 115 | /** 116 | * @param string $shippingAddressFirstUseIndicator 117 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 118 | */ 119 | public function setShippingAddressFirstUseIndicator($shippingAddressFirstUseIndicator) 120 | { 121 | return $this->setData($shippingAddressFirstUseIndicator, 'shippingAddressFirstUseIndicator'); 122 | } 123 | 124 | /** 125 | * @param string $cardTransactionsLastDay 126 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 127 | */ 128 | public function setCardTransactionsLastDay($cardTransactionsLastDay) 129 | { 130 | return $this->setData($cardTransactionsLastDay, 'cardTransactionsLastDay'); 131 | } 132 | 133 | /** 134 | * @param string $cardCreationDate 135 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 136 | */ 137 | public function setCardCreationDate($cardCreationDate) 138 | { 139 | return $this->setData($cardCreationDate, 'cardCreationDate'); 140 | } 141 | 142 | /** 143 | * @param string $cardCreationDateIndicator 144 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 145 | */ 146 | public function setCardCreationDateIndicator($cardCreationDateIndicator) 147 | { 148 | return $this->setData($cardCreationDateIndicator, 'cardCreationDateIndicator'); 149 | } 150 | 151 | /** 152 | * @param string $transactionsLastDay 153 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 154 | */ 155 | public function setTransactionsLastDay($transactionsLastDay) 156 | { 157 | return $this->setData($transactionsLastDay, 'transactionsLastDay'); 158 | } 159 | 160 | /** 161 | * @param string $transactionsLastYear 162 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 163 | */ 164 | public function setTransactionsLastYear($transactionsLastYear) 165 | { 166 | return $this->setData($transactionsLastYear, 'transactionsLastYear'); 167 | } 168 | 169 | /** 170 | * @param string $purchasesLastSixMonths 171 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 172 | */ 173 | public function setPurchasesLastSixMonths($purchasesLastSixMonths) 174 | { 175 | return $this->setData($purchasesLastSixMonths, 'purchasesLastSixMonths'); 176 | } 177 | 178 | /** 179 | * @param string $suspiciousActivity 180 | * @return \BigFish\PaymentGateway\Data\Info\InfoCustomerStoreSpecific 181 | */ 182 | public function setSuspiciousActivity($suspiciousActivity) 183 | { 184 | return $this->setData($suspiciousActivity, 'suspiciousActivity'); 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/Info/InfoInterface.php: -------------------------------------------------------------------------------- 1 | setData($deliveryEmail, 'deliveryEmail'); 32 | } 33 | 34 | /** 35 | * @param string $deliveryTimeFrame 36 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 37 | */ 38 | public function setDeliveryTimeFrame($deliveryTimeFrame) 39 | { 40 | return $this->setData($deliveryTimeFrame, 'deliveryTimeFrame'); 41 | } 42 | 43 | /** 44 | * @param string $giftCardAmount 45 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 46 | */ 47 | public function setGiftCardAmount($giftCardAmount) 48 | { 49 | return $this->setData($giftCardAmount, 'giftCardAmount'); 50 | } 51 | 52 | /** 53 | * @param string $giftCardCount 54 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 55 | */ 56 | public function setGiftCardCount($giftCardCount) 57 | { 58 | return $this->setData($giftCardCount, 'giftCardCount'); 59 | } 60 | 61 | /** 62 | * @param string $giftCardCurrency 63 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 64 | */ 65 | public function setGiftCardCurrency($giftCardCurrency) 66 | { 67 | return $this->setData($giftCardCurrency, 'giftCardCurrency'); 68 | } 69 | 70 | /** 71 | * @param string $preorderDate 72 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 73 | */ 74 | public function setPreorderDate($preorderDate) 75 | { 76 | return $this->setData($preorderDate, 'preorderDate'); 77 | } 78 | 79 | /** 80 | * @param string $availability 81 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 82 | */ 83 | public function setAvailability($availability) 84 | { 85 | return $this->setData($availability, 'availability'); 86 | } 87 | 88 | /** 89 | * @param string $reorderItems 90 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 91 | */ 92 | public function setReorderItems($reorderItems) 93 | { 94 | return $this->setData($reorderItems, 'reorderItems'); 95 | } 96 | 97 | /** 98 | * @param string $shippingMethod 99 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 100 | */ 101 | public function setShippingMethod($shippingMethod) 102 | { 103 | return $this->setData($shippingMethod, 'shippingMethod'); 104 | } 105 | 106 | /** 107 | * @param string $addressMatchIndicator 108 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 109 | */ 110 | public function setAddressMatchIndicator($addressMatchIndicator) 111 | { 112 | return $this->setData($addressMatchIndicator, 'addressMatchIndicator'); 113 | } 114 | 115 | /** 116 | * @param string $differentShippingName 117 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 118 | */ 119 | public function setDifferentShippingName($differentShippingName) 120 | { 121 | return $this->setData($differentShippingName, 'differentShippingName'); 122 | } 123 | 124 | /** 125 | * @param string $transactionType 126 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderGeneral 127 | */ 128 | public function setTransactionType($transactionType) 129 | { 130 | return $this->setData($transactionType, 'transactionType'); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/Info/InfoOrderProductItem.php: -------------------------------------------------------------------------------- 1 | setData($sku, 'sku'); 32 | } 33 | 34 | /** 35 | * @param mixed $name 36 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderProductItem 37 | */ 38 | public function setName($name) 39 | { 40 | return $this->setData($name, 'name'); 41 | } 42 | 43 | /** 44 | * @param mixed $quantity 45 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderProductItem 46 | */ 47 | public function setQuantity($quantity) 48 | { 49 | return $this->setData($quantity, 'quantity'); 50 | } 51 | 52 | /** 53 | * @param mixed $quantityUnit 54 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderProductItem 55 | */ 56 | public function setQuantityUnit($quantityUnit) 57 | { 58 | return $this->setData($quantityUnit, 'quantityUnit'); 59 | } 60 | 61 | /** 62 | * @param mixed $unitPrice 63 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderProductItem 64 | */ 65 | public function setUnitPrice($unitPrice) 66 | { 67 | return $this->setData($unitPrice, 'unitPrice'); 68 | } 69 | 70 | /** 71 | * @param mixed $imageUrl 72 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderProductItem 73 | */ 74 | public function setImageUrl($imageUrl) 75 | { 76 | return $this->setData($imageUrl, 'imageUrl'); 77 | } 78 | 79 | /** 80 | * @param mixed $description 81 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderProductItem 82 | */ 83 | public function setDescription($description) 84 | { 85 | return $this->setData($description, 'description'); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/Info/InfoOrderRecurringPayment.php: -------------------------------------------------------------------------------- 1 | setData($expireDate, 'expireDate'); 32 | } 33 | 34 | /** 35 | * @param string $frequency 36 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderRecurringPayment 37 | */ 38 | public function setFrequency($frequency) 39 | { 40 | return $this->setData($frequency, 'frequency'); 41 | } 42 | 43 | /** 44 | * @param string $amountIndicator 45 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderRecurringPayment 46 | */ 47 | public function setAmountIndicator($amountIndicator) 48 | { 49 | return $this->setData($amountIndicator, 'amountIndicator'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/Info/InfoOrderShippingData.php: -------------------------------------------------------------------------------- 1 | setData($firstName, 'firstName'); 32 | } 33 | 34 | /** 35 | * @param string $lastName 36 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 37 | */ 38 | public function setLastName($lastName) 39 | { 40 | return $this->setData($lastName, 'lastName'); 41 | } 42 | 43 | /** 44 | * @param string $email 45 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 46 | */ 47 | public function setEmail($email) 48 | { 49 | return $this->setData($email, 'email'); 50 | } 51 | 52 | /** 53 | * @param string $phoneCc 54 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 55 | */ 56 | public function setPhoneCc($phoneCc) 57 | { 58 | return $this->setData($phoneCc, 'phoneCc'); 59 | } 60 | 61 | /** 62 | * @param string $phone 63 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 64 | */ 65 | public function setPhone($phone) 66 | { 67 | return $this->setData($phone, 'phone'); 68 | } 69 | 70 | /** 71 | * @param string $city 72 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 73 | */ 74 | public function setCity($city) 75 | { 76 | return $this->setData($city, 'city'); 77 | } 78 | 79 | /** 80 | * @param string $country 81 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 82 | */ 83 | public function setCountry($country) 84 | { 85 | return $this->setData($country, 'country'); 86 | } 87 | 88 | /** 89 | * @param string $countryCode1 90 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 91 | */ 92 | public function setCountryCode1($countryCode1) 93 | { 94 | return $this->setData($countryCode1, 'countryCode1'); 95 | } 96 | 97 | /** 98 | * @param string $countryCode2 99 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 100 | */ 101 | public function setCountryCode2($countryCode2) 102 | { 103 | return $this->setData($countryCode2, 'countryCode2'); 104 | } 105 | 106 | /** 107 | * @param string $countryCode3 108 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 109 | */ 110 | public function setCountryCode3($countryCode3) 111 | { 112 | return $this->setData($countryCode3, 'countryCode3'); 113 | } 114 | 115 | /** 116 | * @param string $line1 117 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 118 | */ 119 | public function setLine1($line1) 120 | { 121 | return $this->setData($line1, 'line1'); 122 | } 123 | 124 | /** 125 | * @param string $line2 126 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 127 | */ 128 | public function setLine2($line2) 129 | { 130 | return $this->setData($line2, 'line2'); 131 | } 132 | 133 | /** 134 | * @param string $line3 135 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 136 | */ 137 | public function setLine3($line3) 138 | { 139 | return $this->setData($line3, 'line3'); 140 | } 141 | 142 | /** 143 | * @param string $postalCode 144 | * @return \BigFish\PaymentGateway\Data\Info\InfoOrderShippingData 145 | */ 146 | public function setPostalCode($postalCode) 147 | { 148 | return $this->setData($postalCode, 'postalCode'); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/PayWallAbstract.php: -------------------------------------------------------------------------------- 1 | {$var} === null) { 24 | continue; 25 | } 26 | $data[ucfirst($var)] = $this->{$var}; 27 | } 28 | return $data; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/PayWallSettings.php: -------------------------------------------------------------------------------- 1 | OTP]) 55 | * @var array 56 | * @access public 57 | */ 58 | public $fallbackPaymentProviders; 59 | 60 | /** 61 | * Custom payment provider name (eg: [CIB => [card => 'Custom Payment options name']]) 62 | * @var array 63 | * @access public 64 | */ 65 | public $customPaymentOptionName; 66 | 67 | /** 68 | * Enable one click payment on payment page 69 | * 70 | * @var bool 71 | * @access public 72 | */ 73 | public $oneClickEnabled; 74 | 75 | /** 76 | * Enable User preferred sorting on payment page by last success payment 77 | * 78 | * @var bool 79 | * @access public 80 | */ 81 | public $userPreferredSortingEnabled; 82 | } 83 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Data/PayWallStoreSettings.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/CancelAllPaymentRegistrations.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 57 | $this->providerName = $providerName; 58 | $this->userId = $userId; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/CancelPaymentRegistration.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Close.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 54 | $this->approved = (($approved === true || $approved == "true") ? "true" : "false"); 55 | } 56 | 57 | /** 58 | * Set approved amount 59 | * 60 | * @param float $approvedAmount 61 | * @return \BigFish\PaymentGateway\Request\Close 62 | * @access public 63 | */ 64 | public function setApprovedAmount($approvedAmount) 65 | { 66 | $this->approvedAmount = (float)$approvedAmount; 67 | return $this; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Details.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 54 | $this->getRelatedTransactions = (($getRelatedTransactions === true || $getRelatedTransactions == "true") ? true : false); 55 | $this->getInfoData = (($getInfoData === true || $getInfoData == "true") ? true : false); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Finalize.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 46 | $this->amount = (float)$amount; 47 | } 48 | 49 | /** 50 | * Get object parameters 51 | * 52 | * @return string 53 | * @access public 54 | * @throws \BigFish\PaymentGateway\Exception 55 | */ 56 | public function getParams() 57 | { 58 | unset($this->responseMode); 59 | return parent::getParams(); 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/GetPaymentRegistrations.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 66 | $this->providerName = $providerName; 67 | $this->userId = $userId; 68 | $this->paymentRegistrationType = $paymentRegistrationType; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Init.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 298 | $this->moduleName = PaymentGateway::getConfig()->moduleName; 299 | $this->moduleVersion = PaymentGateway::getConfig()->moduleVersion; 300 | } 301 | 302 | /** 303 | * Set module name 304 | * 305 | * @param string $moduleName 306 | * @return Init 307 | * @access public 308 | */ 309 | public function setModuleName($moduleName) 310 | { 311 | $this->moduleName = $moduleName; 312 | return $this; 313 | } 314 | 315 | /** 316 | * Set module version 317 | * 318 | * @param string $moduleVersion 319 | * @return Init 320 | * @access public 321 | */ 322 | public function setModuleVersion($moduleVersion) 323 | { 324 | $this->moduleVersion = $moduleVersion; 325 | return $this; 326 | } 327 | 328 | /** 329 | * Set the identifier of the selected payment provider 330 | * 331 | * @param string $providerName Identifier of the selected payment provider 332 | * @return Init 333 | * @access public 334 | */ 335 | public function setProviderName($providerName) 336 | { 337 | $this->providerName = $providerName; 338 | return $this; 339 | } 340 | 341 | /** 342 | * Set the URL where Users will be sent back after payment 343 | * 344 | * @param string $responseUrl Response URL 345 | * (e.g. http://www.yourdomain.com/response.php, http://www.yourdomain.com/response.php?someparam=somevalue etc.) 346 | * @return Init 347 | * @access public 348 | */ 349 | public function setResponseUrl($responseUrl) 350 | { 351 | $this->responseUrl = $responseUrl; 352 | return $this; 353 | } 354 | 355 | /** 356 | * Set Notification URL 357 | * 358 | * @param string $notificationUrl 359 | * @return Init 360 | * @access public 361 | */ 362 | public function setNotificationUrl($notificationUrl) 363 | { 364 | $this->notificationUrl = trim($notificationUrl); 365 | return $this; 366 | } 367 | 368 | /** 369 | * Set payment transaction amount 370 | * 371 | * @param float $amount Transaction amount 372 | * @return Init 373 | * @access public 374 | */ 375 | public function setAmount($amount) 376 | { 377 | $this->amount = $amount; 378 | return $this; 379 | } 380 | 381 | /** 382 | * Set the identifier of the order in your system 383 | * 384 | * @param mixed $orderId Order identifier 385 | * @return Init 386 | * @access public 387 | */ 388 | public function setOrderId($orderId) 389 | { 390 | $this->orderId = $orderId; 391 | return $this; 392 | } 393 | 394 | /** 395 | * Set the identifier of the user in your system 396 | * 397 | * @param mixed $userId User identifier 398 | * @return Init 399 | * @access public 400 | */ 401 | public function setUserId($userId) 402 | { 403 | $this->userId = $userId; 404 | return $this; 405 | } 406 | 407 | /** 408 | * Set payment transaction currency 409 | * 410 | * @param string $currency Three-letter ISO currency code (e.g. HUF, USD etc.) 411 | * @return Init 412 | * @access public 413 | */ 414 | public function setCurrency($currency) 415 | { 416 | $this->currency = (($currency) ? $currency : 'HUF'); 417 | return $this; 418 | } 419 | 420 | /** 421 | * Set the language 422 | * 423 | * @param string $language Language (e.g. HU, EN, DE etc.) 424 | * @return Init 425 | * @access public 426 | */ 427 | public function setLanguage($language) 428 | { 429 | $this->language = (($language) ? $language : 'HU'); 430 | return $this; 431 | } 432 | 433 | /** 434 | * Set the Mobile Payment or MasterCard Mobile identifier 435 | * Works with MPP, MPP2 and OTPay providers 436 | * 437 | * @param string $mppPhoneNumber Mobile Payment identifier (e.g. 123456789) or phone number of the user (e.g. 36301234567) 438 | * @return Init 439 | * @access public 440 | */ 441 | public function setMppPhoneNumber($mppPhoneNumber) 442 | { 443 | $this->mppPhoneNumber = $mppPhoneNumber; 444 | return $this; 445 | } 446 | 447 | /** 448 | * Set the card number of the user 449 | * Works with OTP2 provider 450 | * 451 | * @param string $otpCardNumber Card number (e.g. 1111222233334444 or 1111 2222 3333 4444) 452 | * @return Init 453 | * @access public 454 | */ 455 | public function setOtpCardNumber($otpCardNumber) 456 | { 457 | $this->otpCardNumber = $otpCardNumber; 458 | return $this; 459 | } 460 | 461 | /** 462 | * Set the card expiration date 463 | * Works with OTP2 provider 464 | * 465 | * @param string $otpExpiration Expiration date - mm/yy (e.g. 0512 or 05/12) 466 | * @return Init 467 | * @access public 468 | */ 469 | public function setOtpExpiration($otpExpiration) 470 | { 471 | $this->otpExpiration = $otpExpiration; 472 | return $this; 473 | } 474 | 475 | /** 476 | * Set the card verification code 477 | * Works with OTP2 provider 478 | * 479 | * @param string $otpCvc Verification code (e.g. 123) 480 | * @return Init 481 | * @access public 482 | */ 483 | public function setOtpCvc($otpCvc) 484 | { 485 | $this->otpCvc = $otpCvc; 486 | return $this; 487 | } 488 | 489 | /** 490 | * Set the Pocket Id of the user 491 | * Works with OTP provider 492 | * 493 | * @param string $otpCardPocketId Pocket Id 494 | * (e.g. 03) 495 | * @return Init 496 | * @access public 497 | */ 498 | public function setOtpCardPocketId($otpCardPocketId) 499 | { 500 | $this->otpCardPocketId = $otpCardPocketId; 501 | return $this; 502 | } 503 | 504 | /** 505 | * Set Consumer Registration Id 506 | * Works with OTP provider 507 | * 508 | * @param string $otpConsumerRegistrationId Consumer Registration Id 509 | * (e.g. 03) 510 | * @return Init 511 | * @access public 512 | */ 513 | public function setOtpConsumerRegistrationId($otpConsumerRegistrationId) 514 | { 515 | $this->otpConsumerRegistrationId = $otpConsumerRegistrationId; 516 | return $this; 517 | } 518 | 519 | /** 520 | * Set cafeteria id 521 | * Works with MKBSZEP provider 522 | * 523 | * @param integer $mkbSzepCafeteriaId 524 | * @return Init 525 | * @access public 526 | */ 527 | public function setMkbSzepCafeteriaId($mkbSzepCafeteriaId) 528 | { 529 | $this->mkbSzepCafeteriaId = (int)$mkbSzepCafeteriaId; 530 | return $this; 531 | } 532 | 533 | /** 534 | * Set the card number of the user 535 | * Works with MKBSZEP provider 536 | * 537 | * @param string $mkbSzepCardNumber Card number (e.g. 1111222233334444 or 1111 2222 3333 4444) 538 | * @return Init 539 | * @access public 540 | */ 541 | public function setMkbSzepCardNumber($mkbSzepCardNumber) 542 | { 543 | $this->mkbSzepCardNumber = $mkbSzepCardNumber; 544 | return $this; 545 | } 546 | 547 | /** 548 | * Set the card verification value 549 | * Works with MKBSZEP provider 550 | * 551 | * @param string $mkbSzepCvv Verification code (e.g. 123) 552 | * @return Init 553 | * @access public 554 | */ 555 | public function setMkbSzepCvv($mkbSzepCvv) 556 | { 557 | $this->mkbSzepCvv = $mkbSzepCvv; 558 | return $this; 559 | } 560 | 561 | /** 562 | * Enable or disable One Click Payment of the user 563 | * 564 | * @param boolean $oneClickPayment true or false 565 | * @return Init 566 | * @access public 567 | */ 568 | public function setOneClickPayment($oneClickPayment = false) 569 | { 570 | $this->oneClickPayment = ($oneClickPayment === true || $oneClickPayment === "true"); 571 | return $this; 572 | } 573 | 574 | /** 575 | * Enable or disable One Click Payment with forced registration 576 | * 577 | * @param boolean $oneClickForcedRegistration true or false 578 | * @return Init 579 | * @access public 580 | */ 581 | public function setOneClickForcedRegistration($oneClickForcedRegistration = false) 582 | { 583 | $this->oneClickForcedRegistration = ($oneClickForcedRegistration === true || $oneClickForcedRegistration === "true"); 584 | return $this; 585 | } 586 | 587 | /** 588 | * Set One Click Payment Reference Id 589 | * 590 | * @param string $oneClickReferenceId 591 | * @return Init 592 | * @access public 593 | */ 594 | public function setOneClickReferenceId($oneClickReferenceId) 595 | { 596 | $this->oneClickReferenceId = $oneClickReferenceId; 597 | return $this; 598 | } 599 | 600 | /** 601 | * Payment registration or pay by registered device 602 | * 603 | * @param boolean | null $paymentRegistration 604 | * @return Init 605 | * @access public 606 | */ 607 | public function setPaymentRegistration($paymentRegistration = true) 608 | { 609 | $this->paymentRegistration = is_null($paymentRegistration) ? null : (int)filter_var($paymentRegistration, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); 610 | return $this; 611 | } 612 | 613 | /** 614 | * Set payment registration type 615 | * 616 | * @param string $paymentRegistrationType 617 | * @return Init 618 | * @access public 619 | */ 620 | public function setPaymentRegistrationType($paymentRegistrationType) 621 | { 622 | $this->paymentRegistrationType = $paymentRegistrationType; 623 | return $this; 624 | } 625 | 626 | /** 627 | * Set reference transaction ID 628 | * 629 | * @param string $referenceTransactionId 630 | * @return Init 631 | * @access public 632 | */ 633 | public function setReferenceTransactionId($referenceTransactionId) 634 | { 635 | $this->referenceTransactionId = $referenceTransactionId; 636 | return $this; 637 | } 638 | 639 | /** 640 | * If true verifies the availability of funds and captures funds in one step. 641 | * If false verifies the availability of funds and reserves them for later capture. 642 | * 643 | * @param boolean $autoCommit true or false 644 | * @return Init 645 | * @access public 646 | */ 647 | public function setAutoCommit($autoCommit = true) 648 | { 649 | $this->autoCommit = (($autoCommit === true || $autoCommit == "true") ? "true" : "false"); 650 | return $this; 651 | } 652 | 653 | /** 654 | * Card data handling on BIG FISH Payment Gateway payment page or Merchant website 655 | * Works with MKBSZEP provider 656 | * 657 | * @param boolean $gatewayPaymentPage true or false 658 | * @return Init 659 | * @access public 660 | */ 661 | public function setGatewayPaymentPage($gatewayPaymentPage = false) 662 | { 663 | $this->gatewayPaymentPage = (($gatewayPaymentPage === true || $gatewayPaymentPage == "true") ? true : false); 664 | return $this; 665 | } 666 | 667 | /** 668 | * @param Info $infoObject 669 | * @return Init 670 | * @throws Exception 671 | */ 672 | public function setInfoObject($infoObject) 673 | { 674 | if (!$infoObject instanceof Info) { 675 | throw new Exception('Invalid info parameter'); 676 | } 677 | 678 | $this->setInfo($infoObject->getData()); 679 | return $this; 680 | } 681 | 682 | /** 683 | * @param array $info 684 | * @return Init 685 | */ 686 | public function setInfo(array $info = array()) 687 | { 688 | if (!empty($info)) { 689 | $this->info = $this->urlSafeEncode(json_encode($info)); 690 | } 691 | 692 | return $this; 693 | } 694 | 695 | /** 696 | * Set extra data 697 | * 698 | * @param array $extra Extra information (Except OTP2 provider) 699 | * @return Init 700 | * @access public 701 | * @throws Exception 702 | */ 703 | public function setExtra(array $extra = array()) 704 | { 705 | if ((in_array($this->providerName, self::$oneClickProviders) && isset($this->oneClickForcedRegistration) && $this->oneClickForcedRegistration)) { 706 | $extra['oneClickForcedRegistration'] = true; 707 | } 708 | 709 | if (!empty($extra)) { 710 | $this->extra = $this->urlSafeEncode(json_encode($extra)); 711 | } 712 | 713 | if (!($this->providerName == PaymentGateway::PROVIDER_OTP && !empty($this->otpCardPocketId))) { 714 | unset($this->otpCardPocketId); 715 | } 716 | 717 | if (!(in_array($this->providerName, self::$oneClickProviders) && isset($this->oneClickPayment) && $this->oneClickPayment)) { 718 | unset($this->oneClickPayment); 719 | } 720 | 721 | if (!(in_array($this->providerName, self::$oneClickProviders) && isset($this->oneClickReferenceId) && strlen($this->oneClickReferenceId))) { 722 | unset($this->oneClickReferenceId); 723 | } 724 | 725 | if (!(in_array($this->providerName, self::$oneClickProviders) && isset($this->paymentRegistration) && !is_null($this->paymentRegistration))) { 726 | unset($this->paymentRegistration); 727 | } 728 | 729 | if (!(in_array($this->providerName, self::$oneClickProviders) && isset($this->paymentRegistrationType) && strlen($this->paymentRegistrationType))) { 730 | unset($this->paymentRegistrationType); 731 | } 732 | 733 | if (!(in_array($this->providerName, self::$oneClickProviders) && isset($this->referenceTransactionId) && strlen($this->referenceTransactionId))) { 734 | unset($this->referenceTransactionId); 735 | } 736 | 737 | unset($this->otpCardNumber); 738 | unset($this->otpExpiration); 739 | unset($this->otpCvc); 740 | unset($this->otpConsumerRegistrationId); 741 | unset($this->mkbSzepCardNumber); 742 | unset($this->mkbSzepCvv); 743 | unset($this->oneClickForcedRegistration); 744 | 745 | return $this; 746 | } 747 | 748 | /** 749 | * Encrypt extra data 750 | * 751 | * @param array $data 752 | * @return void 753 | * @access public 754 | * @throws Exception 755 | * 756 | * @deprecated deprecated since version 3.18.1 757 | */ 758 | public function encryptExtra(array $data = array()) 759 | { 760 | if (!function_exists('openssl_public_encrypt')) { 761 | throw new Exception('OpenSSL PHP module is not loaded'); 762 | } 763 | 764 | $encrypted = null; 765 | 766 | $extra = json_encode($data); 767 | 768 | openssl_public_encrypt($extra, $encrypted, PaymentGateway::getConfig()->encryptPublicKey); 769 | 770 | $this->extra = $this->urlSafeEncode($encrypted); 771 | } 772 | } 773 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/InitRP.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 120 | $this->moduleName = PaymentGateway::getConfig()->moduleName; 121 | $this->moduleVersion = PaymentGateway::getConfig()->moduleVersion; 122 | } 123 | 124 | /** 125 | * Set module name 126 | * 127 | * @param string $moduleName 128 | * @return InitRP 129 | * @access public 130 | */ 131 | public function setModuleName($moduleName) 132 | { 133 | $this->moduleName = $moduleName; 134 | return $this; 135 | } 136 | 137 | /** 138 | * Set module version 139 | * 140 | * @param string $moduleVersion 141 | * @return InitRP 142 | * @access public 143 | */ 144 | public function setModuleVersion($moduleVersion) 145 | { 146 | $this->moduleVersion = $moduleVersion; 147 | return $this; 148 | } 149 | 150 | /** 151 | * Set the reference Payment Gateway transaction ID 152 | * 153 | * @param string $referenceTransactionId Identifier of the reference transaction ID 154 | * @return InitRP 155 | * @access public 156 | */ 157 | public function setReferenceTransactionId($referenceTransactionId) 158 | { 159 | $this->referenceTransactionId = $referenceTransactionId; 160 | return $this; 161 | } 162 | 163 | /** 164 | * Set the URL where Users will be sent back after payment 165 | * 166 | * @param string $responseUrl Response URL 167 | * (e.g. http://www.yourdomain.com/response.php, http://www.yourdomain.com/response.php?someparam=somevalue etc.) 168 | * @return InitRP 169 | * @access public 170 | */ 171 | public function setResponseUrl($responseUrl) 172 | { 173 | $this->responseUrl = $responseUrl; 174 | return $this; 175 | } 176 | 177 | /** 178 | * Set Notification URL 179 | * 180 | * @param string $notificationUrl 181 | * @return InitRP 182 | * @access public 183 | */ 184 | public function setNotificationUrl($notificationUrl) 185 | { 186 | $this->notificationUrl = trim($notificationUrl); 187 | return $this; 188 | } 189 | 190 | /** 191 | * Set payment transaction amount 192 | * 193 | * @param float $amount Transaction amount 194 | * @return InitRP 195 | * @access public 196 | */ 197 | public function setAmount($amount) 198 | { 199 | $this->amount = $amount; 200 | return $this; 201 | } 202 | 203 | /** 204 | * Set the identifier of the order in your system 205 | * 206 | * @param mixed $orderId Order identifier 207 | * @return InitRP 208 | * @access public 209 | */ 210 | public function setOrderId($orderId) 211 | { 212 | $this->orderId = $orderId; 213 | return $this; 214 | } 215 | 216 | /** 217 | * Set the identifier of the user in your system 218 | * 219 | * @param mixed $userId User identifier 220 | * @return InitRP 221 | * @access public 222 | */ 223 | public function setUserId($userId) 224 | { 225 | $this->userId = $userId; 226 | return $this; 227 | } 228 | 229 | /** 230 | * Set payment transaction currency 231 | * 232 | * @param string $currency Three-letter ISO currency code (e.g. HUF, USD etc.) 233 | * @return InitRP 234 | * @access public 235 | */ 236 | public function setCurrency($currency) 237 | { 238 | $this->currency = $currency; 239 | return $this; 240 | } 241 | 242 | /** 243 | * @param Info $infoObject 244 | * @return InitRP 245 | * @throws Exception 246 | */ 247 | public function setInfoObject($infoObject) 248 | { 249 | if (!$infoObject instanceof Info) { 250 | throw new Exception('Invalid info parameter'); 251 | } 252 | 253 | $this->setInfo($infoObject->getData()); 254 | return $this; 255 | } 256 | 257 | /** 258 | * @param array $info 259 | * @return InitRP 260 | */ 261 | public function setInfo(array $info = array()) 262 | { 263 | if (!empty($info)) { 264 | $this->info = $this->urlSafeEncode(json_encode($info)); 265 | } 266 | 267 | return $this; 268 | } 269 | } 270 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Invoice.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 46 | $this->invoiceData = (array)$invoiceData; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Log.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/OneClickOptions.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 57 | $this->providerName = $providerName; 58 | $this->userId = $userId; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/OneClickTokenCancel.php: -------------------------------------------------------------------------------- 1 | paywallPaymentName = $paywallPaymentName; 45 | } 46 | 47 | /** 48 | * Set if Details response should include transactions data 49 | * 50 | * @param bool $getTransactions getTransactions flag 51 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentDetails 52 | * @access public 53 | */ 54 | public function setGetTransactions($getTransactions) 55 | { 56 | $this->getTransactions = $getTransactions; 57 | return $this; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/PayWallPaymentInit.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 162 | $this->moduleName = PaymentGateway::getConfig()->moduleName; 163 | $this->moduleVersion = PaymentGateway::getConfig()->moduleVersion; 164 | } 165 | 166 | /** 167 | * Set module name 168 | * 169 | * @param string $moduleName 170 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 171 | * @access public 172 | */ 173 | public function setModuleName($moduleName) 174 | { 175 | $this->moduleName = $moduleName; 176 | return $this; 177 | } 178 | 179 | /** 180 | * Set module version 181 | * 182 | * @param string $moduleVersion 183 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 184 | * @access public 185 | */ 186 | public function setModuleVersion($moduleVersion) 187 | { 188 | $this->moduleVersion = $moduleVersion; 189 | return $this; 190 | } 191 | 192 | /** 193 | * Set the URL where Users will be sent back after payment 194 | * 195 | * @param string $responseUrl Response URL 196 | * (e.g. http://www.yourdomain.com/response.php, http://www.yourdomain.com/response.php?someparam=somevalue etc.) 197 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 198 | * @access public 199 | */ 200 | public function setResponseUrl($responseUrl) 201 | { 202 | $this->responseUrl = $responseUrl; 203 | return $this; 204 | } 205 | 206 | /** 207 | * Set Notification URL 208 | * 209 | * @param string $notificationUrl 210 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 211 | * @access public 212 | */ 213 | public function setNotificationUrl($notificationUrl) 214 | { 215 | $this->notificationUrl = trim($notificationUrl); 216 | return $this; 217 | } 218 | 219 | /** 220 | * Set Cancel URL 221 | * 222 | * @param string $cancelUrl 223 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 224 | * @access public 225 | */ 226 | public function setCancelUrl($cancelUrl) 227 | { 228 | $this->cancelUrl = trim($cancelUrl); 229 | return $this; 230 | } 231 | 232 | /** 233 | * Set payment transaction amount 234 | * 235 | * @param float $amount Transaction amount 236 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 237 | * @access public 238 | */ 239 | public function setAmount($amount) 240 | { 241 | $this->amount = $amount; 242 | return $this; 243 | } 244 | 245 | /** 246 | * Set the identifier of the order in your system 247 | * 248 | * @param mixed $orderId Order identifier 249 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 250 | * @access public 251 | */ 252 | public function setOrderId($orderId) 253 | { 254 | $this->orderId = $orderId; 255 | return $this; 256 | } 257 | 258 | /** 259 | * Set the identifier of the user in your system 260 | * 261 | * @param mixed $userId User identifier 262 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 263 | * @access public 264 | */ 265 | public function setUserId($userId) 266 | { 267 | $this->userId = $userId; 268 | return $this; 269 | } 270 | 271 | /** 272 | * Set payment transaction currency 273 | * 274 | * @param string $currency Three-letter ISO currency code (e.g. HUF, USD etc.) 275 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 276 | * @access public 277 | */ 278 | public function setCurrency($currency) 279 | { 280 | $this->currency = (($currency) ? $currency : 'HUF'); 281 | return $this; 282 | } 283 | 284 | /** 285 | * Set the language 286 | * 287 | * @param string $language Language (e.g. HU, EN, DE etc.) 288 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 289 | * @access public 290 | */ 291 | public function setLanguage($language) 292 | { 293 | $this->language = (($language) ? $language : 'HU'); 294 | return $this; 295 | } 296 | 297 | /** 298 | * If true verifies the availability of funds and captures funds in one step. 299 | * If false verifies the availability of funds and reserves them for later capture. 300 | * 301 | * @param boolean $autoCommit true or false 302 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 303 | * @access public 304 | */ 305 | public function setAutoCommit($autoCommit = true) 306 | { 307 | $this->autoCommit = (($autoCommit === true || $autoCommit === "true") ? "true" : "false"); 308 | return $this; 309 | } 310 | 311 | /** 312 | * @param array $settings 313 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 314 | * @access public 315 | */ 316 | public function setSettings(array $settings = array()) 317 | { 318 | $this->settings = $this->urlSafeEncode(json_encode($settings)); 319 | return $this; 320 | } 321 | 322 | /** 323 | * @param Info $settingsObject 324 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 325 | * @access public 326 | * @throws Exception 327 | */ 328 | public function setSettingsObject($settingsObject) 329 | { 330 | if (!$settingsObject instanceof PayWallSettings) { 331 | throw new Exception('Invalid PayWall settings parameter'); 332 | } 333 | 334 | $this->setSettings($settingsObject->getData()); 335 | return $this; 336 | } 337 | 338 | /** 339 | * @param array $storeSettings 340 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 341 | * @access public 342 | */ 343 | public function setStoreSettings(array $storeSettings = array()) 344 | { 345 | $this->storeSettings = $this->urlSafeEncode(json_encode($storeSettings)); 346 | return $this; 347 | } 348 | 349 | /** 350 | * @param Info $storeSettingsObject 351 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 352 | * @access public 353 | * @throws Exception 354 | */ 355 | public function setStoreSettingsObject($storeSettingsObject) 356 | { 357 | if (!$storeSettingsObject instanceof PayWallStoreSettings) { 358 | throw new Exception('Invalid PayWall store settings parameter'); 359 | } 360 | 361 | $this->setSettings($storeSettingsObject->getData()); 362 | return $this; 363 | } 364 | 365 | /** 366 | * Set extra data 367 | * 368 | * @param array $extra Extra information 369 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 370 | * @access public 371 | */ 372 | public function setExtra(array $extra = array()) 373 | { 374 | if (!empty($extra)) { 375 | $this->extra = $this->urlSafeEncode(json_encode($extra)); 376 | } 377 | 378 | return $this; 379 | } 380 | 381 | /** 382 | * @param Info $infoObject 383 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 384 | * @access public 385 | * @throws Exception 386 | */ 387 | public function setInfoObject($infoObject) 388 | { 389 | if (!$infoObject instanceof Info) { 390 | throw new Exception('Invalid info parameter'); 391 | } 392 | 393 | $this->setInfo($infoObject->getData()); 394 | return $this; 395 | } 396 | 397 | /** 398 | * @param array $info 399 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentInit 400 | * @access public 401 | * @throws Exception 402 | */ 403 | public function setInfo(array $info = array()) 404 | { 405 | $this->info = $this->urlSafeEncode(json_encode($info)); 406 | return $this; 407 | } 408 | } 409 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/PayWallPaymentUpdate.php: -------------------------------------------------------------------------------- 1 | paywallPaymentName = $paywallPaymentName; 45 | } 46 | 47 | /** 48 | * Set payment transaction amount 49 | * 50 | * @param float $amount Transaction amount 51 | * @return \BigFish\PaymentGateway\Request\PayWallPaymentUpdate 52 | * @access public 53 | */ 54 | public function setAmount($amount) 55 | { 56 | $this->amount = $amount; 57 | return $this; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/PaymentLinkCancel.php: -------------------------------------------------------------------------------- 1 | paymentLinkName = $paymentLinkName; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/PaymentLinkCreate.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 220 | $this->moduleName = PaymentGateway::getConfig()->moduleName; 221 | $this->moduleVersion = PaymentGateway::getConfig()->moduleVersion; 222 | } 223 | 224 | /** 225 | * Set the identifier of the selected payment provider 226 | * 227 | * @param string $providerName Identifier of the selected payment provider 228 | * @return PaymentLinkCreate 229 | * @access public 230 | */ 231 | public function setProviderName($providerName) 232 | { 233 | $this->providerName = $providerName; 234 | return $this; 235 | } 236 | 237 | /** 238 | * Set payment transaction amount 239 | * 240 | * @param float $amount Transaction amount 241 | * @return PaymentLinkCreate 242 | * @access public 243 | */ 244 | public function setAmount($amount) 245 | { 246 | $this->amount = $amount; 247 | $this->minimumAmount = null; 248 | $this->maximumAmount = null; 249 | return $this; 250 | } 251 | 252 | /** 253 | * Set payment transaction flexible amount 254 | * 255 | * @param float $minimumAmount Transaction minimum amount 256 | * @param float|null $maximumAmount Transaction maximum amount 257 | * @return PaymentLinkCreate 258 | */ 259 | public function setFlexibleAmount($minimumAmount, $maximumAmount = null) 260 | { 261 | $this->amount = null; 262 | $this->minimumAmount = $minimumAmount; 263 | $this->maximumAmount = $maximumAmount; 264 | return $this; 265 | } 266 | 267 | /** 268 | * Set payment transaction currency 269 | * 270 | * @param string $currency Three-letter ISO currency code (e.g. HUF, USD etc.) 271 | * @return PaymentLinkCreate 272 | * @access public 273 | */ 274 | public function setCurrency($currency) 275 | { 276 | $this->currency = $currency; 277 | return $this; 278 | } 279 | 280 | /** 281 | * Set multiple transactions 282 | * 283 | * @param boolean $multipleTransactions true or false 284 | * @return PaymentLinkCreate 285 | * @access public 286 | */ 287 | public function setMultipleTransactions($multipleTransactions = true) 288 | { 289 | $this->multipleTransactions = (($multipleTransactions === true || $multipleTransactions == "true") ? true : false); 290 | return $this; 291 | } 292 | 293 | /** 294 | * Set the language 295 | * 296 | * @param string $language Language (e.g. HU, EN, DE etc.) 297 | * @return PaymentLinkCreate 298 | * @access public 299 | */ 300 | public function setLanguage($language) 301 | { 302 | $this->language = (($language) ? $language : 'HU'); 303 | return $this; 304 | } 305 | 306 | /** 307 | * Set the identifier of the order in your system 308 | * 309 | * @param mixed $orderId Order identifier 310 | * @return PaymentLinkCreate 311 | * @access public 312 | */ 313 | public function setOrderId($orderId) 314 | { 315 | $this->orderId = $orderId; 316 | return $this; 317 | } 318 | 319 | /** 320 | * Set the identifier of the user in your system 321 | * 322 | * @param mixed $userId User identifier 323 | * @return PaymentLinkCreate 324 | * @access public 325 | */ 326 | public function setUserId($userId) 327 | { 328 | $this->userId = $userId; 329 | return $this; 330 | } 331 | 332 | /** 333 | * If true verifies the availability of funds and captures funds in one step. 334 | * If false verifies the availability of funds and reserves them for later capture. 335 | * 336 | * @param boolean $autoCommit true or false 337 | * @return PaymentLinkCreate 338 | * @access public 339 | */ 340 | public function setAutoCommit($autoCommit = true) 341 | { 342 | $this->autoCommit = (($autoCommit === true || $autoCommit == "true") ? "true" : "false"); 343 | return $this; 344 | } 345 | 346 | /** 347 | * Set Expiration Time 348 | * 349 | * @param string $expirationTime 350 | * @return PaymentLinkCreate 351 | * @access public 352 | */ 353 | public function setExpirationTime($expirationTime) 354 | { 355 | $this->expirationTime = trim($expirationTime); 356 | return $this; 357 | } 358 | 359 | /** 360 | * Set Notification URL 361 | * 362 | * @param string $notificationUrl 363 | * @return PaymentLinkCreate 364 | * @access public 365 | */ 366 | public function setNotificationUrl($notificationUrl) 367 | { 368 | $this->notificationUrl = trim($notificationUrl); 369 | return $this; 370 | } 371 | 372 | /** 373 | * Set Notification Email 374 | * 375 | * @param string $notificationEmail 376 | * @return PaymentLinkCreate 377 | * @access public 378 | */ 379 | public function setNotificationEmail($notificationEmail) 380 | { 381 | $this->notificationEmail = trim($notificationEmail); 382 | return $this; 383 | } 384 | 385 | /** 386 | * Set email notification only success 387 | * 388 | * @param boolean $emailNotificationOnlySuccess true or false 389 | * @return PaymentLinkCreate 390 | * @access public 391 | */ 392 | public function setEmailNotificationOnlySuccess($emailNotificationOnlySuccess = true) 393 | { 394 | $this->emailNotificationOnlySuccess = (($emailNotificationOnlySuccess === true || $emailNotificationOnlySuccess == "true") ? true : false); 395 | return $this; 396 | } 397 | 398 | /** 399 | * Set information form 400 | * 401 | * @param string $infoForm 402 | * @return PaymentLinkCreate 403 | * @access public 404 | */ 405 | public function setInfoForm($infoForm) 406 | { 407 | $this->infoForm = trim($infoForm); 408 | return $this; 409 | } 410 | 411 | /** 412 | * Set privacy policy url 413 | * 414 | * @param string $privacyPolicyUrl 415 | * @return PaymentLinkCreate 416 | * @access public 417 | */ 418 | public function setPrivacyPolicyUrl($privacyPolicyUrl) 419 | { 420 | $this->privacyPolicyUrl = trim($privacyPolicyUrl); 421 | return $this; 422 | } 423 | 424 | /** 425 | * Set general terms and conditions url 426 | * 427 | * @param string $privacyPolicyUrl 428 | * @return PaymentLinkCreate 429 | * @access public 430 | */ 431 | public function setGeneralTermsAndConditionsUrl($generalTermsAndConditionsUrl) 432 | { 433 | $this->generalTermsAndConditionsUrl = trim($generalTermsAndConditionsUrl); 434 | return $this; 435 | } 436 | 437 | /** 438 | * Set redirect url 439 | * 440 | * @param string $redirectUrl 441 | * @return PaymentLinkCreate 442 | * @access public 443 | */ 444 | public function setRedirectUrl($redirectUrl) 445 | { 446 | $this->redirectUrl = trim($redirectUrl); 447 | return $this; 448 | } 449 | 450 | /** 451 | * Set extra data 452 | * 453 | * @param array $extra Extra information 454 | * @return PaymentLinkCreate 455 | * @access public 456 | */ 457 | public function setExtra(array $extra = array()) 458 | { 459 | if (!empty($extra)) { 460 | $this->extra = $this->urlSafeEncode(json_encode($extra)); 461 | } 462 | 463 | return $this; 464 | } 465 | 466 | /** 467 | * @param Info $infoObject 468 | * @return PaymentLinkCreate 469 | * @throws Exception 470 | */ 471 | public function setInfoObject($infoObject) 472 | { 473 | if (!$infoObject instanceof Info) { 474 | throw new Exception('Invalid info parameter'); 475 | } 476 | 477 | $this->setInfo($infoObject->getData()); 478 | return $this; 479 | } 480 | 481 | /** 482 | * @param array $info 483 | * @return PaymentLinkCreate 484 | */ 485 | public function setInfo(array $info = array()) 486 | { 487 | if (!empty($info)) { 488 | $this->info = $this->urlSafeEncode(json_encode($info)); 489 | } 490 | 491 | return $this; 492 | } 493 | /** 494 | * Set module name 495 | * 496 | * @param string $moduleName 497 | * @return PaymentLinkCreate 498 | * @access public 499 | */ 500 | public function setModuleName($moduleName) 501 | { 502 | $this->moduleName = $moduleName; 503 | return $this; 504 | } 505 | 506 | /** 507 | * Set module version 508 | * 509 | * @param string $moduleVersion 510 | * @return PaymentLinkCreate 511 | * @access public 512 | */ 513 | public function setModuleVersion($moduleVersion) 514 | { 515 | $this->moduleVersion = $moduleVersion; 516 | return $this; 517 | } 518 | } 519 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/PaymentLinkDetails.php: -------------------------------------------------------------------------------- 1 | paymentLinkName = $paymentLinkName; 45 | $this->getInfoData = (($getInfoData === true || $getInfoData == "true") ? true : false); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Payout.php: -------------------------------------------------------------------------------- 1 | moduleName = PaymentGateway::getConfig()->moduleName; 98 | $this->moduleVersion = PaymentGateway::getConfig()->moduleVersion; 99 | } 100 | 101 | /** 102 | * Set payout type 103 | * 104 | * @param string $payoutType 105 | * @return Payout 106 | * @access public 107 | */ 108 | public function setPayoutType($payoutType) 109 | { 110 | $this->payoutType = $payoutType; 111 | return $this; 112 | } 113 | 114 | /** 115 | * Set reference Payment Gateway transaction ID 116 | * 117 | * @param string $referenceTransactionId Identifier of the reference transaction ID 118 | * @return Payout 119 | * @access public 120 | */ 121 | public function setReferenceTransactionId($referenceTransactionId) 122 | { 123 | $this->referenceTransactionId = $referenceTransactionId; 124 | return $this; 125 | } 126 | 127 | /** 128 | * Set payout amount 129 | * 130 | * @param float $amount Payout amount 131 | * @return Payout 132 | * @access public 133 | */ 134 | public function setAmount($amount) 135 | { 136 | $this->amount = $amount; 137 | return $this; 138 | } 139 | 140 | /** 141 | * Set the identifier of the order in your system 142 | * 143 | * @param mixed $orderId Order identifier 144 | * @return Payout 145 | * @access public 146 | */ 147 | public function setOrderId($orderId) 148 | { 149 | $this->orderId = $orderId; 150 | return $this; 151 | } 152 | 153 | /** 154 | * Additional message that the card acceptor might want to provide 155 | * 156 | * @param mixed $additionalMessage Additional message 157 | * @return Payout 158 | * @access public 159 | */ 160 | public function setAdditionalMessage($additionalMessage) 161 | { 162 | $this->additionalMessage = $additionalMessage; 163 | return $this; 164 | } 165 | 166 | /** 167 | * @param Info $infoObject 168 | * @return Payout 169 | * @throws Exception 170 | * @access public 171 | */ 172 | public function setInfoObject($infoObject) 173 | { 174 | if (!$infoObject instanceof Info) { 175 | throw new Exception('Invalid info parameter'); 176 | } 177 | 178 | $this->setInfo($infoObject->getData()); 179 | return $this; 180 | } 181 | 182 | /** 183 | * @param array $info 184 | * @return Payout 185 | * @access public 186 | */ 187 | public function setInfo(array $info = array()) 188 | { 189 | if (!empty($info)) { 190 | $this->info = $this->urlSafeEncode(json_encode($info)); 191 | } 192 | 193 | return $this; 194 | } 195 | 196 | /** 197 | * Set module name 198 | * 199 | * @param string $moduleName 200 | * @return Payout 201 | * @access public 202 | */ 203 | public function setModuleName($moduleName) 204 | { 205 | $this->moduleName = $moduleName; 206 | return $this; 207 | } 208 | 209 | /** 210 | * Set module version 211 | * 212 | * @param string $moduleVersion 213 | * @return Payout 214 | * @access public 215 | */ 216 | public function setModuleVersion($moduleVersion) 217 | { 218 | $this->moduleVersion = $moduleVersion; 219 | return $this; 220 | } 221 | } 222 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Providers.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Refund.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 54 | $this->amount = (float)$amount; 55 | } 56 | 57 | /** 58 | * Set extra data 59 | * 60 | * @param array $extra Extra information 61 | * @return \BigFish\PaymentGateway\Request\Refund 62 | * @access public 63 | */ 64 | public function setExtra(array $extra = array()) 65 | { 66 | if (!empty($extra)) { 67 | $this->extra = $this->urlSafeEncode(json_encode($extra)); 68 | } 69 | 70 | return $this; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/RequestAbstract.php: -------------------------------------------------------------------------------- 1 | $value) { 33 | $value = trim($value); 34 | 35 | if (!empty($value) && is_scalar($value)) { 36 | $params[] = ucfirst($name) . "=" . $value; 37 | } 38 | } 39 | return implode("&", $params); 40 | } 41 | 42 | /** 43 | * Encode object parameter values 44 | * 45 | * @return void 46 | * @access public 47 | */ 48 | public function encodeValues() 49 | { 50 | foreach (get_object_vars($this) as $key => $value) { 51 | if (is_scalar($value)) { 52 | $value = trim($value); 53 | $this->{$key} = $value; 54 | } 55 | } 56 | } 57 | 58 | /** 59 | * URL safe encode (base64) 60 | * 61 | * @param string $string 62 | * @return string 63 | * @access protected 64 | */ 65 | protected function urlSafeEncode($string) 66 | { 67 | $data = str_replace(array('+', '/', '='), array('-', '_', '.'), base64_encode($string)); 68 | return $data; 69 | } 70 | 71 | /** 72 | * Uppercase object properties 73 | * 74 | * @return void 75 | * @access public 76 | */ 77 | public function ucfirstProps() 78 | { 79 | foreach (get_object_vars($this) as $key => $value) { 80 | unset($this->{$key}); 81 | 82 | $this->{ucfirst($key)} = $value; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Result.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Settlement.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 119 | } 120 | 121 | /** 122 | * Set the identifier of the selected payment provider 123 | * 124 | * @param string $providerName Identifier of the selected payment provider 125 | * @return \BigFish\PaymentGateway\Request\Settlement 126 | * @access public 127 | */ 128 | public function setProviderName($providerName) 129 | { 130 | $this->providerName = $providerName; 131 | return $this; 132 | } 133 | 134 | /** 135 | * Set terminal ID 136 | * 137 | * @param string $terminalId Terminal ID 138 | * @return \BigFish\PaymentGateway\Request\Settlement 139 | * @access public 140 | */ 141 | public function setTerminalId($terminalId) 142 | { 143 | $this->terminalId = $terminalId; 144 | return $this; 145 | } 146 | 147 | /** 148 | * Set settlement date 149 | * 150 | * @param string $settlementDate Settlement date 151 | * @return \BigFish\PaymentGateway\Request\Settlement 152 | * @access public 153 | */ 154 | public function setSettlementDate($settlementDate) 155 | { 156 | $this->settlementDate = $settlementDate; 157 | return $this; 158 | } 159 | 160 | /** 161 | * Set transfer Notice 162 | * 163 | * @param string $transferNotice Transfer notice 164 | * @return \BigFish\PaymentGateway\Request\Settlement 165 | * @access public 166 | */ 167 | public function setTransferNotice($transferNotice) 168 | { 169 | $this->transferNotice = $transferNotice; 170 | return $this; 171 | } 172 | 173 | /** 174 | * Set transaction currency 175 | * 176 | * @param string $transactionCurrency Transaction currency 177 | * @return \BigFish\PaymentGateway\Request\Settlement 178 | * @access public 179 | */ 180 | public function setTransactionCurrency($transactionCurrency) 181 | { 182 | $this->transactionCurrency = $transactionCurrency; 183 | return $this; 184 | } 185 | 186 | /** 187 | * Set settlement batch ID 188 | * 189 | * @param integer $settlementBatchId Settlement batch ID 190 | * @return \BigFish\PaymentGateway\Request\Settlement 191 | * @access public 192 | */ 193 | public function setSettlementBatchId($settlementBatchId) 194 | { 195 | $this->settlementBatchId = (int)$settlementBatchId; 196 | return $this; 197 | } 198 | 199 | /** 200 | * Set get batches 201 | * 202 | * @param boolean $getBatches Get batches: true or false 203 | * @return \BigFish\PaymentGateway\Request\Settlement 204 | * @access public 205 | */ 206 | public function setGetBatches($getBatches = true) 207 | { 208 | $this->getBatches = (($getBatches === false || $getBatches === "false") ? false : true); 209 | return $this; 210 | } 211 | 212 | /** 213 | * Set get items 214 | * 215 | * @param boolean $getItems Get items: true or false 216 | * @return \BigFish\PaymentGateway\Request\Settlement 217 | * @access public 218 | */ 219 | public function setGetItems($getItems = true) 220 | { 221 | $this->getItems = (($getItems === false || $getItems === "false") ? false : true); 222 | return $this; 223 | } 224 | 225 | /** 226 | * Set transaction items limit 227 | * 228 | * @param integer $limit Limit 229 | * @return \BigFish\PaymentGateway\Request\Settlement 230 | * @access public 231 | */ 232 | public function setLimit($limit) 233 | { 234 | $this->limit = (int)$limit; 235 | return $this; 236 | } 237 | 238 | /** 239 | * Set transaction items offset 240 | * 241 | * @param integer $offset Offset 242 | * @return \BigFish\PaymentGateway\Request\Settlement 243 | * @access public 244 | */ 245 | public function setOffset($offset) 246 | { 247 | $this->offset = (int)$offset; 248 | return $this; 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/SettlementRefund.php: -------------------------------------------------------------------------------- 1 | storeName = PaymentGateway::getConfig()->storeName; 103 | } 104 | 105 | /** 106 | * Set the identifier of the selected payment provider 107 | * 108 | * @param string $providerName Identifier of the selected payment provider 109 | * @return \BigFish\PaymentGateway\Request\SettlementRefund 110 | * @access public 111 | */ 112 | public function setProviderName($providerName) 113 | { 114 | $this->providerName = $providerName; 115 | return $this; 116 | } 117 | 118 | /** 119 | * Set terminal ID 120 | * 121 | * @param string $terminalId Terminal ID 122 | * @return \BigFish\PaymentGateway\Request\SettlementRefund 123 | * @access public 124 | */ 125 | public function setTerminalId($terminalId) 126 | { 127 | $this->terminalId = $terminalId; 128 | return $this; 129 | } 130 | 131 | /** 132 | * Set refund settlement date 133 | * 134 | * @param string $refundSettlementDate Refund settlement date 135 | * @return \BigFish\PaymentGateway\Request\SettlementRefund 136 | * @access public 137 | */ 138 | public function setRefundSettlementDate($refundSettlementDate) 139 | { 140 | $this->refundSettlementDate = $refundSettlementDate; 141 | return $this; 142 | } 143 | 144 | /** 145 | * Set refund settlement ID 146 | * 147 | * @param string $refundSettlementId Refund settlement ID 148 | * @return \BigFish\PaymentGateway\Request\SettlementRefund 149 | * @access public 150 | */ 151 | public function setRefundSettlementId($refundSettlementId) 152 | { 153 | $this->refundSettlementId = $refundSettlementId; 154 | return $this; 155 | } 156 | 157 | /** 158 | * Set get batches 159 | * 160 | * @param boolean $getBatches Get batches: true or false 161 | * @return \BigFish\PaymentGateway\Request\SettlementRefund 162 | * @access public 163 | */ 164 | public function setGetBatches($getBatches = true) 165 | { 166 | $this->getBatches = (($getBatches === false || $getBatches === "false") ? false : true); 167 | return $this; 168 | } 169 | 170 | /** 171 | * Set get items 172 | * 173 | * @param boolean $getItems Get items: true or false 174 | * @return \BigFish\PaymentGateway\Request\SettlementRefund 175 | * @access public 176 | */ 177 | public function setGetItems($getItems = true) 178 | { 179 | $this->getItems = (($getItems === false || $getItems === "false") ? false : true); 180 | return $this; 181 | } 182 | 183 | /** 184 | * Set transaction items limit 185 | * 186 | * @param integer $limit Limit 187 | * @return \BigFish\PaymentGateway\Request\SettlementRefund 188 | * @access public 189 | */ 190 | public function setLimit($limit) 191 | { 192 | $this->limit = (int)$limit; 193 | return $this; 194 | } 195 | 196 | /** 197 | * Set transaction items offset 198 | * 199 | * @param integer $offset Offset 200 | * @return \BigFish\PaymentGateway\Request\SettlementRefund 201 | * @access public 202 | */ 203 | public function setOffset($offset) 204 | { 205 | $this->offset = (int)$offset; 206 | return $this; 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/Start.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 37 | } 38 | 39 | /** 40 | * Get object parameters 41 | * 42 | * @return string 43 | * @access public 44 | * @throws \BigFish\PaymentGateway\Exception 45 | */ 46 | public function getParams() 47 | { 48 | unset($this->responseMode); 49 | 50 | return parent::getParams(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Request/StartRP.php: -------------------------------------------------------------------------------- 1 | transactionId = $transactionId; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/BigFish/PaymentGateway/Response.php: -------------------------------------------------------------------------------- 1 | setObject($object); 39 | } 40 | 41 | if (!empty($sdkDebugInfo)){ 42 | $this->setValue("sdkDebugInfo", $sdkDebugInfo); 43 | } 44 | } 45 | 46 | /** 47 | * Set object 48 | * 49 | * @param object $object 50 | * @return void 51 | * @access protected 52 | * @throws Exception 53 | */ 54 | protected function setObject($object) 55 | { 56 | foreach (get_object_vars($object) as $name => $value) { 57 | if (is_string($value) && is_object(json_decode($value))) { 58 | $this->{$name} = new Response($value); 59 | } else { 60 | $this->setValue($name, $value); 61 | } 62 | } 63 | } 64 | 65 | /** 66 | * Set value 67 | * 68 | * @param string $name 69 | * @param string|array $value 70 | * @return void 71 | * @access protected 72 | * @throws Exception 73 | */ 74 | protected function setValue($name, $value) 75 | { 76 | if (is_string($value) && PaymentGateway::getConfig()->outCharset != "UTF-8") { 77 | $value = iconv("UTF-8", PaymentGateway::getConfig()->outCharset, $value); 78 | } 79 | 80 | if (is_string($value) && is_array(json_decode($value))) { 81 | $value = json_decode($value); 82 | } 83 | 84 | $this->{ucfirst($name)} = $value; 85 | } 86 | 87 | } 88 | --------------------------------------------------------------------------------