/** * Creates the object to specify the receiver’s phone number. * @param string $countryCode Telephone country code. * @param string $phoneNumber Telephone number. * @param string $extension Telephone extension. */ public function __construct( $countryCode , $phoneNumber , $extension = null ) { parent::__construct(); $this->setCountryCode( $countryCode ); $this->setPhoneNumber( $phoneNumber ); $this->setExtension( $extension ); }
/** * Creates the Receiver object that represents the party whose account * is credited. * @param float $amount Amount to be paid to the receiver. * @param string $email Receiver’s email address. * @param PhoneNumberType $phone Receiver’s phone number. * @throws UnexpectedValueException * @throws InvalidArgumentException * @throws LengthException */ public function __construct( $amount = null , $email = null , PhoneNumberType $phone = null ) { parent::__construct(); if ( func_num_args() > 0 ) { $this->setAmount( $amount ); if ( $email == null && $phone == null ) { throw new UnexpectedValueException( 'The PayRequest must pass either an email address or a phone number as the payment receiver' ); } else { if ( $email != null ) { $this->setEmail( $email ); } if ( $phone != null ) { $this->setPhone( $phone ); } } } }