Я сделал платеж через PayPal. Я новичок в этой структуре. Понятия не имею, в какую таблицу мне нужно обновиться. Если вы, ребята, дадите несколько идей о ходе реализации, это будет очень полезно.
Ниже я уже попробовал
$quoteId=128551;
$customerId=29395;
$store = Mage::app()->getStore();
$website = Mage::app()->getWebsite();
$quote = Mage::getModel('sales/quote')->setStoreId($store->getStoreId())->load($quoteId);
$customer = Mage::getModel('customer/customer')->load($customerId);
//Assign the customer to quote
$quote->assignCustomer($customer);
//Set currency for the quote
$quote->setCurrency(Mage::app()->getStore()->getBaseCurrencyCode());
$billingAddressId=29971;
$customAddress = Mage::getModel('customer/address')->load($billingAddressId);
$quoteShippingAddress = Mage::getModel('sales/quote_address');
$quoteShippingAddress->setData($customAddress);
$quote->setShippingAddress($quoteShippingAddress);
// fixed shipping method
$quote->getShippingAddress()->setShippingMethod('freeshipping_freeshipping');
$quote->getShippingAddress()->setPaymentMethod('paypal_express');
$quote->getShippingAddress()->setCollectShippingRates(true);
$quote->getShippingAddress()->collectShippingRates();
//Set payment method for the quote
$quote->getPayment()->importData(array('method' => 'paypal_express'));
try {
$quote->collectTotals()->save();
//Create order from quote
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$increment_id = $service->getOrder()->getRealOrderId();
$orderId = $service->getOrder()->getId();
Mage::getSingleton('checkout/session')
->setLastQuoteId($quote->getId())
->setLastSuccessQuoteId($quote->getId())
->clearHelperData();
echo $msg = 'Order has been successfully created.';
} catch (Exception $e) {
$msg = $e->getMessage();
}