0

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.

5
  • 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, 2016 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 Jul 7, 2016 at 16:40
  • are you using the observer like mbalparda? Is the observer called when you call the api?
    – Richard
    Jul 7, 2016 at 19:07
  • Yes I installed that module and the payment method is still not available via the API Jul 7, 2016 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/… Jul 7, 2016 at 22:02

1 Answer 1

0

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 and acknowledge you have read our privacy policy.

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