Add mobile commerce in payment tool string (#101)

This commit is contained in:
Pavel Popov 2019-09-24 19:43:09 +03:00 committed by GitHub
parent dc2c6720f1
commit d337be8f03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,6 +181,10 @@ public class PaymentToolUtils {
} else if (paymentTool.isSetCryptoCurrency()) {
rootNode.put("type", "crypto_currency");
rootNode.put("crypto_currency", paymentTool.getCryptoCurrency().name());
} else if (paymentTool.isSetMobileCommerce()) {
rootNode.put("type", "mobile_commerce");
MobilePhone mobilePhone = paymentTool.getMobileCommerce().getPhone();
rootNode.put("mobile_commerce", mobilePhone.getCc() + mobilePhone.getCtn());
} else {
throw new UnsupportedOperationException("Unknown payment tool type. Must be bank card, terminal or digital wallet");
}