Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank values sent by HppRequest #3

Open
ebguilbert opened this issue Aug 3, 2017 · 11 comments
Open

Blank values sent by HppRequest #3

ebguilbert opened this issue Aug 3, 2017 · 11 comments

Comments

@ebguilbert
Copy link

If I try to submit a basic HPP request:

HppRequest hppRequest = new HppRequest()
                .addAccount("valid-account")
                .addMerchantId("valid-merchantid")
                .addAmount(1001)
                .addOrderId(GenerationUtils.generateOrderId())
                .addProductId(GenerationUtils.generateTimestamp())
                .addCurrency("EUR");
RealexHpp realexHpp = new RealexHpp("secret");
String requestJson = realexHpp.requestToJson(hppRequest);

My HTTP POST request includes all other possible variables with blank values. See image attached.

screen shot 2017-07-26 at 11 55 05

@mintraSpencerSyntec
Copy link

@ebguilbert
Hi.

Do you find a solution for this issue? I override all the blank values with some relevant values so that the lightbox popup stops complaining about "Invalid characters", but now I've got "508 Incorrect hash" error instead.

Not sure how to solve it.

Thanks

@ebguilbert
Copy link
Author

Yes. I got a temporary fix:

In

src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java

Just before line 40:
public class HppRequest {

add the following line:

@JsonInclude(Include.NON_NULL)

You'll have to import additional dependencies. This should stop the JSON being produced with
NULL or blank values.

@mintraSpencerSyntec Hope it helps. Please add a +1 to this issue if you think its helpful.

@mintraSpencerSyntec
Copy link

@ebguilbert
Thanks. That resolves 1 out of my 3 issues with Realex HPP. Will upvote your reply.

@rxp-developers
Copy link
Contributor

@mintraSpencerSyntec, could you please let us know what the other two issues are?

@mintraSpencerSyntec
Copy link

Thanks very much for asking @ebguilbert

The other 2 issues were "Incorrect hash" and "Card can't be used for this amount" errors. But these 2 seem to be resolved by the same fix you provided above.

@fabiofalci
Copy link

@rxp-developers is there an eta for this fix to be released?

@rxp-developers
Copy link
Contributor

@fabiofalci, could you please provide some details on the Java environment you are encountering this issue in, what version etc. It's not something I've been able to replicate.

@fabiofalci
Copy link

fabiofalci commented Dec 1, 2017

Running on sandbox.

$ java -version
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)
<dependency>
    <groupId>com.realexpayments.hpp.sdk</groupId>
    <artifactId>rxp-hpp-java</artifactId>
    <version>1.3</version>
</dependency>

@rxp-developers at first glance it looks very similar to @ebguilbert issue.

If I run like this example:

HppRequest hppRequest = new HppRequest()
    .addMerchantId("*******")
    .addAccount("internet")
    .addAmount(1001)
    .addCurrency("GBP")
    .addAutoSettleFlag(false);

RealexHpp realexHpp = new RealexHpp("*****");

In the UI, when trying to open the lightbox, I get an error like this (the invalid field varies in each call):

<div id="error_code">508</div>
<div id="error_message">Invalid data in the OFFER_SAVE_CARD field. Please contact the merchant.</div>

In the generated json, all those invalid fields have null value.

{
...
COMMENT1:null,COMMENT2:null,
RETURN_TSS:null,SHIPPING_CODE:null,
SHIPPING_CO:null,BILLING_CODE:null,BILLING_CO:null,
CUST_NUM:null,VAR_REF:null,PROD_ID:null,
HPP_LANG:null,CARD_PAYMENT_BUTTON:null,
CARD_STORAGE_ENABLE:null,
OFFER_SAVE_CARD:null,PAYER_REF:null,PMT_REF:null,
PAYER_EXIST:null,VALIDATE_CARD_ONLY:null,
DCC_ENABLE:null,HPP_FRAUDFILTER_MODE:T0ZG,
...
}

To work, I need to fill all of them, if I don't know what one field is for, I need to set empty string.

                .addCardPaymentButtonText("")
                .addVariableReference("")
                .addCommentOne("")
                .addCommentTwo("")
                .addHppSelectStoredCard("")

Then it works.

@rxp-developers
Copy link
Contributor

@fabiofalci, thanks, have opened a Pull Request to get the fix included: #4

It will go through our release process so it should be out in a matter of days.

@fabiofalci
Copy link

thanks

@Naeemtixsee
Copy link

Naeemtixsee commented Oct 3, 2019

Need Help guys please !
should i set merchant response url in addPostResponse function in php i need to send merchant response to db so i created post service. and what does merchant_response_url attr do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants