We've moved. We highly recommend you use the Global Payments Java SDK which supports all the features of this SDK and will benefit from all future releases: https://github.com/globalpayments/java-sdk
You can sign up for a Global Payments (formerly Realex Payments) account at https://developer.globalpay.com
Java 1.6 and later.
Add this dependency to your project's POM:
<dependency>
<groupId>com.realexpayments.remote.sdk</groupId>
<artifactId>rxp-remote-java</artifactId>
<version>1.3.2</version>
</dependency>
Add this dependency to your project's build file:
implementation 'com.realexpayments.remote.sdk:rxp-remote-java:1.3.2'
Please see https://developer.globalpay.com for more comprehensive integration guides.
Card card = new Card()
.addExpiryDate("0119")
.addNumber("4242424242424242")
.addType(CardType.VISA)
.addCardHolderName("Joe Smith")
.addCvn("123")
.addCvnPresenceIndicator(PresenceIndicator.CVN_PRESENT);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.AUTH)
.addAmount(100)
.addCurrency("EUR")
.addCard(card)
.addAutoSettle(new AutoSettle().addFlag(AutoSettleFlag.TRUE));
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
Card card = new Card()
.addExpiryDate("0119")
.addNumber("420000000000000000")
.addType(CardType.VISA)
.addCardHolderName("Joe Smith")
.addCvn("123")
.addCvnPresenceIndicator(PresenceIndicator.CVN_PRESENT);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.AUTH)
.addAmount(100)
.addCurrency("EUR")
.addCard(card)
.addAutoSettle(new AutoSettle().addFlag(AutoSettleFlag.TRUE))
.addAddressVerificationServiceDetails("382 The Road", "WB1 A42");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.AUTH_MOBILE)
.addAutoSettle(new AutoSettle().addFlag(AutoSettleFlag.TRUE))
.addMobile("apple-pay")
.addToken("{auth mobile payment token}");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.SETTLE)
.addOrderId("Order ID from original transaction")
.addAmount(100)
.addCurrency("EUR")
.addPaymentsReference("pasref from original transaction");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.VOID)
.addOrderId("Order ID from original transaction")
.addPaymentsReference("pasref from original transaction");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.REBATE)
.addOrderId("Order ID from original transaction")
.addAmount(100)
.addCurrency("EUR")
.addPaymentsReference("pasref from original transaction")
.addAuthCode("Auth code from original transaction")
.addRefundHash("SHA1 hash of rebate password");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
Card card = new Card()
.addExpiryDate("0119")
.addNumber("420000000000000000")
.addType(CardType.VISA)
.addCardHolderName("Joe Smith")
.addCvn("123")
.addCvnPresenceIndicator(PresenceIndicator.CVN_PRESENT);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.OTB)
.addCard(card);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
Card card = new Card()
.addExpiryDate("0119")
.addNumber("420000000000000000")
.addType(CardType.VISA)
.addCardHolderName("Joe Smith")
.addCvn("123")
.addCvnPresenceIndicator(PresenceIndicator.CVN_PRESENT);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.REFUND)
.addAmount(100)
.addCurrency("EUR")
.addCard(card)
.addRefundHash("SHA1 hash of refund password");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.HOLD)
.addReasonCode(ReasonCode.OUT_OF_STOCK)
.addOrderId("Order ID from original transaction")
.addPaymentsReference("Pasref from original transaction");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.RELEASE)
.addReasonCode(ReasonCode.FALSE_POSITIVE)
.addOrderId("Order ID from original transaction")
.addPaymentsReference("Pasref from original transaction");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentData paymentData = new PaymentData()
.addCvnNumber("123");
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.RECEIPT_IN)
.addAmount(100)
.addCurrency("EUR")
.addPayerReference("payer ref for customer")
.addPaymentMethod("payment method ref for card")
.addPaymentData(paymentData);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.PAYMENT_OUT)
.addAmount(100)
.addCurrency("EUR")
.addPayerReference("payer ref for customer")
.addPaymentMethod("payment method ref for card")
.addRefundHash("SHA1 hash of refund password");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PayerAddress address = new PayerAddress()
.addLine1("Apt 167 Block 10")
.addLine2("The Hills")
.addLine3("67-69 High St")
.addCity("Hytown")
.addCounty("Dunham")
.addPostcode("3")
.addCountryCode("IE")
.addCountryName("Ireland");
Payer payer = new Payer()
.addType("Business")
.addRef("smithj01")
.addTitle("Mr")
.addFirstName("John")
.addSurname("Smith")
.addCompany("Acme")
.addPayerAddress(address)
.addHomePhoneNumber("+35317285355")
.addWorkPhoneNumber("+35317433923")
.addFaxPhoneNumber("+35317893248")
.addMobilePhoneNumber("+353873748392")
.addEmail("jsmith@acme.com")
.addComment("Comment1")
.addComment("Comment2");
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.PAYER_NEW)
.addPayer(payer);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PayerAddress address = new PayerAddress()
.addLine1("Apt 167 Block 10")
.addLine2("The Hills")
.addLine3("67-69 High St")
.addCity("Hytown")
.addCounty("Dunham")
.addPostcode("3")
.addCountryCode("IE")
.addCountryName("Ireland");
Payer payer = new Payer()
.addType("Business")
.addRef("smithj01")
.addTitle("Mr")
.addFirstName("John")
.addSurname("Smith")
.addCompany("Acme")
.addPayerAddress(address)
.addHomePhoneNumber("+35317285355")
.addWorkPhoneNumber("+35317433923")
.addFaxPhoneNumber("+35317893248")
.addMobilePhoneNumber("+353873748392")
.addEmail("jsmith@acme.com")
.addComment("Comment1")
.addComment("Comment2");
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.PAYER_EDIT)
.addPayer(payer);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
Card card = new Card()
.addReference("visa01")
.addPayerReference("smithj01")
.addNumber("420000000000000000")
.addExpiryDate("0119")
.addCardHolderName("Joe Smith")
.addType(CardType.VISA)
.addIssueNumber("1");
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.CARD_NEW)
.addCard(card);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
Card card = new Card()
.addReference("visa01")
.addPayerReference("smithj01")
.addNumber("420000000000000000")
.addExpiryDate("0119")
.addCardHolderName("Joe Smith")
.addType(CardType.VISA);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.CARD_UPDATE)
.addCard(card);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
Card card = new Card()
.addReference("visa01")
.addPayerReference("smithj01");
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.CARD_CANCEL)
.addCard(card);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentData paymentData = new PaymentData()
.addCvnNumber("123");
ThreeDSecureRequest request = new ThreeDSecureRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(ThreeDSecureType.VERIFY_CARD_ENROLLED)
.addAmount(100)
.addCurrency("EUR")
.addPayerReference("payer ref from customer")
.addPaymentMethod("payment method ref from customer")
.addPaymentData(paymentData)
.addAutoSettle(new AutoSettle().addFlag(AutoSettleFlag.TRUE));
RealexClient client = new RealexClient("shared secret");
ThreeDSecureResponse response = client.send(request);
Card card = new Card()
.addNumber("420000000000000000")
.addExpiryDate("0119")
.addCardHolderName("Joe Smith")
.addType(CardType.VISA);
DccInfo dccInfo = new DccInfo()
.addDccProcessor("fexco");
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.DCC_RATE_LOOKUP)
.addAmount(100)
.addCurrency("EUR")
.addCard(card)
.addDccInfo(dccInfo);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
Card card = new Card()
.addNumber("420000000000000000")
.addExpiryDate("0119")
.addCardHolderName("Joe Smith")
.addType(CardType.VISA);
DccInfo dccInfo = new DccInfo()
.addDccProcessor("fexco")
.addRate(0.6868)
.addAmount(13049)
.addCurrency("GBP");
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.DCC_AUTH)
.addAmount(19000)
.addCurrency("EUR")
.addCard(card)
.addDccInfo(dccInfo);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.RECEIPT_IN_OTB)
.addPayerReference("payer ref from customer")
.addPaymentMethod("payment method ref from customer");
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
DccInfo dccInfo = new DccInfo()
.addDccProcessor("fexco");
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.STORED_CARD_DCC_RATE)
.addAmount(100)
.addCurrency("EUR")
.addPayerReference("payer ref for customer")
.addPaymentMethod("payment method ref for card")
.addDccInfo(dccInfo);
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
Card card = new Card()
.addExpiryDate("0119")
.addNumber("4242424242424242")
.addType(CardType.VISA)
.addCardHolderName("Joe Smith")
.addCvn("123");
PaymentRequest request = new PaymentRequest()
.addMerchantId("Merchant ID")
.addAccount("internet")
.addType(PaymentType.AUTH)
.addAmount(1000)
.addCurrency("EUR")
.addCard(card)
.addAutoSettle(new AutoSettle().addFlag(AutoSettleFlag.TRUE))
.addFraudFilter(new FraudFilter().addMode(FraudFilter.FraudFilterMode.PASSIVE));
RealexClient client = new RealexClient("shared secret");
PaymentResponse response = client.send(request);
// request is fraud filter
PaymentResponse response = client.send(request);
FraudFilter.FraudFilterMode mode = response.getFraudFilter().getMode();
FraudFilter.FraudFilterResult result = response.getFraudFilter().getResult();
List<FraudFilterRule> rules = response.getFraudFilter().getRules();
for (FraudFilterRule rule :rules ) {
System.out.print(rule.getId());
System.out.print(rule.getName());
System.out.print(rule.getValue());
}
//or
rules.get(0).getId();
See the LICENSE file.