|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * @link https://github.com/phpviet/omnipay-onepay |
| 4 | + * |
| 5 | + * @copyright (c) PHP Viet |
| 6 | + * @license [MIT](https://opensource.org/licenses/MIT) |
| 7 | + */ |
| 8 | + |
| 9 | +namespace Omnipay\OnePay\Concerns; |
| 10 | + |
| 11 | +/** |
| 12 | + * @author Vuong Minh <[email protected]> |
| 13 | + * @since 1.0.0 |
| 14 | + */ |
| 15 | +trait Parameters |
| 16 | +{ |
| 17 | + /** |
| 18 | + * Trả về giá trị merchant id do OnePay cấp. |
| 19 | + * |
| 20 | + * @return null|string |
| 21 | + */ |
| 22 | + public function getVpcMerchant(): ?string |
| 23 | + { |
| 24 | + $this->getParameter('vpc_Merchant'); |
| 25 | + } |
| 26 | + |
| 27 | + /** |
| 28 | + * Thiết lập giá trị merchant id. |
| 29 | + * |
| 30 | + * @param string $merchant |
| 31 | + * @return $this |
| 32 | + */ |
| 33 | + public function setVpcMerchant(string $merchant) |
| 34 | + { |
| 35 | + return $this->setParameter('vpc_Merchant', $merchant); |
| 36 | + } |
| 37 | + |
| 38 | + /** |
| 39 | + * Trả về giá trị access code do OnePay cấp. |
| 40 | + * |
| 41 | + * @return null|string |
| 42 | + */ |
| 43 | + public function getVpcAccessCode(): ?string |
| 44 | + { |
| 45 | + return $this->getParameter('vpc_AccessCode'); |
| 46 | + } |
| 47 | + |
| 48 | + /** |
| 49 | + * Thiết lập giá trị access code. |
| 50 | + * |
| 51 | + * @param string $code |
| 52 | + * @return $this |
| 53 | + */ |
| 54 | + public function setVpcAccessCode(string $code) |
| 55 | + { |
| 56 | + return $this->setParameter('vpc_AccessCode', $code); |
| 57 | + } |
| 58 | + |
| 59 | + /** |
| 60 | + * Trả về giá trị hash key do OnePay cấp. |
| 61 | + * |
| 62 | + * @return null|string |
| 63 | + */ |
| 64 | + public function getVpcHashKey(): ?string |
| 65 | + { |
| 66 | + return $this->getParameter('vpc_HashKey'); |
| 67 | + } |
| 68 | + |
| 69 | + /** |
| 70 | + * Thiết lập giá trị hash key dùng để tạo chữ ký dữ liệu (secure hash). |
| 71 | + * |
| 72 | + * @param string $key |
| 73 | + * @return $this |
| 74 | + */ |
| 75 | + public function setVpcHashKey(string $key) |
| 76 | + { |
| 77 | + return $this->setParameter('vpc_HashKey', $key); |
| 78 | + } |
| 79 | + |
| 80 | + /** |
| 81 | + * Trả về giá trị user do OnePay cấp. |
| 82 | + * |
| 83 | + * @return null|string |
| 84 | + */ |
| 85 | + public function getVpcUser(): ?string |
| 86 | + { |
| 87 | + return $this->getParameter('vpc_User'); |
| 88 | + } |
| 89 | + |
| 90 | + /** |
| 91 | + * Thiết lập giá trị user. |
| 92 | + * |
| 93 | + * @param string $user |
| 94 | + * @return $this |
| 95 | + */ |
| 96 | + public function setVpcUser(string $user) |
| 97 | + { |
| 98 | + return $this->setParameter('vpc_User', $user); |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * Trả về giá trị password do OnePay cấp. |
| 103 | + * |
| 104 | + * @return null|string |
| 105 | + */ |
| 106 | + public function getVpcPassword(): ?string |
| 107 | + { |
| 108 | + return $this->getParameter('vpc_Password'); |
| 109 | + } |
| 110 | + |
| 111 | + /** |
| 112 | + * Thiết lập giá trị password. |
| 113 | + * |
| 114 | + * @param string $password |
| 115 | + * @return $this |
| 116 | + */ |
| 117 | + public function setVpcPassword(string $password) |
| 118 | + { |
| 119 | + return $this->setParameter('vpc_Password', $password); |
| 120 | + } |
| 121 | + |
| 122 | + /** |
| 123 | + * Trả về giá trị version hiện tại. |
| 124 | + * |
| 125 | + * @return null|string |
| 126 | + */ |
| 127 | + public function getVpcVersion(): ?string |
| 128 | + { |
| 129 | + return $this->getParameter('vpc_Version'); |
| 130 | + } |
| 131 | + |
| 132 | + /** |
| 133 | + * Thiết lập giá trị version muốn sử dụng. |
| 134 | + * |
| 135 | + * @param string $version |
| 136 | + * @return $this |
| 137 | + */ |
| 138 | + public function setVpcVersion(string $version) |
| 139 | + { |
| 140 | + return $this->setParameter('vpc_Version', $version); |
| 141 | + } |
| 142 | + |
| 143 | + /** |
| 144 | + * Trả về đơn vị tiền tệ sử dụng thanh toán của khách. |
| 145 | + * |
| 146 | + * @return null|string |
| 147 | + */ |
| 148 | + public function getVpcCurrency(): ?string |
| 149 | + { |
| 150 | + return $this->getCurrency(); |
| 151 | + } |
| 152 | + |
| 153 | + /** |
| 154 | + * Thiết lập đơn vị tiền tệ sử dụng thanh toán của khách. |
| 155 | + * |
| 156 | + * @param string $currency |
| 157 | + * @return $this |
| 158 | + */ |
| 159 | + public function setVpcCurrency(string $currency) |
| 160 | + { |
| 161 | + return $this->setCurrency($currency); |
| 162 | + } |
| 163 | + |
| 164 | + /** |
| 165 | + * Trả giao diện ngôn ngữ khách dùng để thanh toán. |
| 166 | + * |
| 167 | + * @return null|string |
| 168 | + */ |
| 169 | + public function getVpcLocale(): ?string |
| 170 | + { |
| 171 | + return $this->getParameter('vpc_Locale'); |
| 172 | + } |
| 173 | + |
| 174 | + /** |
| 175 | + * Thiết lập giao diện ngôn ngữ khách dùng để thanh toán. |
| 176 | + * |
| 177 | + * @param string $locale |
| 178 | + * @return $this |
| 179 | + */ |
| 180 | + public function setVpcLocale(string $locale) |
| 181 | + { |
| 182 | + return $this->setParameter('vpc_Locale', $locale); |
| 183 | + } |
| 184 | + |
| 185 | + /** |
| 186 | + * {@inheritdoc} |
| 187 | + */ |
| 188 | + public function getCurrency(): ?string |
| 189 | + { |
| 190 | + return ($currency = $this->getParameter('vpc_Currency')) ? strtoupper($currency) : null; |
| 191 | + } |
| 192 | + |
| 193 | + /** |
| 194 | + * {@inheritdoc} |
| 195 | + */ |
| 196 | + public function setCurrency($value) |
| 197 | + { |
| 198 | + return $this->setParameter('vpc_Currency', $value); |
| 199 | + } |
| 200 | +} |
0 commit comments