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

Multipayments

somentelucas edited this page Aug 29, 2018 · 8 revisions

Introduction

TO DO

Dependencies

TO DO

Features

Index

Create multipayment

Authorization able
Basic Auth
OAuth

Pay with credit card

Map<String, Object> taxDocument = payloadFactory(
    value("type", "CPF"),
    value("number", "33333333333")
);

Map<String, Object> phone = payloadFactory(
    value("countryCode", "55"),
    value("areaCode", "11"),
    value("number", "66778899")
);

Map<String, Object> holder = payloadFactory(
    value("fullname", "Portador Teste Moip"),
    value("birthdate", "1988-12-30"),
    value("taxDocument", taxDocument),
    value("phone", phone)
);

Map<String, Object> creditCard = payloadFactory(
    value("number", 5555666677778884),
    value("cvc", 123),
    value("expirationMonth", 12),
    value("expirationYear", 24),
    value("store", false),
    value("holder", holder)
);

Map<String, Object> fundingInstrument = payloadFactory(
    value("method", "CREDIT_CARD"),
    value("creditCard", creditCard)
);

Map<String, Object> payment = payloadFactory(
    value("installmentCount", 1),
    value("statementDescriptor", "minhaLoja.com"),
    value("fundingInstrument", fundingInstrument)
);

Map<String, Object> newPay = Moip.API.multiorders().pay(payment, "multiorder_id", setup);

Pay with credit card hash

The Credit Card Hash is an encrypted version of the credit card. This encryption must occur on the front-end using our Javascript Encryption SDK.

Map<String, Object> taxDocument = payloadFactory(
    value("type", "CPF"),
    value("number", "33333333333")
);

Map<String, Object> phone = payloadFactory(
    value("countryCode", "55"),
    value("areaCode", "11"),
    value("number", "66778899")
);

Map<String, Object> holder = payloadFactory(
    value("fullname", "Portador Teste Moip"),
    value("birthdate", "1988-12-30"),
    value("taxDocument", taxDocument),
    value("phone", phone)
);

Map<String, Object> creditCard = payloadFactory(
    value("hash", "CREDIT_CARD_HASH"),
    value("holder", holder)
);

Map<String, Object> fundingInstrument = payloadFactory(
    value("method", "CREDIT_CARD"),
    value("creditCard", creditCard)
);

Map<String, Object> payment = payloadFactory(
    value("installmentCount", 1),
    value("statementDescriptor", "minhaLoja.com"),
    value("fundingInstrument", fundingInstrument)
);

Map<String, Object> newPay = Moip.API.multiorders().pay(payment, "multiorder_id", setup);
Clone this wiki locally