Magento – SOAP API adding payment method braintree

apisoap

I'm trying to add braintree payment using soap api v2, but when I call shoppingCartOrder function receive the next error "There was an error capturing the transaction. (Transaction deckined: Cannot determine payment method.)

I have not problems using the same code but checkmo as payment method

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:api="http://127.0.0.1/Integrics/Enswitch/API"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
       <api:shoppingCartPaymentMethod soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
           <sessionId>$token</sessionId>
           <quoteId>$quoteId</quoteId>
           <method>
               <method>braintree</method>
               <cc_cid>123</cc_cid>
               <cc_number>4111111111111111</cc_number>
               <cc_type>VI</cc_type>
               <cc_exp_year>2020</cc_exp_year>
               <cc_exp_month>12</cc_exp_month>
           </method>
       </api:shoppingCartPaymentMethod>
   </soapenv:Body>
</soapenv:Envelope>

Best Answer

If you are still looking for answer.. While setting payment method to cart you have to pass valid method code for that particular payment. Also please note that Setting payment method from API only supports the methods which you get in shoppingCartPaymentList method,

so basic steps should be get list of applicable payment method for cart. read payment method code and pass while setting payment method code while setting.

to get list of valid payment methods, refer below link http://www.magentocommerce.com/api/soap/checkout/cartPayment/cart_payment.list.html to set payment method to cart refer this. http://www.magentocommerce.com/api/soap/checkout/cartPayment/cart_payment.method.html

Related Topic