Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.vality</groupId>
<artifactId>service-parent-pom</artifactId>
<version>3.1.6</version>
<version>3.1.7</version>
</parent>

<name>fraudbusters</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public FraudRequest convert(Context context) {
PaymentModel paymentModel = new PaymentModel();
PaymentInfo payment = context.getPayment();
Party party = payment.getParty();
paymentModel.setPartyId(party.getPartyId());
paymentModel.setPartyId(party.getPartyRef().getId());
Payer payer = context.getPayment().getPayment().getPayer();
PayerFieldExtractor.getBankCard(payer)
.ifPresent(bankCard -> {
Expand All @@ -56,7 +56,7 @@ public FraudRequest convert(Context context) {
}
);

paymentModel.setShopId(payment.getShop().getId());
paymentModel.setShopId(payment.getShop().getShopRef().getId());
Cash cost = payment.getPayment().getCost();
paymentModel.setAmount(cost.getAmount());
paymentModel.setCurrency(cost.getCurrency().symbolic_code);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package dev.vality.fraudbusters;

import dev.vality.columbus.ColumbusServiceSrv;
import dev.vality.damsel.domain.PartyConfigRef;
import dev.vality.damsel.domain.RiskScore;
import dev.vality.damsel.domain.ShopConfigRef;
import dev.vality.damsel.fraudbusters.*;
import dev.vality.damsel.proxy_inspector.Context;
import dev.vality.damsel.proxy_inspector.InspectorProxySrv;
Expand Down Expand Up @@ -220,8 +222,8 @@ private void testFraudRules() throws URISyntaxException, InterruptedException, T
//test chargeback functions
String chargeTest = "charge-test";
context = BeanUtil.createContext(chargeTest);
context.getPayment().getShop().setId(chargeTest);
context.getPayment().getParty().setPartyId(chargeTest);
context.getPayment().getShop().setShopRef(new ShopConfigRef(chargeTest));
context.getPayment().getParty().setPartyRef(new PartyConfigRef(chargeTest));
riskScore = client.inspectPayment(context);
assertEquals(RiskScore.high, riskScore);

Expand All @@ -236,7 +238,7 @@ private void testFraudRules() throws URISyntaxException, InterruptedException, T

//test refund functions
String refundShopId = "refund-test";
context.getPayment().getShop().setId(refundShopId);
context.getPayment().getShop().setShopRef(new ShopConfigRef(refundShopId));
riskScore = client.inspectPayment(context);
assertEquals(RiskScore.high, riskScore);

Expand Down
16 changes: 8 additions & 8 deletions src/test/java/dev/vality/fraudbusters/util/BeanUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static Context createContext(String paymentId) {
location.setUrl("http://www.pizza-sushi.com/");
PaymentInfo payment = new PaymentInfo(
new Shop(
ID_VALUE_SHOP,
new ShopConfigRef(ID_VALUE_SHOP),
new Category("pizza", "no category"),
"pizza-sushi",
location
Expand All @@ -78,7 +78,7 @@ public static Context createContext(String paymentId) {
"",
new InvoiceDetails("drugs guns murder")
),
new Party(paymentId)
new Party(new PartyConfigRef(paymentId))
);

return new Context(payment);
Expand Down Expand Up @@ -205,8 +205,8 @@ public static Chargeback convertContextToChargeback(Context context, String stat
Payer payer = context.getPayment().getPayment().getPayer();
ReferenceInfo referenceInfo = new ReferenceInfo();
referenceInfo.setMerchantInfo(new MerchantInfo()
.setPartyId(context.getPayment().getParty().getPartyId())
.setShopId(context.getPayment().getShop().getId()));
.setPartyId(context.getPayment().getParty().getPartyRef().id)
.setShopId(context.getPayment().getShop().getShopRef().id));
chargeback.setReferenceInfo(referenceInfo);
chargeback.setPayerType(PayerType.payment_resource);
ClientInfo clientInfo = new ClientInfo();
Expand Down Expand Up @@ -241,8 +241,8 @@ public static Refund convertContextToRefund(Context context, String status) {
Payer payer = context.getPayment().getPayment().getPayer();
ReferenceInfo referenceInfo = new ReferenceInfo();
referenceInfo.setMerchantInfo(new MerchantInfo()
.setPartyId(context.getPayment().getParty().getPartyId())
.setShopId(context.getPayment().getShop().getId()));
.setPartyId(context.getPayment().getParty().getPartyRef().id)
.setShopId(context.getPayment().getShop().getShopRef().id));
refund.setReferenceInfo(referenceInfo);
refund.setPayerType(PayerType.payment_resource);
ClientInfo clientInfo = new ClientInfo();
Expand Down Expand Up @@ -296,8 +296,8 @@ public static CheckedPayment convertContextToPayment(Context context, String sta
payment.setEmail(contactInfo.getEmail());
payment.setPhone(contactInfo.getPhoneNumber());
});
payment.setPartyId(context.getPayment().getParty().getPartyId());
payment.setShopId(context.getPayment().getShop().getId());
payment.setPartyId(context.getPayment().getParty().getPartyRef().id);
payment.setShopId(context.getPayment().getShop().getShopRef().id);
return payment;
}

Expand Down
Loading