PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, November 11, 2022

[FIXED] How to query past payments in Global Payments API

 November 11, 2022     global-payments-api, payment-gateway, transactions     No comments   

Issue

This should be a common scenario but I could not find any API calls to do this on Global Payments.

Suppose we try to pay something and we then generate and HPP json by doing:

hppJson = service.charge(new BigDecimal(paymentDTO.getAmount()))
                .withCurrency(paymentDTO.getCurrency())
                .withHostedPaymentData(hostedPaymentData)
                .withAddress(billingAddress, AddressType.Billing)
                .withAddress(shippingAddress, AddressType.Shipping)
                .serialize();

Then after customer gets redirected to the payment page of Global payments, he add card details and pay. If the payment was successful from global payments, it will redirect the user to our specified url. My question is if our services are unavailable when redirecting, is there a way to query that past successful transaction by using anything in that HPP Json? like order ID etc?


Solution

This can be accomplished with the following code:

TransactionSummary response = ReportingService.transactionDetail("{YOUR ORDER ID HERE}").execute();

Additional supporting code can be found in the following files within GitHub for the Java SDK.

https://github.com/globalpayments/java-sdk/blob/master/src/test/java/com/global/api/tests/realex/RealexReportingTests.java



Answered By - russell-everett
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing