本文整理汇总了PHP中Mage_Paypal_Model_Config::getExpressCheckoutCompleteUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Paypal_Model_Config::getExpressCheckoutCompleteUrl方法的具体用法?PHP Mage_Paypal_Model_Config::getExpressCheckoutCompleteUrl怎么用?PHP Mage_Paypal_Model_Config::getExpressCheckoutCompleteUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Paypal_Model_Config
的用法示例。
在下文中一共展示了Mage_Paypal_Model_Config::getExpressCheckoutCompleteUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: placeOrder
/**
* Place the order when customer returned from paypal
* Until this moment all quote data must be valid
*
* @param string $token
* @param string $shippingMethodCode
* @return Mage_Sales_Model_Order
*/
public function placeOrder($token, $shippingMethodCode = null)
{
if ($shippingMethodCode) {
$this->updateShippingMethod($shippingMethodCode);
}
if (!$this->_quote->getCustomerId()) {
$this->_quote->setCustomerIsGuest(true)->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID)->setCustomerEmail($this->_quote->getBillingAddress()->getEmail());
}
$this->_ignoreAddressValidation();
$order = Mage::getModel('sales/service_quote', $this->_quote)->submit();
$this->_quote->save();
// commence redirecting to finish payment, if paypal requires it
if ($order->getPayment()->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_REDIRECT)) {
$this->_redirectUrl = $this->_config->getExpressCheckoutCompleteUrl($token);
}
switch ($order->getState()) {
// even after placement paypal can disallow to authorize/capture, but will wait until bank transfers money
case Mage_Sales_Model_Order::STATE_PENDING_PAYMENT:
// TODO
break;
// regular placement, when everything is ok
// regular placement, when everything is ok
case Mage_Sales_Model_Order::STATE_PROCESSING:
case Mage_Sales_Model_Order::STATE_COMPLETE:
$order->sendNewOrderEmail();
break;
}
return $order;
}
示例2: place
/**
* Place the order and recurring payment profiles when customer returned from paypal
* Until this moment all quote data must be valid
*
* @param string $token
* @param string $shippingMethodCode
*/
public function place($token, $shippingMethodCode = null)
{
if ($shippingMethodCode) {
$this->updateShippingMethod($shippingMethodCode);
}
$isNewCustomer = false;
switch ($this->getCheckoutMethod()) {
case Mage_Checkout_Model_Type_Onepage::METHOD_GUEST:
$this->_prepareGuestQuote();
break;
case Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER:
$this->_prepareNewCustomerQuote();
$isNewCustomer = true;
break;
default:
$this->_prepareCustomerQuote();
break;
}
$this->_ignoreAddressValidation();
$this->_quote->collectTotals();
$parameters = array('quote' => $this->_quote);
$service = Mage::getModel('Mage_Sales_Model_Service_Quote', $parameters);
$service->submitAll();
$this->_quote->save();
if ($isNewCustomer) {
try {
$this->_involveNewCustomer();
} catch (Exception $e) {
Mage::logException($e);
}
}
$this->_recurringPaymentProfiles = $service->getRecurringPaymentProfiles();
// TODO: send recurring profile emails
$order = $service->getOrder();
if (!$order) {
return;
}
$this->_billingAgreement = $order->getPayment()->getBillingAgreement();
// commence redirecting to finish payment, if paypal requires it
if ($order->getPayment()->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_REDIRECT)) {
$this->_redirectUrl = $this->_config->getExpressCheckoutCompleteUrl($token);
}
switch ($order->getState()) {
// even after placement paypal can disallow to authorize/capture, but will wait until bank transfers money
case Mage_Sales_Model_Order::STATE_PENDING_PAYMENT:
// TODO
break;
// regular placement, when everything is ok
// regular placement, when everything is ok
// regular placement, when everything is ok
// regular placement, when everything is ok
case Mage_Sales_Model_Order::STATE_PROCESSING:
case Mage_Sales_Model_Order::STATE_COMPLETE:
case Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW:
$order->sendNewOrderEmail();
break;
}
$this->_order = $order;
}