From 058fbf13f8e59ce7a96902080e6207117f89e137 Mon Sep 17 00:00:00 2001 From: Vladimir Pankrashkin Date: Thu, 17 Aug 2017 20:26:42 +0300 Subject: [PATCH] AN-1: update thrift party protocol details --- .../antifraud/thirdparty/ModelConverter.java | 2 +- src/main/resources/application.properties | 2 +- .../antifraud/thirdparty/AfServiceTest.java | 2 +- .../antifraud/thirdparty/ThirdPartyTest.java | 49 +++++++++++++++---- .../resources/application-test.properties | 6 +-- 5 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/rbkmoney/antifraud/thirdparty/ModelConverter.java b/src/main/java/com/rbkmoney/antifraud/thirdparty/ModelConverter.java index 482e7e4..2be97cf 100644 --- a/src/main/java/com/rbkmoney/antifraud/thirdparty/ModelConverter.java +++ b/src/main/java/com/rbkmoney/antifraud/thirdparty/ModelConverter.java @@ -51,7 +51,7 @@ public class ModelConverter { model.put("id", payment.getInvoiceId() + "." + payment.getPaymentId()); model.put("description", payment.getDescription()); model.put("amount", payment.getAmount() / 100.);//todo get minor value from DM conf - model.put("currency", payment.getCurrency()); + model.put("currency", "RUR"); return model; } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8956c0a..550a011 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -13,7 +13,7 @@ af.username=ya.arc2011@yandex.ru af.password=Rbkmoney_2016 af.conn.maxidle=10 af.conn.keepalive=300000 -af.conn.timeout=3000 +af.conn.timeout=5000 #spring.datasource.type=com.zaxxer.hikari.HikariDataSource #spring.datasource.driver-class-name=org.postgresql.Driver #spring.datasource.url=@db.url@ diff --git a/src/test/java/com/rbkmoney/antifraud/thirdparty/AfServiceTest.java b/src/test/java/com/rbkmoney/antifraud/thirdparty/AfServiceTest.java index dd7d4ec..bfa0443 100644 --- a/src/test/java/com/rbkmoney/antifraud/thirdparty/AfServiceTest.java +++ b/src/test/java/com/rbkmoney/antifraud/thirdparty/AfServiceTest.java @@ -54,7 +54,7 @@ public class AfServiceTest { private static Context createContext() { return new Context( new PaymentInfo( - new Shop("2035728______", + new Shop("2035728", new Category("pizza", "no category"), new ShopDetails("pizza-sushi"), new ShopLocation() {{ diff --git a/src/test/java/com/rbkmoney/antifraud/thirdparty/ThirdPartyTest.java b/src/test/java/com/rbkmoney/antifraud/thirdparty/ThirdPartyTest.java index c404468..8ce13fd 100644 --- a/src/test/java/com/rbkmoney/antifraud/thirdparty/ThirdPartyTest.java +++ b/src/test/java/com/rbkmoney/antifraud/thirdparty/ThirdPartyTest.java @@ -6,23 +6,52 @@ import org.junit.Test; @Ignore public class ThirdPartyTest { - + AfService service = new AfService("https://rbkmoney.antifraud.link/PreAuthorization.ashx", "ya.arc2011@yandex.ru", "Rbkmoney_2016__", 1, 1000, 7000); @Test - public void test() { - AfService service = new AfService("https://rbkmoneytest.antifraud.link/PreAuthorization.ashx", "ya.arc2011@yandex.ru", "Rbkmoney_2016", 1, 1000, 7000); + public void test1() { + testLgbtNew(); + //testLgbtNew(); + //testLgbtNew(); + } + + public void testLgbtOld() { Payment payment = new Payment(); - payment.setDescription("drugs guns murder"); - payment.setClientFingerprint("11111111111111111111111111111111111111"); + payment.setInvoiceId(System.currentTimeMillis()+""); + payment.setPaymentId(System.currentTimeMillis()+""); + payment.setDescription("gays donation"); + payment.setClientFingerprint("11111111111111111111111111111111111112"); payment.setClientIp("192.42.116.16"); payment.setClientEmail("v.pankrashkin@rbkmoney.com"); payment.setCardMask("424242******4242"); //payment.setCardMask("411111******1111"); payment.setCardToken("477bba133c182267fe5f086924abdc5db71f77bfc27f01f2843f2cdc69d89f05"); - payment.setAmount(9000000000000000000L); - payment.setShopId("2035728a"); - payment.setPartyId(""); - payment.setShopName("pizza-sushi"); - payment.setShopUrl("http://www.pizza-sushi.com/"); + payment.setAmount(90000l); + payment.setShopId(""); + payment.setPartyId("2033985"); + payment.setShopName("lgbtnet.org"); + payment.setShopUrl("https://www.lgbtnet.org/"); + payment.setCurrency("RUB"); + + System.out.println(service.inspect(payment) + ); + } + + public void testLgbtNew() { + Payment payment = new Payment(); + payment.setInvoiceId(System.currentTimeMillis()+""); + payment.setPaymentId(System.currentTimeMillis()+""); + payment.setDescription("gays donation"); + payment.setClientFingerprint("11111111111111111111111111111111111113"); + payment.setClientIp("192.42.116.17"); + payment.setClientEmail("123@rbkmoney.com"); + payment.setCardMask("424242******4243"); + //payment.setCardMask("411111******1111"); + payment.setCardToken("477bba133c182267fe5f086924abdc5db71f77bfc27f01f2843f2cdc69d89f0f"); + payment.setAmount(90000l); + payment.setShopId("2"); + payment.setPartyId("6954b4d1-f39f-4cc1-8843-eae834e6f849"); + payment.setShopName("help.lgbtnet.org"); + payment.setShopUrl("https://help.lgbtnet.org/"); payment.setCurrency("RUB"); System.out.println(service.inspect(payment) diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index 717f42a..21a20f9 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -9,11 +9,11 @@ info.damsel.version=@damsel.version@ endpoints.health.sensitive=false af.url=https://rbkmoneytest.antifraud.link/PreAuthorization.ashx -af.username=ya.arc2011@yandex.ru -af.password=Rbkmoney_2016 +af.username=n.bocharov@rbkmoney.com +af.password=wO5a5cj_Xw af.conn.maxidle=10 af.conn.keepalive=300000 -af.conn.timeout=60000 +af.conn.timeout=600000 #spring.datasource.type=com.zaxxer.hikari.HikariDataSource #spring.datasource.driver-class-name=org.postgresql.Driver #spring.datasource.url=@db.url@