mirror of
https://github.com/valitydev/proxy-mocketbank.git
synced 2024-11-06 10:05:16 +00:00
parent
1bc3f2c886
commit
d9092038e8
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -27,7 +27,7 @@ build('proxy-mocketbank', 'java-maven') {
|
||||
}
|
||||
|
||||
try {
|
||||
if (env.BRANCH_NAME == 'master') {
|
||||
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('epic')) {
|
||||
runStage('Push Service image') {
|
||||
docker.withRegistry('https://dr.rbkmoney.com/v2/', 'dockerhub-rbkmoneycibot') {
|
||||
serviceImage.push();
|
||||
|
4
pom.xml
4
pom.xml
@ -65,12 +65,12 @@
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney.woody</groupId>
|
||||
<artifactId>woody-thrift</artifactId>
|
||||
<version>1.0.4</version>
|
||||
<version>1.1.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<artifactId>damsel</artifactId>
|
||||
<version>1.123-91298f7</version>
|
||||
<version>1.186-7bb67fc-epic</version>
|
||||
</dependency>
|
||||
<!--Test libs-->
|
||||
<dependency>
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.rbkmoney.proxy.mocketbank.handler;
|
||||
|
||||
import com.rbkmoney.damsel.cds.CardData;
|
||||
import com.rbkmoney.damsel.domain.TargetInvoicePaymentStatus;
|
||||
import com.rbkmoney.damsel.domain.TransactionInfo;
|
||||
import com.rbkmoney.damsel.proxy.Intent;
|
||||
import com.rbkmoney.damsel.proxy_provider.*;
|
||||
@ -82,8 +83,8 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
|
||||
|
||||
private ProxyResult processed(Context context) {
|
||||
LOGGER.info("processed start");
|
||||
com.rbkmoney.damsel.proxy_provider.InvoicePayment invoicePayment = context.getPayment().getPayment();
|
||||
String session = invoicePayment.getPayer().getSession();
|
||||
com.rbkmoney.damsel.proxy_provider.InvoicePayment invoicePayment = context.getPaymentInfo().getPayment();
|
||||
String session = invoicePayment.getPayer().getSessionId();
|
||||
String token = invoicePayment.getPayer().getPaymentTool().getBankCard().getToken();
|
||||
CardData cardData;
|
||||
TransactionInfo transactionInfo = null;
|
||||
@ -121,7 +122,7 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
|
||||
break;
|
||||
case SUCCESS:
|
||||
transactionInfo = DomainWrapper.makeTransactionInfo(
|
||||
MocketBankMpiUtils.generateInvoice(context.getPayment()),
|
||||
MocketBankMpiUtils.generateInvoice(context.getPaymentInfo()),
|
||||
Collections.emptyMap()
|
||||
);
|
||||
ProxyResult proxyResult = ProxyProviderWrapper.makeProxyResult(
|
||||
@ -165,7 +166,7 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
|
||||
}
|
||||
|
||||
if (verifyEnrollmentResponse.getEnrolled().equals(MocketBankMpiEnrollmentStatus.AUTHENTICATION_AVAILABLE)) {
|
||||
String tag = "MPI-" + MocketBankMpiUtils.generateInvoice(context.getPayment());
|
||||
String tag = "MPI-" + MocketBankMpiUtils.generateInvoice(context.getPaymentInfo());
|
||||
LOGGER.info("Processed: suspend tag {}", tag);
|
||||
|
||||
String url = verifyEnrollmentResponse.getAcsUrl();
|
||||
@ -208,7 +209,7 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
|
||||
|
||||
private ProxyResult captured(Context context) {
|
||||
LOGGER.info("Captured: start");
|
||||
com.rbkmoney.damsel.proxy_provider.InvoicePayment payment = context.getPayment().getPayment();
|
||||
com.rbkmoney.damsel.proxy_provider.InvoicePayment payment = context.getPaymentInfo().getPayment();
|
||||
TransactionInfo transactionInfoContractor = payment.getTrx();
|
||||
TransactionInfo transactionInfo = DomainWrapper.makeTransactionInfo(
|
||||
transactionInfoContractor.getId(),
|
||||
@ -233,9 +234,9 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
|
||||
@Override
|
||||
public CallbackResult handlePaymentCallback(ByteBuffer byteBuffer, Context context) throws TException {
|
||||
LOGGER.info("HandlePaymentCallback: start");
|
||||
InvoicePayment invoicePayment = context.getPayment().getPayment();
|
||||
InvoicePayment invoicePayment = context.getPaymentInfo().getPayment();
|
||||
String token = invoicePayment.getPayer().getPaymentTool().getBankCard().getToken();
|
||||
String session = invoicePayment.getPayer().getSession();
|
||||
String session = invoicePayment.getPayer().getSessionId();
|
||||
options = context.getOptions();
|
||||
|
||||
HashMap<String, String> parameters;
|
||||
@ -285,7 +286,7 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
|
||||
com.rbkmoney.damsel.proxy.Intent intent = ProxyWrapper.makeFinishIntentSuccess();
|
||||
|
||||
TransactionInfo transactionInfo = DomainWrapper.makeTransactionInfo(
|
||||
MocketBankMpiUtils.generateInvoice(context.getPayment()),
|
||||
MocketBankMpiUtils.generateInvoice(context.getPaymentInfo()),
|
||||
Collections.emptyMap()
|
||||
);
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class CdsWrapper {
|
||||
public static PutCardDataResult makePutCardDataResult(BankCard bankCard, String session) {
|
||||
PutCardDataResult putCardDataResult = new PutCardDataResult();
|
||||
putCardDataResult.setBankCard(bankCard);
|
||||
putCardDataResult.setSession(session);
|
||||
putCardDataResult.setSessionId(session);
|
||||
return putCardDataResult;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class DomainWrapper {
|
||||
payer.setContactInfo(contactInfo);
|
||||
payer.setClientInfo(clientInfo);
|
||||
payer.setPaymentTool(paymentTool);
|
||||
payer.setSession(session);
|
||||
payer.setSessionId(session);
|
||||
return payer;
|
||||
}
|
||||
|
||||
@ -76,16 +76,11 @@ public class DomainWrapper {
|
||||
return shopLocation;
|
||||
}
|
||||
|
||||
public static ShopDetails makeShopDetails(String name, String description, ShopLocation location) {
|
||||
public static ShopDetails makeShopDetails(String name, String description) {
|
||||
ShopDetails shopDetails = new ShopDetails();
|
||||
shopDetails.setName(name);
|
||||
shopDetails.setDescription(description);
|
||||
shopDetails.setLocation(location);
|
||||
return shopDetails;
|
||||
}
|
||||
|
||||
public static ShopDetails makeShopDetails(String name, String description) {
|
||||
return DomainWrapper.makeShopDetails(name, description, null);
|
||||
return shopDetails;
|
||||
}
|
||||
|
||||
public static Category makeCategory(String name, String description) {
|
||||
|
@ -107,7 +107,7 @@ public class ProxyProviderWrapper {
|
||||
Map<String, String> options
|
||||
) {
|
||||
Context context = new Context();
|
||||
context.setPayment(paymentInfo);
|
||||
context.setPaymentInfo(paymentInfo);
|
||||
context.setSession(session);
|
||||
context.setOptions(options);
|
||||
return context;
|
||||
|
@ -3,11 +3,11 @@ package com.rbkmoney.proxy.mocketbank.handler;
|
||||
import com.rbkmoney.damsel.cds.CardData;
|
||||
import com.rbkmoney.damsel.cds.PutCardDataResult;
|
||||
import com.rbkmoney.damsel.cds.UnlockStatus;
|
||||
import com.rbkmoney.damsel.domain.TargetInvoicePaymentStatus;
|
||||
import com.rbkmoney.damsel.domain.TransactionInfo;
|
||||
import com.rbkmoney.damsel.proxy_provider.Context;
|
||||
import com.rbkmoney.damsel.proxy_provider.PaymentInfo;
|
||||
import com.rbkmoney.damsel.proxy_provider.ProxyResult;
|
||||
import com.rbkmoney.damsel.proxy_provider.TargetInvoicePaymentStatus;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.Converter;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.cds.CdsApi;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.damsel.CdsWrapper;
|
||||
@ -158,7 +158,7 @@ public class MocketBankServerHandlerFailIntegrationTest {
|
||||
DomainWrapper.makeContactInfo("email", "phone"),
|
||||
DomainWrapper.makeClientInfo("fingerprint", "ip"),
|
||||
DomainWrapper.makePaymentTool(putCardDataResponse.getBankCard()),
|
||||
putCardDataResponse.getSession()
|
||||
putCardDataResponse.getSessionId()
|
||||
),
|
||||
getCost(),
|
||||
transactionInfo
|
||||
|
@ -3,8 +3,12 @@ package com.rbkmoney.proxy.mocketbank.handler;
|
||||
import com.rbkmoney.damsel.cds.CardData;
|
||||
import com.rbkmoney.damsel.cds.PutCardDataResult;
|
||||
import com.rbkmoney.damsel.cds.UnlockStatus;
|
||||
import com.rbkmoney.damsel.domain.TargetInvoicePaymentStatus;
|
||||
import com.rbkmoney.damsel.domain.TransactionInfo;
|
||||
import com.rbkmoney.damsel.proxy_provider.*;
|
||||
import com.rbkmoney.damsel.proxy_provider.CallbackResult;
|
||||
import com.rbkmoney.damsel.proxy_provider.Context;
|
||||
import com.rbkmoney.damsel.proxy_provider.PaymentInfo;
|
||||
import com.rbkmoney.damsel.proxy_provider.ProxyResult;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.Converter;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.cds.CdsApi;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.damsel.CdsWrapper;
|
||||
@ -155,7 +159,7 @@ public class MocketBankServerHandlerFailWith3DSIntegrationTest {
|
||||
DomainWrapper.makeContactInfo("email", "phone"),
|
||||
DomainWrapper.makeClientInfo("fingerprint", "ip"),
|
||||
DomainWrapper.makePaymentTool(putCardDataResponse.getBankCard()),
|
||||
putCardDataResponse.getSession()
|
||||
putCardDataResponse.getSessionId()
|
||||
),
|
||||
getCost(),
|
||||
transactionInfo
|
||||
|
@ -3,11 +3,11 @@ package com.rbkmoney.proxy.mocketbank.handler;
|
||||
import com.rbkmoney.damsel.cds.CardData;
|
||||
import com.rbkmoney.damsel.cds.PutCardDataResult;
|
||||
import com.rbkmoney.damsel.cds.UnlockStatus;
|
||||
import com.rbkmoney.damsel.domain.TargetInvoicePaymentStatus;
|
||||
import com.rbkmoney.damsel.domain.TransactionInfo;
|
||||
import com.rbkmoney.damsel.proxy_provider.Context;
|
||||
import com.rbkmoney.damsel.proxy_provider.PaymentInfo;
|
||||
import com.rbkmoney.damsel.proxy_provider.ProxyResult;
|
||||
import com.rbkmoney.damsel.proxy_provider.TargetInvoicePaymentStatus;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.Converter;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.cds.CdsApi;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.damsel.CdsWrapper;
|
||||
@ -173,7 +173,7 @@ public class MocketBankServerHandlerSuccessIntegrationTest {
|
||||
DomainWrapper.makeContactInfo("email", "phone"),
|
||||
DomainWrapper.makeClientInfo("fingerprint", "ip"),
|
||||
DomainWrapper.makePaymentTool(putCardDataResponse.getBankCard()),
|
||||
putCardDataResponse.getSession()
|
||||
putCardDataResponse.getSessionId()
|
||||
),
|
||||
getCost(),
|
||||
transactionInfo
|
||||
|
@ -3,6 +3,7 @@ package com.rbkmoney.proxy.mocketbank.handler;
|
||||
import com.rbkmoney.damsel.cds.CardData;
|
||||
import com.rbkmoney.damsel.cds.PutCardDataResult;
|
||||
import com.rbkmoney.damsel.cds.UnlockStatus;
|
||||
import com.rbkmoney.damsel.domain.TargetInvoicePaymentStatus;
|
||||
import com.rbkmoney.damsel.domain.TransactionInfo;
|
||||
import com.rbkmoney.damsel.proxy_provider.*;
|
||||
import com.rbkmoney.proxy.mocketbank.utils.Converter;
|
||||
@ -172,7 +173,7 @@ public class MocketBankServerHandlerSuccessWith3DSIntegrationTest {
|
||||
DomainWrapper.makeContactInfo("email", "phone"),
|
||||
DomainWrapper.makeClientInfo("fingerprint", "ip"),
|
||||
DomainWrapper.makePaymentTool(putCardDataResponse.getBankCard()),
|
||||
putCardDataResponse.getSession()
|
||||
putCardDataResponse.getSessionId()
|
||||
),
|
||||
getCost(),
|
||||
transactionInfo
|
||||
|
Loading…
Reference in New Issue
Block a user