/** * Creates the static SoapHeader * * This is the Custom Security Header passed to paypal. * * The username here is not the same as you account username and so is the password. * The subject is the payment on whose behalf you have been authorized to make the operation call. * * @param string $Username * @param string $Password * @param string $Signature * @param string $Subject */ public static function registerSoapHeader($Username, $Password, $Signature, $Subject = '') { $Credentials = new SoapVar(PayPalTypes::UserIdPasswordType($Username, $Password, $Signature, $Subject), SOAP_ENC_OBJECT); $headerNameSpace = 'urn:ebay:api:PayPalAPI'; $headerName = 'RequesterCredentials'; $headerData = array("Credentials" => $Credentials); $mustUnderstand = true; PayPalBase::setSoapHeader(new SoapHeader($headerNameSpace, $headerName, $headerData, $mustUnderstand)); }