Class Mage_Paypal_Model_Express_Checkout

Description

Wrapper that performs Paypal Express and Checkout communication

Use current Paypal Express method instance

Located in /Paypal/Model/Express/Checkout.php (line 31)


	
			
Direct descendents
Class Description
Mage_PaypalUk_Model_Express_Checkout Wrapper that performs Paypal Express and Checkout communication
Class Constant Summary
PAL_CACHE_ID = 'paypal_express_checkout_pal'
PAYMENT_INFO_TRANSPORT_PAYER_ID = 'paypal_express_checkout_payer_id'
PAYMENT_INFO_TRANSPORT_REDIRECT = 'paypal_express_checkout_redirect_required'
PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD = 'paypal_express_checkout_shipping_method'
PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDEN = 'paypal_express_checkout_shipping_overriden'
PAYMENT_INFO_TRANSPORT_TOKEN = 'paypal_express_checkout_token'
Variable Summary
Method Summary
static integer cmpShippingOptions ( $option1,  $option2)
string getRedirectUrl (string $action)
Mage_Paypal_Model_Express_Checkout __construct ([array $params = array()])
void place (string $token, [string $shippingMethodCode = null])
void prepareGiropayUrls (string $successUrl, string $cancelUrl, string $pendingUrl)
void prepareOrderReview ([$token $token = null])
void returnFromPaypal (string $token)
string start ( $returnUrl,  $cancelUrl)
void updateShippingMethod (string $methodCode)
string _matchShippingMethodCode ( $address, string $selectedCode)
array|false _prepareShippingOptions ( $address, [bool $mayReturnEmpty = false])
Variables
Mage_Paypal_Model_Api_Nvp $_api = null (line 66)

API instance

  • access: protected
string $_apiType = 'paypal/api_nvp' (line 73)

Api Model Type

  • access: protected

Redefined in descendants as:
Mage_Sales_Model_Billing_Agreement $_billingAgreement = null (line 123)

Billing agreement that might be created during order placing

  • access: protected
mixed $_checkoutRedirectUrl = '' (line 88)
  • access: protected
Mage_Paypal_Model_Config $_config = null (line 60)

Config instance

  • access: protected
int $_customerId = null (line 109)

Customer ID

  • access: protected
array $_giropayUrls = array() (line 95)

Redirect urls supposed to be set to support giropay

  • access: protected
bool $_isBARequested = false (line 102)

Create Billing Agreement flag

  • access: protected
unknown_type $_methodType = Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS (line 80)

Payment method type

  • access: protected

Redefined in descendants as:
Mage_Sales_Model_QuoteMage_Sales_Model_Quote $_order = null (line 130)

Order

  • access: protected
mixed $_pendingPaymentMessage = '' (line 87)
  • access: protected
Mage_Sales_Model_Quote $_quote = null (line 54)
  • access: protected
array $_recurringPaymentProfiles = array() (line 116)

Recurring payment profiles

  • access: protected
string $_redirectUrl = '' (line 86)

State helper variables

  • access: protected
Methods
static method cmpShippingOptions (line 683)

Compare two shipping options based on their amounts

This function is used as a callback comparison function in shipping options sorting process

  • see: self::_prepareShippingOptions()
  • access: protected
static integer cmpShippingOptions ( $option1,  $option2)
  • Varien_Object $option1
  • Varien_Object $option2
getBillingAgreement (line 559)

Get created billing agreement

  • access: public
Mage_Sales_Model_Billing_Agreement|null getBillingAgreement ()
getCheckoutShortcutImageUrl (line 155)

Checkout with PayPal image URL getter

Spares API calls of getting "pal" variable, by putting it into cache per store view

  • access: public
string getCheckoutShortcutImageUrl ()
getOrder (line 569)

Return order

  • access: public
getRecurringPaymentProfiles (line 549)

Return recurring payment profiles

  • access: public
array getRecurringPaymentProfiles ()
getRedirectUrl (line 539)

Determine whether redirect somewhere specifically is required

  • access: public
string getRedirectUrl (string $action)
  • string $action
getShippingOptionsCallbackResponse (line 421)

Return callback response with shipping options

  • access: public
