Skip to content

Commit

Permalink
[GTMP-2008] - Incluir tokenCryptogram na sdk (#9)
Browse files Browse the repository at this point in the history
[GTMP-2008] - Incluir tokenCryptogram na sdk
  • Loading branch information
flaviano-faria authored May 22, 2023
1 parent df95c3a commit 109c445
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [2.1.1] - 19/MAI/2023
### Added
- Disponibilizar campo tokenCryptogram

## [2.1.0] - 18/MAI/2023
### Changed
- Inclusão dos campos ABECS
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.maxipago</groupId>
<artifactId>sdk-java-v2</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>

<build>
<plugins>
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/maxipago/paymentmethod/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ public class Card {

@XmlElement(name = "cvvNumber")
private String cvvNumber;

@XmlElement(name = "tokenCryptogram")
private String tokenCryptogram;

public Card setTokenCryptogram(String tokenCryptogram) {
this.tokenCryptogram = tokenCryptogram;
return this;
}

public Card setNumber(String number) {
this.number = number;
Expand Down
31 changes: 31 additions & 0 deletions src/test/java/com/maxipago/MaxiPagoTestWiremock.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,37 @@ public void shouldCreateSaleWithCredit() throws PropertyException {

maxiPago.transactionRequest().execute();
}

@Test
public void shouldCreateSaleWithTokenCryptogram() throws PropertyException {
MaxiPago maxiPago = prepareResponse(CAPTURED_RESPONSE, UNIVERSAL_API);

maxiPago.sale()
.setProcessorId("5")
.setReferenceNum("CreateSaleWithTokenCryptogram")
.setIpAddress("127.0.0.1")
.billingAndShipping(
(new Customer()).setName("Nome como esta gravado no cartao")
.setAddress("Rua Volkswagen, 100")
.setAddress2("0")
.setDistrict("Jabaquara")
.setCity("Sao Paulo")
.setState("SP")
.setPostalCode("11111111")
.setCountry("BR")
.setPhone("11111111111")
.setEmail("[email protected]"))
.setCreditCard(
(new Card()).setNumber("5448280000000007")
.setExpMonth("12")
.setExpYear("2028")
.setCvvNumber("123")
.setTokenCryptogram("abc1238759uiokjflahdfkjlahs"))
.setPayment(new Payment(100.0));

TransactionResponse response = maxiPago.transactionRequest().execute();
assertEquals("0", response.responseCode);
}

@Test
public void shouldCreateSaleWithDebit() throws PropertyException {
Expand Down

0 comments on commit 109c445

Please sign in to comment.