gopaycommunity / gopay-java-api

GoPay's JAVA SDK for Payments REST API
MIT License
10 stars 5 forks source link

BasePayment withCallback 3.3.1 #2

Closed zarubto4 closed 8 years ago

zarubto4 commented 8 years ago

Documentation says that you need two values for creating request ".withCallback(, )"

but last version need 4 values ( failed and success URL)

Fix the code or documentation

BasePayment payment = PaymentFactory.createBasePaymentBuilder()
    .order(<ORDER_NUMBER>, <AMOUNT>, Currency.EUR, <DESCRIPTION>)
    .addItem(<ITEM_NAME>, <AMOUNT>, <FEE>, <COUNT>)
    .addAdditionalParameter(<Key>, <VALUE>)
    .withCallback(<RETURN_URL>, <NOTIFY_URL>)
    .payer(<Payer>)
    .inLang(Lang.EN)
    .toEshop(<GO_ID>)
    .build();
try {
    Payment result = connector.createPayment(payment);
} catch (GPClientException e) {
     for (ErrorElement err : e.getError().getErrorMessages()) {
        int code = err.getErrorCode();
        String message = err.getMessage();
        String field = err.getField();
    }
}
FSichinger commented 8 years ago

Hi. this problem has been fixed yesterday, please use the latest version 3.3.2 instead.