Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Data Fields | |
const | PAL_CACHE_ID = 'paypal_express_checkout_pal' |
const | PAYMENT_INFO_TRANSPORT_TOKEN = 'paypal_express_checkout_token' |
const | PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDDEN = 'paypal_express_checkout_shipping_overridden' |
const | PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD = 'paypal_express_checkout_shipping_method' |
const | PAYMENT_INFO_TRANSPORT_PAYER_ID = 'paypal_express_checkout_payer_id' |
const | PAYMENT_INFO_TRANSPORT_REDIRECT = 'paypal_express_checkout_redirect_required' |
const | PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT = 'paypal_ec_create_ba' |
const | PAYMENT_INFO_BUTTON = 'button' |
Protected Member Functions | |
_setExportedAddressData ($address, $exportedAddress) | |
_setBillingAgreementRequest () | |
_getApi () | |
_prepareShippingOptions (Address $address, $mayReturnEmpty=false, $calculateTax=false) | |
_matchShippingMethodCode (Address $address, $selectedCode) | |
_setRedirectUrl ($button, $token) | |
prepareGuestQuote () | |
Static Protected Member Functions | |
static | cmpShippingOptions (DataObject $option1, DataObject $option2) |
Protected Attributes | |
$_quote | |
$_config | |
$_api | |
$_apiType = \Magento\Paypal\Model\Api\Nvp::class | |
$_methodType = PaypalConfig::METHOD_WPP_EXPRESS | |
$_redirectUrl = '' | |
$_pendingPaymentMessage = '' | |
$_checkoutRedirectUrl = '' | |
$_customerSession | |
$_giropayUrls = [] | |
$_isBARequested = false | |
$_isBml = false | |
$_customerId | |
$_billingAgreement | |
$_order | |
$_configCacheType | |
$_checkoutData | |
$_taxData | |
$_customerUrl | |
$_logger | |
$_localeResolver | |
$_paypalInfo | |
$_storeManager | |
$_coreUrl | |
$_cartFactory | |
$_checkoutOnepageFactory | |
$_agreementFactory | |
$_apiTypeFactory | |
$_objectCopyService | |
$_checkoutSession | |
$_customerRepository | |
$_accountManagement | |
$_encryptor | |
$_messageManager | |
$orderSender | |
$quoteRepository | |
$quoteManagement | |
$totalsCollector | |
Wrapper that performs Paypal Express and Checkout communication
@SuppressWarnings(PHPMD.TooManyFields) @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 25 of file Checkout.php.
\Psr\Log\LoggerInterface | $logger | |
\Magento\Customer\Model\Url | $customerUrl | |
\Magento\Tax\Helper\Data | $taxData | |
\Magento\Checkout\Helper\Data | $checkoutData | |
\Magento\Customer\Model\Session | $customerSession | |
\Magento\Framework\App\Cache\Type\Config | $configCacheType | |
\Magento\Framework\Locale\ResolverInterface | $localeResolver | |
\Magento\Paypal\Model\Info | $paypalInfo | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Magento\Framework\UrlInterface | $coreUrl | |
\Magento\Paypal\Model\CartFactory | $cartFactory | |
\Magento\Checkout\Model\Type\OnepageFactory | $onepageFactory | |
\Magento\Quote\Api\CartManagementInterface | $quoteManagement | |
\Magento\Paypal\Model\Billing\AgreementFactory | $agreementFactory | |
\Magento\Paypal\Model\Api\Type\Factory | $apiTypeFactory | |
DataObject\Copy | $objectCopyService | |
\Magento\Checkout\Model\Session | $checkoutSession | |
\Magento\Framework\Encryption\EncryptorInterface | $encryptor | |
\Magento\Framework\Message\ManagerInterface | $messageManager | |
\Magento\Customer\Api\CustomerRepositoryInterface | $customerRepository | |
AccountManagement | $accountManagement | |
OrderSender | $orderSender | |
\Magento\Quote\Api\CartRepositoryInterface | $quoteRepository | |
\Magento\Quote\Model\Quote\TotalsCollector | $totalsCollector | |
array | $params |
Definition at line 303 of file Checkout.php.
|
protected |
|
protected |
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
Address | $address | |
string | $selectedCode |
Definition at line 1076 of file Checkout.php.
|
protected |
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 and if there are shipping rates obtained, the method must return one of them as default.
Address | $address | |
bool | $mayReturnEmpty | |
bool | $calculateTax |
Definition at line 976 of file Checkout.php.
|
protected |
Set create billing agreement flag to api call
Definition at line 928 of file Checkout.php.
|
protected |
Sets address data from exported address
Address | $address | |
array | $exportedAddress |
Definition at line 913 of file Checkout.php.
|
protected |
Create payment redirect url
bool | null | $button | |
string | $token |
Definition at line 1098 of file Checkout.php.
canSkipOrderReviewStep | ( | ) |
Check whether system can skip order review page before placing order
Definition at line 596 of file Checkout.php.
|
staticprotected |
Compare two shipping options based on their amounts
This function is used as a callback comparison function in shipping options sorting process
\Magento\Framework\DataObject | $option1 | |
\Magento\Framework\DataObject | $option2 |
Definition at line 1057 of file Checkout.php.
getBillingAgreement | ( | ) |
Get created billing agreement
Definition at line 871 of file Checkout.php.
getCheckoutMethod | ( | ) |
Get checkout method
Definition at line 891 of file Checkout.php.
getCheckoutShortcutImageUrl | ( | ) |
Checkout with PayPal image URL getter
Spares API calls of getting "pal" variable, by putting it into cache per store view
Definition at line 376 of file Checkout.php.
getCustomerSession | ( | ) |
Get customer session object
Definition at line 1110 of file Checkout.php.
getOrder | ( | ) |
getRedirectUrl | ( | ) |
Determine whether redirect somewhere specifically is required
Definition at line 861 of file Checkout.php.
getShippingOptionsCallbackResponse | ( | array | $request | ) |
Return callback response with shipping options
array | $request |
Definition at line 726 of file Checkout.php.
place | ( | $token, | |
$shippingMethodCode = null |
|||
) |
Place the order when customer returned from PayPal until this moment all quote data must be valid.
string | $token | |
string | null | $shippingMethodCode |
Definition at line 791 of file Checkout.php.
prepareGiropayUrls | ( | $successUrl, | |
$cancelUrl, | |||
$pendingUrl | |||
) |
Setter that enables giropay redirects flow
string | $successUrl | - payment success result |
string | $cancelUrl | - payment cancellation result |
string | $pendingUrl | - pending payment result |
Definition at line 413 of file Checkout.php.
|
protected |
Prepare quote for guest checkout order submit
Definition at line 1152 of file Checkout.php.
prepareOrderReview | ( | $token = null | ) |
Check whether order review has enough data to initialize
string | null | $token |
Definition at line 702 of file Checkout.php.
returnFromPaypal | ( | $token | ) |
Update quote when returned from PayPal
Rewrite billing address by paypal, save old billing address for new customer, and export shipping address in case address absence
string | $token |
Definition at line 612 of file Checkout.php.
setCustomerData | ( | CustomerDataObject | $customerData | ) |
Setter for customer
CustomerDataObject | $customerData |
Definition at line 449 of file Checkout.php.
setCustomerWithAddressChange | ( | CustomerDataObject | $customerData, |
$billingAddress = null , |
|||
$shippingAddress = null |
|||
) |
Setter for customer with billing and shipping address changing ability
CustomerDataObject | $customerData | |
Address | null | $billingAddress | |
Address | null | $shippingAddress |
Definition at line 464 of file Checkout.php.
setIsBillingAgreementRequested | ( | $flag | ) |
Set create billing agreement flag
bool | $flag |
Definition at line 425 of file Checkout.php.
setIsBml | ( | $isBml | ) |
Set flag that forces to use BillMeLater
bool | $isBml |
Definition at line 437 of file Checkout.php.
updateShippingMethod | ( | $methodCode | ) |
Set shipping method to quote, if needed
string | $methodCode |
Definition at line 763 of file Checkout.php.
|
protected |
Definition at line 242 of file Checkout.php.
|
protected |
Definition at line 217 of file Checkout.php.
|
protected |
Definition at line 69 of file Checkout.php.
|
protected |
Definition at line 76 of file Checkout.php.
|
protected |
Definition at line 222 of file Checkout.php.
|
protected |
Definition at line 144 of file Checkout.php.
|
protected |
Definition at line 207 of file Checkout.php.
|
protected |
Definition at line 163 of file Checkout.php.
|
protected |
Definition at line 212 of file Checkout.php.
|
protected |
Definition at line 104 of file Checkout.php.
|
protected |
Definition at line 232 of file Checkout.php.
|
protected |
Definition at line 62 of file Checkout.php.
|
protected |
Definition at line 156 of file Checkout.php.
|
protected |
Definition at line 202 of file Checkout.php.
|
protected |
Definition at line 137 of file Checkout.php.
|
protected |
Definition at line 237 of file Checkout.php.
|
protected |
Definition at line 109 of file Checkout.php.
|
protected |
Definition at line 177 of file Checkout.php.
|
protected |
Definition at line 247 of file Checkout.php.
|
protected |
Definition at line 116 of file Checkout.php.
|
protected |
Definition at line 123 of file Checkout.php.
|
protected |
Definition at line 130 of file Checkout.php.
|
protected |
Definition at line 187 of file Checkout.php.
|
protected |
Definition at line 182 of file Checkout.php.
|
protected |
Definition at line 252 of file Checkout.php.
|
protected |
Definition at line 83 of file Checkout.php.
|
protected |
Definition at line 227 of file Checkout.php.
|
protected |
Definition at line 151 of file Checkout.php.
|
protected |
Definition at line 192 of file Checkout.php.
|
protected |
Definition at line 97 of file Checkout.php.
|
protected |
Definition at line 55 of file Checkout.php.
|
protected |
Definition at line 90 of file Checkout.php.
|
protected |
Definition at line 197 of file Checkout.php.
|
protected |
Definition at line 170 of file Checkout.php.
|
protected |
Definition at line 257 of file Checkout.php.
|
protected |
Definition at line 267 of file Checkout.php.
|
protected |
Definition at line 262 of file Checkout.php.
|
protected |
Definition at line 272 of file Checkout.php.
const PAL_CACHE_ID = 'paypal_express_checkout_pal' |
Definition at line 32 of file Checkout.php.
const PAYMENT_INFO_BUTTON = 'button' |
Definition at line 50 of file Checkout.php.
const PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT = 'paypal_ec_create_ba' |
Definition at line 43 of file Checkout.php.
const PAYMENT_INFO_TRANSPORT_PAYER_ID = 'paypal_express_checkout_payer_id' |
Definition at line 41 of file Checkout.php.
const PAYMENT_INFO_TRANSPORT_REDIRECT = 'paypal_express_checkout_redirect_required' |
Definition at line 42 of file Checkout.php.
const PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD = 'paypal_express_checkout_shipping_method' |
Definition at line 40 of file Checkout.php.
const PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDDEN = 'paypal_express_checkout_shipping_overridden' |
Definition at line 39 of file Checkout.php.
const PAYMENT_INFO_TRANSPORT_TOKEN = 'paypal_express_checkout_token' |
Keys for passthrough variables in sales/quote_payment and sales/order_payment Uses additional_information as storage
Definition at line 38 of file Checkout.php.