MOIP consumes Json Web Api MVC

Asked

Viewed 393 times

2

I need to use the Moip Payments API as a payment method for my system, how do I request via json?

Documentation

Consultar cliente GET

Por meio desta API é possível consultar as informações e detalhes de um cliente.

ENDPOINT GET https://sandbox.moip.com.br/v2/customers/{customer_id}

EXEMPLO GET https://sandbox.moip.com.br/v2/customers/CUS-Y6L4AGQN8HKQ

REQUEST:

Content-Type: application/json

Authorization: "Basic MDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDE6QUJBQkFCQUJBQkFCQUJBQkFCQUJBQkFCQUJBQkFCQUJBQkFCQUJBQg=="

RESPONSE:

200 (OK)
Content-Type: application/json

 {
  "id": "CUS-Y6L4AGQN8HKQ",
  "ownId": "meu_id_sandbox_1231234",
  "fullname": "Jose Silva",
  "createdAt": "2015-01-14T11:28:22-0200",
  "birthDate": "1988-12-30T00:00:00-0200",
  "email": "[email protected]",
  "phone": {
    "countryCode": "55",
    "areaCode": "11",
    "number": "66778899"
  },
  "taxDocument": {
    "type": "CPF",
    "number": "22222222222"
  },
  "shippingAddress": {
    "zipCode": "01234000",
    "street": "Avenida Faria Lima",
    "streetNumber": "2927",
    "complement": "8",
    "city": "Sao Paulo",
    "district": "Itaim",
    "state": "SP",
    "country": "BRA"
  },
  "moipAccount": {
    "id": "MPA-M1M01PACC0NT"
  },
  "_links": {
    "self": {
      "href": "https://sandbox.moip.com.br/v2/customers/CUS-Y6L4AGQN8HKQ"
    }
  }
}
  • I used it a few years ago, so much so that I started to convert an SDK of it to C#. Below is the repository. You can forkar, improve and help contribute to what he turned out nice. Moipsdk.NET

  • Are you willing to make this request via HTTP with c#? That’s it?

  • Yes. GET , POST, PUT and DELETE via json for MOIP request

1 answer

0

There’s a library ready for that: Wirecardcsharp.

Example of how to consult a customer:

var result = await WC.Customer.Consult("CUS-XXXXXXXXXXXX");

Browser other questions tagged

You are not signed in. Login or sign up in order to post.