MerchantUrls.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * This file is part of the Klarna KP module
  4. *
  5. * (c) Klarna Bank AB (publ)
  6. *
  7. * For the full copyright and license information, please view the NOTICE
  8. * and LICENSE files that were distributed with this source code.
  9. */
  10. namespace Klarna\Kp\Model\Api\Request;
  11. use Klarna\Kp\Api\Data\UrlsInterface;
  12. /**
  13. * Class MerchantUrls
  14. *
  15. * @package Klarna\Kp\Model\Api\Request
  16. */
  17. class MerchantUrls implements UrlsInterface
  18. {
  19. use \Klarna\Kp\Model\Api\Export;
  20. /**
  21. * @var string
  22. */
  23. private $confirmation;
  24. /**
  25. * @var string
  26. */
  27. private $push;
  28. /**
  29. * @var string
  30. */
  31. private $notification;
  32. /**
  33. * Constructor.
  34. *
  35. * @param string[] $data
  36. */
  37. public function __construct($data = [])
  38. {
  39. foreach ($data as $key => $value) {
  40. if (property_exists($this, $key)) {
  41. $this->$key = $value;
  42. $this->exports[] = $key;
  43. }
  44. }
  45. }
  46. /**
  47. * URL of merchant confirmation page.
  48. *
  49. * @param string $confirmation
  50. */
  51. public function setConfirmation($confirmation)
  52. {
  53. $this->confirmation = $confirmation;
  54. }
  55. /**
  56. * URL that will be requested when an order is completed. Should be different
  57. * than checkout and confirmation URLs. (max 2000 characters)
  58. *
  59. * @param string $push
  60. */
  61. public function setPush($push)
  62. {
  63. $this->push = $push;
  64. }
  65. /**
  66. * URL for notifications on pending orders. (max 2000 characters)
  67. *
  68. * @param string $notification
  69. */
  70. public function setNotification($notification)
  71. {
  72. $this->notification = $notification;
  73. }
  74. }