post https://sandbox.mundipaggone.com/CreditCard
Guid merchantKey = Guid.Parse("00000000-0000-0000-0000-000000000000");
// Cria o cliente para obter os dados do cartão.
var client = new GatewayServiceClient(merchantKey, new Uri("https://sandbox.mundipaggone.com"));
var createInstantBuyDataRequest = new CreateInstantBuyDataRequest() {
BillingAddress = new BillingAddress() {
City = "Tatooine",
Complement = "",
Country = "Brazil",
District = "Mos Eisley",
Number = "123",
State = "RJ",
Street = "Mos Eisley Cantina",
ZipCode = "20001000"
},
CreditCardBrand = CreditCardBrandEnum.Visa,
CreditCardNumber = "4111111111111111",
ExpMonth = 10,
ExpYear = 22,
HolderName = "LUKE SKYWALKER",
IsOneDollarAuthEnabled = false
};
// Obtém os dados do cartão de crédito no gateway.
var httpResponse = client.CreditCard.CreateCreditCard(createInstantBuyDataRequest);
if (httpResponse.HttpStatusCode == HttpStatusCode.Created
&& httpResponse.Response.Success == true) {
Console.WriteLine("InstantBuy Key: {0}", httpResponse.Response.InstantBuyKey);
}
<?php
// Carrega dependências
require_once(dirname(__FILE__) . '\vendor\autoload.php');
try
{
// Define a url utilizada
\Gateway\ApiClient::setBaseUrl("https://sandbox.mundipaggone.com");
// Define a chave da loja
\Gateway\ApiClient::setMerchantKey("85328786-8BA6-420F-9948-5352F5A183EB");
// Cria objeto requisição
$request = new \Gateway\One\DataContract\Request\CreateInstantBuyDataRequest();
$request
->setCreditCardBrand(\Gateway\One\DataContract\Enum\CreditCardBrandEnum::VISA)
->setCreditCardNumber("4111111111111111")
->setExpMonth(10)
->setExpYear(22)
->setHolderName("LUKE SKYWALKER")
->setIsOneDollarAuthEnabled(false)
->getBillingAddress()
->setStreet("Mos Eisley Cantina")
->setNumber("123")
->setComplement("")
->setDistrict("Mos Eisley")
->setCity("Tatooine")
->setState("RJ")
->setZipCode("20001000")
->setCountry(\Gateway\One\DataContract\Enum\CountryEnum::BRAZIL);
//Cria um objeto ApiClient
$client = new Gateway\ApiClient();
// Faz a chamada para criação
$response = $client->createCreditCard($request);
// Imprime resposta
print "<pre>";
print json_encode($response->getData(), JSON_PRETTY_PRINT);
print "</pre>";
}
catch (\Gateway\One\DataContract\Report\ApiError $error)
{
// Imprime json
print "<pre>";
print json_encode($error, JSON_PRETTY_PRINT);
print "</pre>";
}
catch (Exception $ex)
{
// Imprime json
print "<pre>";
print json_encode($ex, JSON_PRETTY_PRINT);
print "</pre>";
}
require 'mundipagg_sdk'
# variable with merchant key
merchantKey = '85328786-8BA6-420F-9948-5352F5A183EB'
# instantiate class with request methods
# :sandbox for sandbox ambient
# :production for production ambient
gateway = Gateway::Gateway.new(:sandbox, merchantKey)
create_instant_buy_data = Gateway::CreateInstantBuyDataRequest.new
create_instant_buy_data.BillingAddress.City = 'Tatooine'
create_instant_buy_data.BillingAddress.Complement = ''
create_instant_buy_data.BillingAddress.Country = 'Brazil'
create_instant_buy_data.BillingAddress.District = 'Mos Eisley'
create_instant_buy_data.BillingAddress.Number = '123'
create_instant_buy_data.BillingAddress.State = 'RJ'
create_instant_buy_data.BillingAddress.Street = 'Mos Eisley Cantina'
create_instant_buy_data.BillingAddress.ZipCode = '20001000'
create_instant_buy_data.CreditCardBrand = 'Visa'
create_instant_buy_data.CreditCardNumber = '4111111111111111'
create_instant_buy_data.ExpMonth = 10
create_instant_buy_data.ExpYear = 2022
create_instant_buy_data.HolderName = 'LUKE SKYWALKER'
create_instant_buy_data.IsOneDollarAuthEnabled = false
response = gateway.CreateCreditCard(create_instant_buy_data)
puts response
// Define loja
UUID merchantKey = UUID.fromString("85328786-8BA6-420F-9948-5352F5A183EB"); // Chave da Loja - MerchantKey
// Cria o cliente que vai enviar a transação
GatewayServiceClient serviceClient = new GatewayServiceClient(merchantKey, "https://sandbox.mundipaggone.com");
CreateInstantBuyDataRequest creditCardRequest = new CreateInstantBuyDataRequest();
creditCardRequest.setBillingAddress(new BillingAddress());
creditCardRequest.getBillingAddress().setCity("Tatooine");
creditCardRequest.getBillingAddress().setComplement("");
creditCardRequest.getBillingAddress().setCountry(CountryEnum.Brazil);
creditCardRequest.getBillingAddress().setDistrict("Mos Eisley");
creditCardRequest.getBillingAddress().setNumber("123");
creditCardRequest.getBillingAddress().setState("RJ");
creditCardRequest.getBillingAddress().setStreet("Mos Eisley Cantina");
creditCardRequest.getBillingAddress().setZipCode("20001000");
creditCardRequest.setCreditCardBrand(CreditCardBrandEnum.Visa);
creditCardRequest.setCreditCardNumber("4111111111111111");
creditCardRequest.setExpMonth(10);
creditCardRequest.setExpYear(22);
creditCardRequest.setHolderName("LUKE SKYWALKER");
creditCardRequest.setIsOneDollarAuthEnabled(Boolean.FALSE);
HttpResponseGenerics<CreateInstantBuyDataResponse, CreateInstantBuyDataRequest> httpResponse
= serviceClient.getCreditCard().CreateCreditCard(creditCardRequest);
// Obtem objeto de resposta montado
return httpResponse.getRawResponse();
{
"BillingAddress": {
"City": "Tatooine",
"Complement": "",
"Country": "Brazil",
"District": "Mos Eisley",
"Number": "123",
"State": "RJ",
"Street": "Mos Eisley Cantina",
"ZipCode": "20001000"
},
"CreditCardBrand": "Visa",
"CreditCardNumber": "4111111111111111",
"ExpMonth": 10,
"ExpYear": 22,
"HolderName": "LUKE SKYWALKER",
"IsOneDollarAuthEnabled": false
}