To start I have already modified the check/money order payment method to be available only in admin (That worked, but not via the API)

The problem is that the method is not available to the V1 API. Here is how I am setting the cart

$cart = $proxy->call( $sessionId, 'cart.create', 0);

(Store 0 is Admin)

$result = $proxy->call($sessionId, "cart_payment.list", array($cart));

Where I get my list of methods only those available on the frontend are working. What I need is a method that is only available via the API.

  • I did something similar here github.com/miguelbalparda/MB_AdminMoney where you can select Check/Money order from the admin. Maybe you can use some code from there, definitely not an answer. – mbalparda Jul 7 '16 at 14:40
  • We already have it restricted to admin only, the problem is that it is not available on the frontend using the API – brentwpeterson Jul 7 '16 at 16:40
  • are you using the observer like mbalparda? Is the observer called when you call the api? – Richard Jul 7 '16 at 19:07
  • Yes I installed that module and the payment method is still not available via the API – brentwpeterson Jul 7 '16 at 21:02
  • Can you combine Miguel's code with this check to ensure the current session is an API call? stackoverflow.com/questions/7033788/… – JohnHughes1984 Jul 7 '16 at 22:02

This solution worked!

$apiRunning = Mage::getSingleton('api/server')->getAdapter() != null;

Thank you for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.