Search in sources :

Example 1 with AdminPaymentJson

use of org.killbill.billing.jaxrs.json.AdminPaymentJson in project killbill by killbill.

the class TestAdmin method fixPaymentState.

private void fixPaymentState(final Payment payment, final String lastSuccessPaymentState, final String currentPaymentStateName, final TransactionStatus transactionStatus) throws KillBillClientException {
    //
    // We do not expose the endpoint in the client API on purpose since this should only be accessed using special permission ADMIN_CAN_FIX_DATA
    // for when there is a need to fix payment state.
    //
    final String uri = "/1.0/kb/admin/payments/" + payment.getPaymentId().toString() + "/transactions/" + payment.getTransactions().get(0).getTransactionId().toString();
    final AdminPaymentJson body = new AdminPaymentJson(lastSuccessPaymentState, currentPaymentStateName, transactionStatus.toString());
    final Multimap result = HashMultimap.create();
    result.put(KillBillHttpClient.AUDIT_OPTION_CREATED_BY, createdBy);
    result.put(KillBillHttpClient.AUDIT_OPTION_REASON, reason);
    result.put(KillBillHttpClient.AUDIT_OPTION_COMMENT, comment);
    killBillHttpClient.doPut(uri, body, result);
}
Also used : Multimap(com.google.common.collect.Multimap) HashMultimap(com.google.common.collect.HashMultimap) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) AdminPaymentJson(org.killbill.billing.jaxrs.json.AdminPaymentJson)

Aggregations

HashMultimap (com.google.common.collect.HashMultimap)1 ImmutableMultimap (com.google.common.collect.ImmutableMultimap)1 Multimap (com.google.common.collect.Multimap)1 AdminPaymentJson (org.killbill.billing.jaxrs.json.AdminPaymentJson)1