mirror of
https://github.com/valitydev/proxy-mocketbank.git
synced 2024-11-06 10:05:16 +00:00
PROX-145: added partial refunds (#21)
* PROX-145: added partial refunds
This commit is contained in:
parent
4ccfa023bc
commit
2ce09b2309
2
pom.xml
2
pom.xml
@ -70,7 +70,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.rbkmoney</groupId>
|
<groupId>com.rbkmoney</groupId>
|
||||||
<artifactId>damsel</artifactId>
|
<artifactId>damsel</artifactId>
|
||||||
<version>1.213-620cca5</version>
|
<version>1.220-cdf69d5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--Test libs-->
|
<!--Test libs-->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -3,7 +3,6 @@ package com.rbkmoney.proxy.mocketbank.handler;
|
|||||||
import com.rbkmoney.damsel.cds.CardData;
|
import com.rbkmoney.damsel.cds.CardData;
|
||||||
import com.rbkmoney.damsel.domain.TargetInvoicePaymentStatus;
|
import com.rbkmoney.damsel.domain.TargetInvoicePaymentStatus;
|
||||||
import com.rbkmoney.damsel.domain.TransactionInfo;
|
import com.rbkmoney.damsel.domain.TransactionInfo;
|
||||||
import com.rbkmoney.damsel.proxy.Intent;
|
|
||||||
import com.rbkmoney.damsel.proxy_provider.*;
|
import com.rbkmoney.damsel.proxy_provider.*;
|
||||||
import com.rbkmoney.proxy.mocketbank.utils.CardUtils;
|
import com.rbkmoney.proxy.mocketbank.utils.CardUtils;
|
||||||
import com.rbkmoney.proxy.mocketbank.utils.Converter;
|
import com.rbkmoney.proxy.mocketbank.utils.Converter;
|
||||||
@ -324,7 +323,7 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TransactionInfo transactionInfo = null;
|
TransactionInfo transactionInfo = null;
|
||||||
com.rbkmoney.damsel.proxy.Intent intent = ProxyWrapper.makeFinishIntentSuccess();
|
com.rbkmoney.damsel.proxy_provider.Intent intent = ProxyWrapper.makeFinishIntentSuccess();
|
||||||
|
|
||||||
|
|
||||||
CardUtils cardUtils = new CardUtils(cardList);
|
CardUtils cardUtils = new CardUtils(cardList);
|
||||||
@ -478,12 +477,15 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private PaymentProxyResult refunded(PaymentContext context, Map<String, String> options) {
|
private PaymentProxyResult refunded(PaymentContext context, Map<String, String> options) {
|
||||||
|
LOGGER.info("Refunded begin: context {}", context);
|
||||||
|
InvoicePaymentRefund invoicePaymentRefund = context.getPaymentInfo().getRefund();
|
||||||
|
|
||||||
PaymentProxyResult proxyResult = ProxyProviderWrapper.makePaymentProxyResult(
|
PaymentProxyResult proxyResult = ProxyProviderWrapper.makePaymentProxyResult(
|
||||||
ProxyWrapper.makeFinishIntentSuccess(),
|
ProxyWrapper.makeFinishIntentSuccess(),
|
||||||
"refunded".getBytes(),
|
"refunded".getBytes(),
|
||||||
context.getPaymentInfo().getPayment().getTrx()
|
invoicePaymentRefund.getTrx()
|
||||||
);
|
);
|
||||||
LOGGER.info("Refunded: proxyResult {}", proxyResult);
|
LOGGER.info("Refunded end: proxyResult {}", proxyResult);
|
||||||
return proxyResult;
|
return proxyResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,7 +541,7 @@ public class MocketBankServerHandler implements ProviderProxySrv.Iface {
|
|||||||
|
|
||||||
if (validatePaResResponse.getTransactionStatus().equals(MocketBankMpiTransactionStatus.AUTHENTICATION_SUCCESSFUL)) {
|
if (validatePaResResponse.getTransactionStatus().equals(MocketBankMpiTransactionStatus.AUTHENTICATION_SUCCESSFUL)) {
|
||||||
byte[] callbackResponse = new byte[0];
|
byte[] callbackResponse = new byte[0];
|
||||||
com.rbkmoney.damsel.proxy.Intent intent = ProxyWrapper.makeFinishIntentSuccess();
|
com.rbkmoney.damsel.proxy_provider.Intent intent = ProxyWrapper.makeFinishIntentSuccess();
|
||||||
|
|
||||||
TransactionInfo transactionInfo = DomainWrapper.makeTransactionInfo(
|
TransactionInfo transactionInfo = DomainWrapper.makeTransactionInfo(
|
||||||
MocketBankMpiUtils.generateInvoice(context.getPaymentInfo()),
|
MocketBankMpiUtils.generateInvoice(context.getPaymentInfo()),
|
||||||
|
@ -4,7 +4,6 @@ import com.rbkmoney.damsel.base.Timer;
|
|||||||
import com.rbkmoney.damsel.cds.CardData;
|
import com.rbkmoney.damsel.cds.CardData;
|
||||||
import com.rbkmoney.damsel.cds.ExpDate;
|
import com.rbkmoney.damsel.cds.ExpDate;
|
||||||
import com.rbkmoney.damsel.domain.*;
|
import com.rbkmoney.damsel.domain.*;
|
||||||
import com.rbkmoney.damsel.proxy.Intent;
|
|
||||||
import com.rbkmoney.damsel.proxy_provider.Invoice;
|
import com.rbkmoney.damsel.proxy_provider.Invoice;
|
||||||
import com.rbkmoney.damsel.proxy_provider.InvoicePayment;
|
import com.rbkmoney.damsel.proxy_provider.InvoicePayment;
|
||||||
import com.rbkmoney.damsel.proxy_provider.*;
|
import com.rbkmoney.damsel.proxy_provider.*;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package com.rbkmoney.proxy.mocketbank.utils.damsel;
|
package com.rbkmoney.proxy.mocketbank.utils.damsel;
|
||||||
|
|
||||||
import com.rbkmoney.damsel.base.Timer;
|
import com.rbkmoney.damsel.base.Timer;
|
||||||
import com.rbkmoney.damsel.proxy.*;
|
import com.rbkmoney.damsel.domain.Failure;
|
||||||
|
import com.rbkmoney.damsel.proxy_provider.*;
|
||||||
import com.rbkmoney.damsel.user_interaction.UserInteraction;
|
import com.rbkmoney.damsel.user_interaction.UserInteraction;
|
||||||
|
|
||||||
public class ProxyWrapper {
|
public class ProxyWrapper {
|
||||||
@ -56,7 +57,7 @@ public class ProxyWrapper {
|
|||||||
public static Failure makeFailure(String code, String description) {
|
public static Failure makeFailure(String code, String description) {
|
||||||
Failure failure = new Failure();
|
Failure failure = new Failure();
|
||||||
failure.setCode(code);
|
failure.setCode(code);
|
||||||
failure.setDescription(description);
|
failure.setReason(description);
|
||||||
return failure;
|
return failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user