Atributos | Tipo | Descrição |
---|---|---|
bank | string | Código do Banco. 001 (Banco do Brasil); 237 (Bradesco) e 341 (Itau). |
metadata | object | Objeto chave/valor utilizado para armazenar informações adicionais sobre o pagamento.Saiba mais sobre metadata. |
Código do Banco padrão
Você pode configurar um código padrão para a sua loja. Desta forma, você não precisa enviá-lo em toda requisição e o nó
bank_transfer
sendo o mesmo opcional.
{
"amount": 1490000,
"customer": {
"name": "Tony Stark",
"email": "[email protected]",
"document": "57510831563",
"type": "individual"
},
"payment":{
"metadata":{
"code": "3"
},
"payment_method": "bank_transfer",
"bank_transfer":{
"bank": 001
}
},
"metadata": {
"code": "123"
}
}
{
"id": "ch_j2bkebpurbCgEGpq",
"code": "0X7JFVQSN0",
"gateway_id": "364b6d2e-62e9-4fed-8646-3af3320d153b",
"amount": 1490000,
"status": "pending",
"currency": "BRL",
"payment_method": "bank_transfer",
"created_at": "2017-07-05T16:52:36Z",
"updated_at": "2017-07-05T16:52:36Z",
"customer": {
"id": "cus_1rp2jAES3RCwnyz0",
"name": "Tony Stark",
"email": "[email protected]",
"document": "57510831563",
"type": "individual",
"delinquent": false,
"created_at": "2017-07-05T16:52:36Z",
"updated_at": "2017-07-05T16:52:36Z",
"phones": {}
},
"last_transaction": {
"url": "https://onlinedebitsandbox.mundipaggone.com:4443/OnlineDebit/Checkout/e17a8b29-857a-4087-8d27-4c0ab4e2e08b",
"bank_tid": "00000427",
"bank": "341",
"id": "tran_kEnJLNRH2sBLdBpW",
"transaction_type": "bank_transfer",
"gateway_id": "e17a8b29-857a-4087-8d27-4c0ab4e2e98b",
"amount": 1490000,
"status": "pending",
"success": true,
"created_at": "2017-07-05T16:52:36Z",
"updated_at": "2017-07-05T16:52:36Z",
"gateway_response": {
"code": "201"
}
},
"metadata": {
"code": "123"
}
}
package examples.order;
import com.mundipagg.api.MundiAPIClient;
import com.mundipagg.api.controllers.OrdersController;
import com.mundipagg.api.models.*;
import com.mundipagg.api.http.client.*;
import java.util.ArrayList;
public class CreateOrderBankTransfer {
public static void main(String[] args) {
String basicAuthUserName = "sk_test_4tdVXpseumRmqbo"; // The username to use with basic authentication
String basicAuthPassword = ""; // The password to use with basic authentication
MundiAPIClient client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);
OrdersController orders_controller = new OrdersController();
CreateCustomerRequest customer = new CreateCustomerRequest();
customer.setName("sdk customer order");
customer.setEmail("[email protected]");
CreateBankTransferPaymentRequest create_bank_transfer_payment_request = new CreateBankTransferPaymentRequest();
create_bank_transfer_payment_request.setBank("001");
CreateOrderRequest request = new CreateOrderRequest();
CreateOrderItemRequest orderItem = new CreateOrderItemRequest();
orderItem.setDescription("Tesseract Bracelet");
orderItem.setQuantity(3);
orderItem.setAmount(1490);
ArrayList<CreateOrderItemRequest> listOrderItem = new ArrayList<CreateOrderItemRequest>();
listOrderItem.add(orderItem);
request.setItems(listOrderItem);
CreatePaymentRequest paymentItem = new CreatePaymentRequest();
paymentItem.setPaymentMethod("bank_transfer");
paymentItem.setBankTransfer(create_bank_transfer_payment_request);
request.setCustomer(customer);
ArrayList<CreatePaymentRequest> lisPaymentItem = new ArrayList<CreatePaymentRequest>();
lisPaymentItem.add(paymentItem);
request.setPayments(lisPaymentItem);
orders_controller.createOrderAsync(request, new APICallBack<GetOrderResponse>() {
public void onSuccess(HttpContext context, GetOrderResponse response) {
System.out.println("Order bank transfer create !");
System.out.println("Status response: " + context.getResponse().getStatusCode());
System.out.println("Order result status: " + response.getStatus());
System.out.println("Order id: " + response.getId());
}
public void onFailure(HttpContext context, Throwable error) {
System.out.println("Status response: " + context.getResponse().getStatusCode());
System.out.println(error.getMessage());
error.printStackTrace();
}
});
}
}
Status das transações de Transferência Bancária (Transaction)
As transações de transferência bancária podem possuir os seguintes status:
Status | Descrição |
---|---|
pending | Pendente |
paid | Paga |
overpaid | Paga a maior |
underpaid | Paga a menor |
with_error | Com erro |
not_paid | Não paga |
failed | Falha |