Guest User

Untitled

a guest
Apr 14th, 2018
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. /*
  2. * Copyright 2005, 2008 PayPal, Inc. All Rights Reserved.
  3. */
  4. using System;
  5. using com.paypal.sdk.services;
  6. using com.paypal.sdk.profiles;
  7. using com.paypal.sdk.util;
  8. /**
  9. * PayPal .NET SDK sample code
  10. */
  11. namespace GenerateCodeNVP
  12. {
  13. /// <summary>
  14. /// Summary description for GetBalance.
  15. /// </summary>
  16. public class GetBalance
  17. {
  18. public GetBalance()
  19. {
  20. //
  21. // TODO: Add constructor logic here
  22. //
  23. }
  24. public string GetBalanceCode()
  25. {
  26. NVPCallerServices caller = new NVPCallerServices();
  27. IAPIProfile profile = ProfileFactory.createSignatureAPIProfile();
  28. /*
  29. WARNING: Do not embed plaintext credentials in your application code.
  30. Doing so is insecure and against best practices.
  31. Your API credentials must be handled securely. Please consider
  32. encrypting them for use in any production environment, and ensure
  33. that only authorized individuals may view or modify them.
  34. */
  35. profile.APIUsername = "sdk-three_api1.sdk.com";
  36. profile.APIPassword = "QFZCWN5HZM8VBG7Q";
  37. profile.APISignature = "AVGidzoSQiGWu.lGj3z15HLczXaaAcK6imHawrjefqgclVwBe8imgCHZ";
  38. profile.Environment="sandbox";
  39. caller.APIProfile = profile;
  40.  
  41. NVPCodec encoder = new NVPCodec();
  42. encoder["VERSION"] = "51.0";
  43. encoder["METHOD"] = "GetBalance";
  44. string pStrrequestforNvp= encoder.Encode();
  45. string pStresponsenvp=caller.Call(pStrrequestforNvp);
  46.  
  47. NVPCodec decoder = new NVPCodec();
  48. decoder.Decode(pStresponsenvp);
  49. return decoder["ACK"];
  50. }
  51. }
  52. }
Add Comment
Please, Sign In to add comment