Guest User

Untitled

a guest
Nov 17th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. Dim oHttp
  2. Dim strResult
  3. Set oHttp = CreateObject("MSXML2.ServerXMLHTTP")
  4. oHttp.setOption(2) = 13056
  5. oHttp.open "POST", SOAP_ENDPOINT, false
  6. oHttp.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
  7. oHttp.setRequestHeader "SOAPAction", SOAP_NS + "/" & SOAP_FUNCTION
  8. oHttp.send SOAP_REQUEST
  9.  
  10. Dim oHttp
  11. Dim strResult
  12. Set oHttp = CreateObject("MSXML2.ServerXMLHTTP")
  13. oHttp.setOption(2) = 13056
  14. oHttp.setOption(3) = "certificate store name/friendlyname of certificate"
  15. oHttp.open "POST", SOAP_ENDPOINT, false
  16. oHttp.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
  17. oHttp.setRequestHeader "SOAPAction", SOAP_NS + "/" & SOAP_FUNCTION
  18. oHttp.send SOAP_REQUEST
  19.  
  20. New-SelfSignedCertificate -DnsName "ServerXMLHTTP", "ServerXMLHTTP" -CertStoreLocation "cert:LocalMachineMy"
  21.  
  22. Dim AuthToken: AuthToken = "<Base64 encoded version of ClientId:Secret>"
  23. Dim Http: Set http = Server.CreateObject("MSXML2.ServerXMLHTTP")
  24.  
  25. With Http
  26. Call .Open("POST", "https://api.sandbox.paypal.com/v1/oauth2/token", False)
  27. Call .SetOption(3, "LOCAL_MACHINEMyServerXMLHTTP")
  28. Call .SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
  29. Call .SetRequestHeader("Authorization", "Basic " & AuthToken)
  30. Call .Send("grant_type=client_credentials")
  31. End With
Add Comment
Please, Sign In to add comment