Guest User

Untitled

a guest
Apr 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. using MundiAPI.PCL;
  2. using MundiAPI.PCL.Models;
  3. using System.Collections.Generic;
  4.  
  5. namespace TutorialAssinatura {
  6. class Program {
  7. static void Main(string[] args) {
  8.  
  9. string basicAuthUserName = "sk_test_39joaPCZQFyxA8zx";
  10. // Senha em branco. Passando apenas a secret key
  11. string basicAuthPassword = "";
  12.  
  13. var client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);
  14.  
  15. var customer = new CreateCustomerRequest() {
  16. Name = "Gustavo Fonseca",
  17. Email = "Gustavo.fonseca@mundipagg.com"
  18. };
  19.  
  20. var items = new List<CreateSubscriptionItemRequest> {
  21. new CreateSubscriptionItemRequest {
  22. Description = "Musculação",
  23. Quantity = 1,
  24. PricingScheme = new CreatePricingSchemeRequest {
  25. Price = 18990
  26. }
  27. }
  28. };
  29. var subscrition = new CreateSubscriptionRequest(){
  30. PaymentMethod = "boleto",
  31. Interval = "month",
  32. IntervalCount = 1,
  33. Customer = customer,
  34. Items = items
  35. };
  36.  
  37. var response = client.Subscriptions.CreateSubscription(subscrition);
  38. }
  39. }
  40. }
Add Comment
Please, Sign In to add comment