<p>I would save the response to an incognito field (or fields) on your order (probably both the entire response and also just the fee separate out).</p>

<p><a href="https://github.com/mmikkel/IncognitoField-Craft" rel="nofollow">https://github.com/mmikkel/IncognitoField-Craft</a></p>

<p>The <code>readonly</code> incognito field is particularly good for this sort of thing - I use a bunch of these fields in a debug tab on my order layout to save useful things.</p>

<p>Just create the fields, add the fields to your order, and you update the values with the usual <code>&lt;input name="fields[fieldName]"&gt;</code> syntax with any cart operation, or use <code>setContentFromPost</code> if you're in a plugin:</p>

<pre><code>    $order-&gt;setContentFromPost(array(
        'fieldName' =&gt; $creditCardFee,
    ));
    craft()-&gt;commerce_orders-&gt;saveOrder($order);
</code></pre>

CC BY-SA 3.0
2016-10-27T00:20:05.890Z
2016-10-27T00:20:05.890Z
Jeremy Daalder
<p>I need to add the credit card fee to the order in the CP. I get a response from the gateway with a custom txnfee variable and would like to view it in the CP. Just like an custom adjuster. Does anyone have any experience with that?</p>

<p>Example:</p>

<p>Order = $100
Tax = $5
Credit card fee = $1
Total = $106</p>

CC BY-SA 3.0
2016-10-26T17:42:07.947Z
Isn't this identical to your other question? https://craftcms.stackexchange.com/questions/17371/save-and-show-card-fee-for-commerce-plugin
Brad Bell
CC BY-SA 3.0
2016-10-26T17:44:34.557Z
Yes I guess it is. But this is more general in terms of an overall solution for saving all the gateway response data for easy readability in the CP.
Beuschau
<plugin-craftcommerce>
Credit card fee to the final order in CP
# Credit card fee to the final order in CP

(Asked by: username_0 on 2016-10-26)

I need to add the credit card fee to the order in the CP. I get a response from the gateway with a custom txnfee variable and would like to view it in the CP. Just like an custom adjuster. Does anyone have any experience with that?

Example:

Order = $100
Tax = $5
Credit card fee = $1
Total = $106

**Tags:** plugin-craftcommerce
> **Comments:**
> **username_1**: Isn't this identical to your other question? https://craftcms.stackexchange.com/questions/17371/save-and-show-card-fee-for-commerce-plugin  
> **username_0**: Yes I guess it is. But this is more general in terms of an overall solution for saving all the gateway response data for easy readability in the CP.  

---

## 1 answers

### Answer by username_2 on 2016-10-27. Score: 1

I would save the response to an incognito field (or fields) on your order (probably both the entire response and also just the fee separate out).
https://github.com/mmikkel/IncognitoField-Craft
The readonly incognito field is particularly good for this sort of thing - I use a bunch of these fields in a debug tab on my order layout to save useful things.
Just create the fields, add the fields to your order, and you update the values with the usual  syntax with any cart operation, or use setContentFromPost if you're in a plugin:
    $order->setContentFromPost(array(
        'fieldName' => $creditCardFee,
    ));
    craft()->commerce_orders->saveOrder($order);


---

