SHARE
TWEET

Untitled

a guest Apr 21st, 2018 214 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using MundiAPI.PCL;
  2. using MundiAPI.PCL.Models;
  3. using System.Collections.Generic;
  4.  
  5. namespace TutorialPedido {
  6.     class Program {
  7.         static void Main(string[] args) {
  8.  
  9.             // Secret key fornecida pela MundiPagg
  10.             string basicAuthUserName = "sk_test_4AdjlqpseatnmgbW";
  11.             // Senha em branco. Passando apenas a secret key
  12.             string basicAuthPassword = "";
  13.             var client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);
  14.  
  15.             var customer = new CreateCustomerRequest {
  16.                 Name = "Tony Stark",
  17.                 Email = "tonystark@avengers.com",
  18.             };
  19.  
  20.             var items = new List<CreateOrderItemRequest> {
  21.                 new CreateOrderItemRequest{
  22.                     Amount = 2990,
  23.                     Description = "Chaveiro do Tesseract",
  24.                     Quantity =1,
  25.                 },
  26.                 new CreateOrderItemRequest{
  27.                     Amount = 5990,
  28.                     Description = "Manopla do Infinito",
  29.                     Quantity =1
  30.                 },
  31.             };
  32.  
  33.             var order = new CreateOrderRequest() {
  34.                 Items = items,
  35.                 Customer = customer,
  36.                 Payments = new List<CreatePaymentRequest> {
  37.                     new CreatePaymentRequest{
  38.                         PaymentMethod = "credit_card",
  39.                         CreditCard = new CreateCreditCardPaymentRequest(){
  40.                         Card = new CreateCardRequest {
  41.                             Number = "342793631858229",
  42.                             HolderName = "Tony Stark",
  43.                             ExpMonth = 1,
  44.                             ExpYear = 18,
  45.                             Cvv = "3531",
  46.                         }
  47.                     }
  48.                   }
  49.               }
  50.            };
  51.         }
  52.     }
  53. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top