Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2014 Groupon, Inc
*
* Groupon licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package org.killbill.billing.payment.invoice.dao;
import java.math.BigDecimal;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.inject.Inject;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.killbill.billing.catalog.api.Currency;
import org.skife.jdbi.v2.Handle;
import org.skife.jdbi.v2.IDBI;
import org.skife.jdbi.v2.tweak.HandleCallback;
public class InvoicePaymentRoutingDao {
private final IDBI dbi;
@Inject
public InvoicePaymentRoutingDao(final IDBI dbi) {
this.dbi = dbi;
}
public void insertAutoPayOff(final PluginAutoPayOffModelDao data) {
dbi.withHandle(new HandleCallback() {
@Override
public Void withHandle(final Handle handle) throws Exception {
final String paymentId = data.getPaymentId() != null ? data.getPaymentId().toString() : null;
final String paymentMethodId = data.getPaymentMethodId() != null ? data.getPaymentMethodId().toString() : null;
handle.execute("insert into _invoice_payment_control_plugin_auto_pay_off " +
"(attempt_id, payment_external_key, transaction_external_key, account_id, plugin_name, payment_id, payment_method_id, amount, currency, created_by, created_date) values " +
"(?,?,?,?,?,?,?,?,?,?,?)",
data.getAttemptId().toString(), data.getPaymentExternalKey(), data.getTransactionExternalKey(), data.getAccountId(), data.getPluginName(), paymentId, paymentMethodId,
data.getAmount(), data.getCurrency(), data.getCreatedBy(), data.getCreatedDate()
);
return null;
}
});
}
public List getAutoPayOffEntry(final UUID accountId) {
return dbi.withHandle(new HandleCallback>() {
@Override
public List withHandle(final Handle handle) throws Exception {
final List