Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Mage_Checkout

Module: Shopping Cart API

Resource: cart_payment

Method:
  • cart_payment.method (SOAP V1)
  • shoppingCartPaymentMethod (SOAP V2)

Allows you to set a payment method for a shopping cart (quote).

Arguments:

TypeNameDescription
stringsessionIdSession ID
intquoteIdShopping cart ID
arraymethodArray of shoppingCartPaymentMethodEntity
stringstoreStore view ID or code (optional)

Return:

TypeDescription
booleanTrue on success

The shoppingCartPaymentMethodEntity content is as follows:

TypeNameDescription
stringpo_numberPurchase order number
stringmethodPayment method
stringcc_cidCredit card CID
stringcc_ownerCredit card owner
stringcc_numberCredit card number
stringcc_typeCredit card type
stringcc_exp_yearCredit card expiration year
stringcc_exp_monthCredit card expiration month

Faults:
No Faults.

Examples

Request Example SOAP V1
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

$shoppingCartId = $proxy->call( $sessionId, 'cart.create', array( 'magento_store' ) );

$paymentMethod = array(
	"method" => "checkmo"
);

$resultPaymentMethod = $proxy->call(
	$sessionId,
	"cart_payment.method",
	array(
		$shoppingCartId,
		$paymentMethod
	)
);
Request Example SOAP V2
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy->login('apiUser', 'apiKey'); 
 
$result = $proxy->shoppingCartPaymentMethod($sessionId, 10, array(
'po_number' => null,
'method' => 'checkmo',
'cc_cid' => null,
'cc_owner' => null,
'cc_number' => null,
'cc_type' => null,
'cc_exp_year' => null,
'cc_exp_month' => null
));  
 
var_dump($result);
Request Example SOAP V2 (WS-I Compliance Mode)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey')); 
 
$result = $proxy->shoppingCartPaymentMethod((object)array('sessionId' => $sessionId->result, 'quoteId' => 10, 'method' => array(
'po_number' => null,
'method' => 'checkmo',
'cc_cid' => null,
'cc_owner' => null,
'cc_number' => null,
'cc_type' => null,
'cc_exp_year' => null,
'cc_exp_month' => null
)));  
 
var_dump($result->result);