string getShippingOptionsCallbackResponse ( $request)
  • array $request
Constructor __construct (line 136)

Set quote and config instances

  • access: public
Mage_Paypal_Model_Express_Checkout __construct ([array $params = array()])
  • array $params
place (line 476)

Place the order and recurring payment profiles when customer returned from paypal Until this moment all quote data must be valid

  • access: public
void place (string $token, [string $shippingMethodCode = null])
  • string $token
  • string $shippingMethodCode
prepareGiropayUrls (line 192)

Setter that enables giropay redirects flow

  • access: public
void prepareGiropayUrls (string $successUrl, string $cancelUrl, string $pendingUrl)
  • string $successUrl: - payment success result
  • string $cancelUrl:
    • payment cancellation result
  • string $pendingUrl: - pending payment result
prepareOrderReview (line 399)

Check whether order review has enough data to initialize

  • throws: Mage_Core_Exception
  • access: public
void prepareOrderReview ([$token $token = null])
  • $token $token
returnFromPaypal (line 345)

Update quote when returned from PayPal

  • access: public
void returnFromPaypal (string $token)
  • string $token
setCustomer (line 229)

Setter for customer

  • access: public
setCustomerId (line 217)

Setter for customer Id

  • deprecated: please use self::setCustomer
  • access: public
Mage_Paypal_Model_Express_Checkout setCustomerId (int $id)
  • int $id
setCustomerWithAddressChange (line 244)

Setter for customer with billing and shipping address changing ability

  • access: public
Mage_Paypal_Model_Express_Checkout setCustomerWithAddressChange (Mage_Customer_Model_Customer $customer, [Mage_Sales_Model_Quote_Address $billingAddress = null], [Mage_Sales_Model_Quote_Address $shippingAddress = null])
setIsBillingAgreementRequested (line 204)

Set create billing agreement flag

  • access: public
Mage_Paypal_Model_Express_Checkout setIsBillingAgreementRequested (bool $flag)
  • bool $flag
start (line 255)

Reserve order ID for specified quote and start checkout on PayPal

  • access: public
string start ( $returnUrl,  $cancelUrl)
  • $returnUrl
  • $cancelUrl
updateShippingMethod (line 458)

Set shipping method to quote, if needed

  • access: public
void updateShippingMethod (string $methodCode)
  • string $methodCode
_getApi (line 603)
  • access: protected
_matchShippingMethodCode (line 701)

Try to find whether the code provided by PayPal corresponds to any of possible shipping rates This method was created only because PayPal has issues with returning the selected code.

If in future the issue is fixed, we don't need to attempt to match it. It would be enough to set the method code before collecting shipping rates

  • access: protected
string _matchShippingMethodCode ( $address, string $selectedCode)
_prepareShippingOptions (line 620)

Attempt to collect address shipping rates and return them for further usage in instant update API Returns empty array if it was impossible to obtain any shipping rate If there are shipping rates obtained, the method must return one of them as default.

  • access: protected
array|false _prepareShippingOptions ( $address, [bool $mayReturnEmpty = false])
_setBillingAgreementRequest (line 579)

Set create billing agreement flag to api call

  • access: protected
Mage_Paypal_Model_Express_Checkout _setBillingAgreementRequest ()
Class Constants
PAL_CACHE_ID = 'paypal_express_checkout_pal' (line 37)

Cache ID prefix for "pal" lookup

PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT = 'paypal_ec_create_ba' (line 49)
PAYMENT_INFO_TRANSPORT_PAYER_ID = 'paypal_express_checkout_payer_id' (line 47)
PAYMENT_INFO_TRANSPORT_REDIRECT = 'paypal_express_checkout_redirect_required' (line 48)
PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD = 'paypal_express_checkout_shipping_method' (line 46)
PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDEN = 'paypal_express_checkout_shipping_overriden' (line 45)
PAYMENT_INFO_TRANSPORT_TOKEN = 'paypal_express_checkout_token' (line 44)

Keys for passthrough variables in sales/quote_payment and sales/order_payment

Uses additional_information as storage

Documentation generated on Fri, 11 Feb 2011 16:57:44 +0200 by phpDocumentor 1.4.3