SHARE
TWEET

Untitled

a guest Apr 21st, 2018 184 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using MundiAPI.PCL;
  3. using MundiAPI.PCL.Models;
  4. using System.Collections.Generic;
  5.  
  6. namespace TutorialPedido {
  7.     class Program {
  8.         static void Main(string[] args) {
  9.  
  10.             // Secret key fornecida pela MundiPagg
  11.             string basicAuthUserName = "sk_test_4AdjlqpseatnmgbW";
  12.             // Senha em branco. Passando apenas a secret key
  13.             string basicAuthPassword = "";
  14.             var client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);
  15.  
  16.             var customer = new CreateCustomerRequest {
  17.                 Name = "Tony Stark",
  18.                 Email = "tonystark@avengers.com",
  19.             };
  20.  
  21.             var items = new List<CreateOrderItemRequest> {
  22.                 new CreateOrderItemRequest{
  23.                     Amount = 2990,
  24.                     Description = "Chaveiro do Tesseract",
  25.                     Quantity =1,
  26.                 },
  27.                 new CreateOrderItemRequest{
  28.                     Amount = 5990,
  29.                     Description = "Manopla do Infinito",
  30.                     Quantity =1
  31.                 },
  32.             };
  33.  
  34.             var order = new CreateOrderRequest() {
  35.                 Items = items,
  36.                 Customer = customer
  37.             };
  38.              
  39.             var request = client.Orders.CreateOrder(order);
  40.         }
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top