Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim oHttp
- Dim strResult
- Set oHttp = CreateObject("MSXML2.ServerXMLHTTP")
- oHttp.setOption(2) = 13056
- oHttp.open "POST", SOAP_ENDPOINT, false
- oHttp.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
- oHttp.setRequestHeader "SOAPAction", SOAP_NS + "/" & SOAP_FUNCTION
- oHttp.send SOAP_REQUEST
- Dim oHttp
- Dim strResult
- Set oHttp = CreateObject("MSXML2.ServerXMLHTTP")
- oHttp.setOption(2) = 13056
- oHttp.setOption(3) = "certificate store name/friendlyname of certificate"
- oHttp.open "POST", SOAP_ENDPOINT, false
- oHttp.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
- oHttp.setRequestHeader "SOAPAction", SOAP_NS + "/" & SOAP_FUNCTION
- oHttp.send SOAP_REQUEST
- New-SelfSignedCertificate -DnsName "ServerXMLHTTP", "ServerXMLHTTP" -CertStoreLocation "cert:LocalMachineMy"
- Dim AuthToken: AuthToken = "<Base64 encoded version of ClientId:Secret>"
- Dim Http: Set http = Server.CreateObject("MSXML2.ServerXMLHTTP")
- With Http
- Call .Open("POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False)
- Call .SetOption(3, "LOCAL_MACHINEMyServerXMLHTTP")
- Call .SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
- Call .SetRequestHeader("Authorization", "Basic " & AuthToken)
- Call .Send("grant_type=client_credentials")
- End With
Add Comment
Please, Sign In to add comment