Post on 11-Mar-2016
description
PayPal Integration in Magento 0
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 1
PayPal Integration in Magento
1. What is new in 1.4.1
2. PayPal business logic overview
3. Application integration overview
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
3. Application integration overview
4. Debugging and troubleshooting
PayPal Integration in Magento 2
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
1. New PayPal Features in 1.4.1
PayPal Integration in Magento 3
Custom Configuration UI
• Configuration section with custom
interface
• Merchant country and account
selection
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
selection
• Dynamic selection of PayPal
solutions
• Various helper links, API wizard
popup
PayPal Integration in Magento 4
Custom Configuration UI
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 5
Customer Experience
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 6
Customer Experience
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 7
Customer Experience
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 8
Customer Experience
• Configurable logos and buttons
• Custom payment selection
• Cart line items transferring
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• Cart line items transferring
• EC shipping options transferring
PayPal Integration in Magento 9
Settlement Reports Fetching
• Multiple merchants report grid
• Fetching reports from admin
• Scheduled fetching
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• Scheduled fetching
PayPal Integration in Magento 10
Settlement Reports Fetching
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 11
Billing Agreements
• Billing agreement wizard for customers
• Billing agreement creation in EC
• Payment method on the frontend
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• Payment method on the frontend and admin
PayPal Integration in Magento 12
Billing Agreements
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 13
Billing Agreements
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 14
Recurring Profiles• Recurring profile option for simple
and virtual products
• Nominal items concept
• Checkout with recurring profiles
• Viewing and processing recurring
profiles
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
profiles
PayPal Integration in Magento 15
Recurring Profiles
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 16
Recurring Profiles
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 17
PayPal Recurring Profiles
• Recurring profiles creation in EC
• Improved IPN listener
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
http://magento.example.com/paypal/ipn/express/
http://magento.example.com/paypal/ipn/standard/
http://magento.example.com/paypal/ipn/direct/
http://magento.example.com/paypal/ipn/
PayPal Integration in Magento 18
Payment Review and FMF
• IPR integration
• FMF integration
• Unilateral payments
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• Unilateral payments
• New order state: Pending Review
PayPal Integration in Magento 19
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
2. PayPal Business Logic
PayPal Integration in Magento 20
Merchant and Buyer Countries
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
https://www.paypal.com/worldwide/
PayPal Integration in Magento 21
Country-Specific Features
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 22
Solution Dependencies
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 23
Solution Dependencies
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 24
Customer Experience Guidelines
• Hotlinking to PayPal content
• EC payment selection experience
• Shortcuts, solution logos on the
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
frontend
PayPal Integration in Magento 25
Settlement Reports
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 26
Billing Agreements
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 27
Payment Review
• PayPal IPR:
– Triggered automatically by PayPal
– Can be controlled from merchant account
only
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
only
• PayPal FMF:
– Managed by the merchant
– Can also be controlled from Magento
admin
PayPal Integration in Magento 28
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
3. Implementation in Magento
PayPal Integration in Magento 29
Controller Level
• Mage_Paypal_ExpressController
• Mage_Paypal_StandardController
• Mage_Paypal_IpnController
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• Mage_Paypal_IpnController• Mage_Paypal_Adminhtml_Paypal_ReportsController
PayPal Integration in Magento 30
Mage_Paypal_Model_Config
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 31
Payment Methods
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 32
Mage_Paypal_Model_Express_Checkout
• Requires config and quote instances
• Key methods:
– start()
– getShippingOptionsCallbackResponse()
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
– getShippingOptionsCallbackResponse()
– returnFromPaypal()
– updateShippingMethod()
– place()
• Invoked by EC controller
• Invokes API, Pro, sales order/quote payments
PayPal Integration in Magento 33
Mage_Paypal_Model_Ipn
• POST back, validate request
• Identify and validate order
• Process the payment notification: a bit
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• Process the payment notification: a bit of imperative role
• Debugging and logging
PayPal Integration in Magento 34
“Knowledge” Models
• Mage_Paypal_Model_Cart: transforms Magento sales entity into a PayPal-valid shopping cart with totals
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
shopping cart with totals
• Mage_Paypal_Model_Info:
– Mapping payment info fields, advanced
payment state determination
– Reference information: codes, labels
PayPal Integration in Magento 35
API Models
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• NVP models – Website Payments Pro implementation through HTTP-API
• WPS model – not actually an API, just composes an order placement request form variables
PayPal Integration in Magento 36
Settlement Report Models
• Mage_Paypal_Model_Report_Settlement
– Entity model
– Fetching and parsing reports
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
– Report parameter labels
• Mage_Paypal_Model_Report_Settlement_Row
– Also an entity model
– Event labels
– Casting amounts
PayPal Integration in Magento 37
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
4. Debugging and Maintaining
PayPal Integration in Magento 38
Debugging PayPal Methods
• No more logging to database!
• var/log/payment_<code>.log
• sensitive information is omitted from log
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• sensitive information is omitted from log
• send “correlation ID” to MTS
PayPal Integration in Magento 39
IPN Debug
• Significant order processing events –to the order comments
• var/log/payment_<code>.log
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• var/log/payment_<code>.log
• var/log/paypal_ipn_unknown.log
• PayPal > History > IPN History
PayPal Integration in Magento 40
Express Checkout
Known Issues
• No billing address transferring back
• Shipping options with no address yet
• Line items with crazy taxes/discounts
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• Line items with crazy taxes/discounts
PayPal Integration in Magento 41
Recurring Payment and Billing
Agreement Known Issues
• Status unsynchronization
• RP relies on IPN only
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
• Not yet full integration of RP
PayPal Integration in Magento 42
Payflow Pro and FPS
• Merchant will stuck with order processing ☺
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
PayPal Integration in Magento 43
Questions?
anton@magento.com
10441 Jefferson Blvd. Suite 200, Culver City, CA 90232 | Magento.com
anton@magento.com
Twitter: antonmakarenko