Skip to content

Commit 2f23ede

Browse files
author
EduardoSorokin
committed
- Adding comment about "Hash" field in direct payment examples
1 parent 216ac6c commit 2f23ede

File tree

4 files changed

+65
-54
lines changed

4 files changed

+65
-54
lines changed

public/example-api/src/main/java/br/com/uol/pagseguro/example/api/checkout/CheckoutRegister.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public static void main(String[] args){
7070
.withEmail("[email protected]")
7171
.withName("Jose Comprador")
7272
.withCPF("99999999999")
73-
.withHash("abc123")
7473
.withPhone(new PhoneBuilder()
7574
.withAreaCode("99")
7675
.withNumber("99999999")))

public/example-api/src/main/java/br/com/uol/pagseguro/example/api/transaction/direct/payment/CreateDirectPaymentWithBankSlip.java

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,37 +59,41 @@ public static void main(String[] args){
5959
.withPaymentMode("default")
6060
.withCurrency(Currency.BRL)
6161
.withExtraAmount(new BigDecimal(100.00))
62-
.addItem(new PaymentItemBuilder()//
63-
.withId("0001")//
64-
.withDescription("Produto PagSeguroI") //
65-
.withAmount(new BigDecimal(99999.99))//
62+
.addItem(new PaymentItemBuilder()
63+
.withId("0001")
64+
.withDescription("Produto PagSeguroI")
65+
.withAmount(new BigDecimal(99999.99))
6666
.withQuantity(1)
6767
.withWeight(1000))
6868

69-
.addItem(new PaymentItemBuilder()//
70-
.withId("0002")//
71-
.withDescription("Produto PagSeguroII") //
72-
.withAmount(new BigDecimal(99999.98))//
69+
.addItem(new PaymentItemBuilder()
70+
.withId("0002")
71+
.withDescription("Produto PagSeguroII")
72+
.withAmount(new BigDecimal(99999.98))
7373
.withQuantity(2)
7474
.withWeight(750)
7575
)
7676
.withNotificationURL("www.sualoja.com.br/notification")
7777
.withReference("LIBJAVA_DIRECT_PAYMENT")
78-
.withSender(new SenderBuilder()//
79-
.withEmail("[email protected]")//
78+
.withSender(new SenderBuilder()
79+
.withEmail("[email protected]")
8080
.withName("Jose Comprador")
8181
.withCPF("99999999999")
82+
/*
83+
* Para saber como obter o valor do Hash, acesse:
84+
* https://devs.pagseguro.uol.com.br/docs/checkout-web-usando-a-sua-tela#obter-identificacao-do-comprador
85+
*/
8286
.withHash("abc123")
83-
.withPhone(new PhoneBuilder()//
84-
.withAreaCode("99") //
85-
.withNumber("99999999"))) //
86-
.withShipping(new ShippingBuilder()//
87-
.withType(ShippingType.Type.SEDEX) //
88-
.withCost(BigDecimal.TEN)//
89-
.withAddress(new AddressBuilder() //
87+
.withPhone(new PhoneBuilder()
88+
.withAreaCode("99")
89+
.withNumber("99999999")))
90+
.withShipping(new ShippingBuilder()
91+
.withType(ShippingType.Type.SEDEX)
92+
.withCost(BigDecimal.TEN)
93+
.withAddress(new AddressBuilder()
9094
.withPostalCode("99999999")
9195
.withCountry("BRA")
92-
.withState(State.SP)//
96+
.withState(State.SP)
9397
.withCity("Cidade Exemplo")
9498
.withComplement("99o andar")
9599
.withDistrict("Jardim Internet")

public/example-api/src/main/java/br/com/uol/pagseguro/example/api/transaction/direct/payment/CreateDirectPaymentWithCreditCard.java

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,45 +64,49 @@ public static void main(String[] args){
6464
pagSeguro.transactions().register(new DirectPaymentRegistrationBuilder()
6565
.withPaymentMode("default")
6666
.withCurrency(Currency.BRL)
67-
.addItem(new PaymentItemBuilder()//
68-
.withId("0001")//
69-
.withDescription("Produto PagSeguroI") //
70-
.withAmount(new BigDecimal(99999.99))//
67+
.addItem(new PaymentItemBuilder()
68+
.withId("0001")
69+
.withDescription("Produto PagSeguroI")
70+
.withAmount(new BigDecimal(99999.99))
7171
.withQuantity(1)
7272
.withWeight(1000))
7373

74-
.addItem(new PaymentItemBuilder()//
75-
.withId("0002")//
76-
.withDescription("Produto PagSeguroII") //
77-
.withAmount(new BigDecimal(99999.98))//
74+
.addItem(new PaymentItemBuilder()
75+
.withId("0002")
76+
.withDescription("Produto PagSeguroII")
77+
.withAmount(new BigDecimal(99999.98))
7878
.withQuantity(2)
7979
.withWeight(750)
8080
)
8181
.withNotificationURL("www.sualoja.com.br/notification")
8282
.withReference("LIBJAVA_DIRECT_PAYMENT")
83-
.withSender(new SenderBuilder()//
84-
.withEmail("[email protected]")//
83+
.withSender(new SenderBuilder()
84+
.withEmail("[email protected]")
8585
.withName("Jose Comprador")
8686
.withCPF("99999999999")
87+
/*
88+
* Para saber como obter o valor do Hash, acesse:
89+
* https://devs.pagseguro.uol.com.br/docs/checkout-web-usando-a-sua-tela#obter-identificacao-do-comprador
90+
*/
8791
.withHash("abc123")
88-
.withPhone(new PhoneBuilder()//
89-
.withAreaCode("99") //
90-
.withNumber("99999999"))) //
91-
.withShipping(new ShippingBuilder()//
92-
.withType(ShippingType.Type.SEDEX) //
93-
.withCost(BigDecimal.TEN)//
94-
.withAddress(new AddressBuilder() //
92+
.withPhone(new PhoneBuilder()
93+
.withAreaCode("99")
94+
.withNumber("99999999")))
95+
.withShipping(new ShippingBuilder()
96+
.withType(ShippingType.Type.SEDEX)
97+
.withCost(BigDecimal.TEN)
98+
.withAddress(new AddressBuilder()
9599
.withPostalCode("99999999")
96100
.withCountry("BRA")
97-
.withState(State.SP)//
101+
.withState(State.SP)
98102
.withCity("Cidade Exemplo")
99103
.withComplement("99o andar")
100104
.withDistrict("Jardim Internet")
101105
.withNumber("9999")
102106
.withStreet("Av. PagSeguro"))
103107
)
104108
).withCreditCard(new CreditCardBuilder()
105-
.withBillingAddress(new AddressBuilder() //
109+
.withBillingAddress(new AddressBuilder()
106110
.withPostalCode("99999999")
107111
.withCountry("BRA")
108112
.withState(State.SP)

public/example-api/src/main/java/br/com/uol/pagseguro/example/api/transaction/direct/payment/CreateDirectPaymentWithOnlineDebit.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,37 @@ public static void main(String [] args) {
6060
.withPaymentMode("default")
6161
.withCurrency(Currency.BRL)
6262
.withExtraAmount(new BigDecimal(100.00))
63-
.addItem(new PaymentItemBuilder()//
64-
.withId("0001")//
65-
.withDescription("Produto PagSeguroI") //
66-
.withAmount(new BigDecimal(99999.99))//
63+
.addItem(new PaymentItemBuilder()
64+
.withId("0001")
65+
.withDescription("Produto PagSeguroI")
66+
.withAmount(new BigDecimal(99999.99))
6767
.withQuantity(1)
6868
.withWeight(1000))
6969

70-
.addItem(new PaymentItemBuilder()//
71-
.withId("0002")//
72-
.withDescription("Produto PagSeguroII") //
73-
.withAmount(new BigDecimal(99999.98))//
70+
.addItem(new PaymentItemBuilder()
71+
.withId("0002")
72+
.withDescription("Produto PagSeguroII")
73+
.withAmount(new BigDecimal(99999.98))
7474
.withQuantity(2)
7575
.withWeight(750)
7676
)
7777
.withNotificationURL("www.sualoja.com.br/notification")
7878
.withReference("LIBJAVA_DIRECT_PAYMENT")
79-
.withSender(new SenderBuilder()//
80-
.withEmail("[email protected]")//
79+
.withSender(new SenderBuilder()
80+
.withEmail("[email protected]")
8181
.withName("Jose Comprador")
8282
.withCPF("99999999999")
83+
/*
84+
* Para saber como obter o valor do Hash, acesse:
85+
* https://devs.pagseguro.uol.com.br/docs/checkout-web-usando-a-sua-tela#obter-identificacao-do-comprador
86+
*/
8387
.withHash("abc123")
84-
.withPhone(new PhoneBuilder()//
85-
.withAreaCode("99") //
86-
.withNumber("99999999"))) //
87-
.withShipping(new ShippingBuilder()//
88-
.withType(ShippingType.Type.SEDEX) //
89-
.withCost(BigDecimal.TEN)//
88+
.withPhone(new PhoneBuilder()
89+
.withAreaCode("99")
90+
.withNumber("99999999")))
91+
.withShipping(new ShippingBuilder()
92+
.withType(ShippingType.Type.SEDEX)
93+
.withCost(BigDecimal.TEN)
9094
.withAddress(new AddressBuilder()
9195
.withPostalCode("99999999")
9296
.withCountry("BRA")

0 commit comments

Comments
 (0)