mirror of
https://github.com/valitydev/adapter-flow-lib.git
synced 2024-11-06 00:05:22 +00:00
Add currency and refactor
This commit is contained in:
parent
269ad48785
commit
0d907650a3
@ -1 +1,2 @@
|
||||
### Конфигурация Spring Boot?
|
||||
|
||||
|
@ -66,8 +66,11 @@ public class CtxToEntryModelConverter implements Converter<PaymentContext, Entry
|
||||
.refundData(initRefundData(paymentInfo))
|
||||
.paymentId(idGenerator.get(paymentInfo.getInvoice().getId()))
|
||||
.createdAt(paymentInfo.getPayment().getCreatedAt())
|
||||
.currency(payment.getCost().getCurrency().getSymbolicCode())
|
||||
.amount(payment.getCost().getAmount())
|
||||
.currency(Currency.builder()
|
||||
.symbolicCode(payment.getCost().getCurrency().getSymbolicCode())
|
||||
.numericCode(payment.getCost().getCurrency().getNumericCode())
|
||||
.build()
|
||||
).amount(payment.getCost().getAmount())
|
||||
.details(paymentInfo.getInvoice().getDetails().getDescription())
|
||||
.payerInfo(PayerInfo.builder()
|
||||
.ip(ProxyProviderPackageCreators.extractIpAddress(context))
|
||||
|
@ -65,7 +65,13 @@ public class RecCtxToEntryModelConverter implements Converter<RecurrentTokenCont
|
||||
.cardData(cardData)
|
||||
.refundData(initRefundData(recurrentPaymentTool, orderId))
|
||||
.paymentId(orderId)
|
||||
.currency(recurrentPaymentTool.getMinimalPaymentCost().getCurrency().getSymbolicCode())
|
||||
.currency(Currency.builder()
|
||||
.symbolicCode(
|
||||
recurrentPaymentTool.getMinimalPaymentCost().getCurrency().getSymbolicCode())
|
||||
.numericCode(
|
||||
recurrentPaymentTool.getMinimalPaymentCost().getCurrency().getNumericCode())
|
||||
.build()
|
||||
)
|
||||
.amount(recurrentPaymentTool.getMinimalPaymentCost().getAmount())
|
||||
.details(recurrentPaymentTool.getId())
|
||||
.payerInfo(PayerInfo.builder()
|
||||
|
@ -17,7 +17,7 @@ import java.util.Map;
|
||||
public class BaseRequestModel {
|
||||
|
||||
/**
|
||||
* Uniq Long identifier for payment.
|
||||
* Uniq Long identifier for payment.
|
||||
*/
|
||||
private Long paymentId;
|
||||
/**
|
||||
@ -29,12 +29,12 @@ public class BaseRequestModel {
|
||||
*/
|
||||
private Long amount;
|
||||
/**
|
||||
* Currency in symbolic formats (example: "USD").
|
||||
* Code and symbolic code of currency.
|
||||
*/
|
||||
private String currency;
|
||||
private Currency currency;
|
||||
/**
|
||||
* Timestamp RFC 3339.
|
||||
*
|
||||
* <p>
|
||||
* The string must contain the date and time in UTC in the following format:
|
||||
* `2016-03-22T06:12:27Z`
|
||||
*/
|
||||
|
@ -0,0 +1,23 @@
|
||||
package dev.vality.adapter.flow.lib.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Currency {
|
||||
|
||||
/**
|
||||
* Currency in symbolic formats (example: "USD").
|
||||
*/
|
||||
private String symbolicCode;
|
||||
/**
|
||||
* Currency in symbolic formats (example: "USD").
|
||||
*/
|
||||
private Short numericCode;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user