Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using MundiAPI.PCL;
- using MundiAPI.PCL.Models;
- using System.Collections.Generic;
- namespace TutorialAssinatura {
- class Program {
- static void Main(string[] args) {
- string basicAuthUserName = "sk_test_39joaPCZQFyxA8zx";
- // Senha em branco. Passando apenas a secret key
- string basicAuthPassword = "";
- var client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);
- var customer = new CreateCustomerRequest() {
- Name = "Gustavo Fonseca",
- Email = "Gustavo.fonseca@mundipagg.com"
- };
- var items = new List<CreateSubscriptionItemRequest> {
- new CreateSubscriptionItemRequest {
- Description = "Musculação",
- Quantity = 1,
- PricingScheme = new CreatePricingSchemeRequest {
- Price = 18990
- }
- }
- };
- var subscrition = new CreateSubscriptionRequest(){
- PaymentMethod = "boleto",
- Interval = "month",
- IntervalCount = 1,
- Customer = customer,
- Items = items
- };
- var response = client.Subscriptions.CreateSubscription(subscrition);
- }
- }
- }
Add Comment
Please, Sign In to add comment