Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Payments

Matheus B. Nakaya edited this page Jul 4, 2018 · 16 revisions

Introduction

The payment is a financial transaction that occurs between the customer and the receiver (it means, probably you).

Features

Index

Create payment

Authorization able
Basic Auth
OAuth

Pay with credit card

TO DO

Pay with credit card hash

The Credit Card Hash is...

Map<String, Object> taxDocument = new HashMap<>();
taxDocument.put("type", "CPF");
taxDocument.put("number", "33333333333");

Map<String, Object> phone = new HashMap<>();
phone.put("countryCode", "55");
phone.put("areaCode", "11");
phone.put("number", "66778899");

Map<String, Object> holder = new HashMap<>();
holder.put("fullname", "Portador Teste Moip");
holder.put("birthdate", "1988-12-30");
holder.put("taxDocument", taxDocument);
holder.put("phone", phone);

Map<String, Object> creditCard = new HashMap<>();
creditCard.put("hash", "CREDIT_CARD_HASH");
creditCard.put("store", false);
creditCard.put("holder", holder);

Map<String, Object> fundingInstrument = new HashMap<>();
fundingInstrument.put("method", "CREDIT_CARD");
fundingInstrument.put("creditCard", creditCard);

Map<String, Object> payment = new HashMap<>();
payment.put("installmentCount", 1);
payment.put("statementDescriptor", "minhaLoja.com");
payment.put("fundingInstrument", fundingInstrument);

Map<String, Object> newPay = payment.pay(payment, "ORD-0SGQXTWI2KO0", setup);

Pay with boleto

Map<String, Object> instructionLines = new HashMap<>();
instructionLines.put("first", "First instruction line!");
instructionLines.put("second", "Second instruction line!");
instructionLines.put("third", "Third instruction line!");

Map<String, Object> boleto = new HashMap<>();
boleto.put("expirationDate", "2020-06-20");
boleto.put("instructionLines", instructionLines);
boleto.put("logoUri", "http://www.lojaexemplo.com.br/logo.jpg");

Map<String, Object> fundingInstrument = new HashMap<>();
fundingInstrument.put("method", "BOLETO");
fundingInstrument.put("boleto", boleto);

Map<String, Object> payment = new HashMap<>();
payment.put("installmentCount", 1);
payment.put("statementDescriptor", "minhaLoja.com");
payment.put("fundingInstrument", fundingInstrument);

Map<String, Object> newPay = payment.pay(payment, "ORD-0SGQXTWI2KO0", setup);

Pay with online bank debit

Clone this wiki locally