Source of file BraintreeHostedField.php
Size: 1,505 Bytes - Last Modified: 2021-12-23T10:03:09+00:00
/var/www/docs.ssmods.com/process/src/code/BraintreeHostedField.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 | <?php /** * Encapsulates a "hosted field" which is just a div that is referenced in the js setup and * injected with an iframe from the remote domain. * * @author Mark Guinn <mark@adaircreative.com> * @date 02.19.2016 * @package silvershop-braintree */ class BraintreeHostedField extends TextField { protected $brainTreeId; /** * @param string $name * @param null|string $title * @param string $value * @param int|null $maxLength * @param Form|null $form */ public function __construct($name, $title = null, $value = '', $maxLength = null, $form = null) { parent::__construct($name, $title, $value, $maxLength, $form); $this->brainTreeId = $name; } /** * @param array $properties * * @return string */ public function Field($properties = array()) { return '<div id="bthf-' . $this->getBrainTreeId() . '"></div>'; } /** * This is the css selector Braintree's js will use to inject the field * @return string */ public function getBraintreeSelector() { return '#bthf-' . $this->getBrainTreeId(); } /** * @return string */ public function getBrainTreeId() { return $this->brainTreeId; } /** * @param string $brainTreeId * * @return $this */ public function setBrainTreeId($brainTreeId) { $this->brainTreeId = $brainTreeId; return $this; } } |