SlideShare a Scribd company logo
1 of 44
© 2016 Magento, Inc. Page | 1
Magento Payment &
Vault
Framework
© 2016 Magento, Inc. Page | 2
Software Engineer at Magento
Ievgen Sentiabov
© 2016 Magento, Inc. Page | 3
Checkout
© 2016 Magento, Inc. Page | 4
Lifecycle
Add product to
the shopping
cart
Specify
shipping
address
Select shipping
carrier
Select payment
method
Order creationAll are happy
© 2016 Magento, Inc. Page | 5
Select shipping address
© 2016 Magento, Inc. Page | 6
Payment form
© 2016 Magento, Inc. Page | 7
PCI compliance
• HTTPS
• Encryption
• Do not store credit cards
© 2016 Magento, Inc. Page | 8
Order confirmation
© 2016 Magento, Inc. Page | 9
Payment Integrations
© 2016 Magento, Inc. Page | 10
Type of integrations
• Redirect to Payment Provider
• Hosted Page
• Transparent Redirect
© 2016 Magento, Inc. Page | 11
Redirect to Payment Provider
• PayPal Express Checkout
• eWAY Responsive Shared Page
• WorldPay HTML Redirect
Select payment
method
Redirect to
Payment
Provider
Return to the
store
Order creation
© 2016 Magento, Inc. Page | 12
Hosted Page
• Braintree Hosted Fields
• PayPal Payments Advanced
• PayPal Payflow Link
• PayPal WPPHS
• eWAY iframe
• Authorize.net Direct Post
Select payment
method
Pay in “iframe” Order creation
© 2016 Magento, Inc. Page | 13
Transparent Redirect
• PayPal Payflow Pro
• CyberSource Secure Acceptance
Select payment
method
Pay in store Order creation
© 2016 Magento, Inc. Page | 14
"+" "-"
Transparent Redirect More UI customization Less secure
More development
Redirect to Payment
Provider
Pay on trusted gateway
Easy for integration
Leave store to pay
Hosted Page All data in iframe Less UI customization
More difficulties with
additional features like
3D Secure
© 2016 Magento, Inc. Page | 15
How it works
© 2016 Magento, Inc. Page | 16
© 2016 Magento, Inc. Page | 17
Payment Provider
Gateway
© 2016 Magento, Inc. Page | 18
Evolution of integrations
© 2016 Magento, Inc. Page | 19
Evolution of integrations
• Inherits AbstractMethod • Configures Adapter via virtual
types
• Overrides via children
• methods
• Configuration via xml
• Inheritance • Composition
• Code duplication • Components
© 2016 Magento, Inc. Page | 20
Payment Gateway interaction
© 2016 Magento, Inc. Page | 21
Components
• Command Pool
• Gateway Command (authorization, invoicing)
• Request Builder
• Http/Soap/SDK Client
• Response Validator
• Response Handler
© 2016 Magento, Inc. Page | 22
Command Pool
© 2016 Magento, Inc. Page | 23
How to build request
• Extends
common BuilderComposite
• Builders implement
BuilderInterface
• Composite can contain other
composites
© 2016 Magento, Inc. Page | 24
Customer Builder
Payment Builder
Address Builder
array (
'request' => array (
'customer' => array (
'firstName' => 'John',
'lastName' => 'Doe',
'phone' => '444-44-444-44',
'email' => 'john.doe@magento.com',
),
'amount' => '18.00',
'paymentMethodNonce' => '16069c7e53066',
'orderId' => '000000006',
'billing' => array (
'streetAddress' => 'Somewhere under palm tree',
'locality' => 'Paradize City',
'region' => 'CA',
'postalCode' => '90230',
'countryCodeAlpha2' => 'US',
),
'shipping' => array (
'streetAddress' => 'Somewhere under palm tree',
'locality' => 'Paradize City',
'region' => 'CA',
'postalCode' => '90230',
'countryCodeAlpha2' => 'US',
),
),
);
© 2016 Magento, Inc. Page | 25
Request client
• Implementation of
MagentoPaymentGatewayHttpTransferFactoryInterface
• Client implements
• MagentoPaymentGatewayHttpClientInterface
© 2016 Magento, Inc. Page | 26
Validation
• Extends common ValidatorComposite
• A validator implements ValidatorInteface
public function validate(array $validationSubject);
• The validator should return implementation of ResultInterface
© 2016 Magento, Inc. Page | 27
Response handlers
• Handler implements
HandlerInterface
• List of handler and
extends HandlerChain
© 2016 Magento, Inc. Page | 28
Command
Combine all components for payment integrations
© 2016 Magento, Inc. Page | 29
Gateway
Command
Transfer
Factory
Request
Client
Payment
Processor
Validator Composite
Request Builder
Handler Chain
Handlers
execute subject request
request
requestresponse
response
Validators
Builders
© 2016 Magento, Inc. Page | 30
© 2016 Magento, Inc. Page | 31
Vault integration
© 2016 Magento, Inc. Page | 32
© 2016 Magento, Inc. Page | 33
Vault as part of payment integration
© 2016 Magento, Inc. Page | 34
Features
• Tokenized credit cards
• Does not require additional infrastructure
• Uses existing payment integration
• Adaptation for new requirements
• Testable code
© 2016 Magento, Inc. Page | 35
Common steps
1. Vault facade for existing payment integration
2. Handlers to store payment token
3. Vault commands (authorize, sale, etc.)
4. Providers to work with stored tokens
© 2016 Magento, Inc. Page | 36
How to store Payment Token
• Use one of available factories -> PaymentTokenInterfaceFactory
• Last 4 numbers
• Expiration date
• Credit card type
• Client details
Credit Card Account
© 2016 Magento, Inc. Page | 37
• Payment token creation
$paymentToken = $this->paymentTokenFactory->create();
$paymentToken->setGatewayToken($token);
$paymentToken->setTokenDetails(json_encode([
'type' => $transaction->cardDetails->cardType,
'maskedCC' => $transaction->cardDetails->last4,
'expirationDate' => $transaction->cardDetails->expirationDate
]));
© 2016 Magento, Inc. Page | 38
• Store payment token in Extension Attributes
$extAttrs = $payment->getExtensionAttributes();
$extAttrs->setVaultPaymentToken($paymentToken);
© 2016 Magento, Inc. Page | 39
© 2016 Magento, Inc. Page | 40
Display on Checkout Page
• Implementation of TokenUiComponentProviderInterface provider:
- Specify UI component for rendering
- Transmit data from Payment Token
• Add new provider to list of Vault providers components
<type name="MagentoVaultModelUiTokensConfigProvider">
<arguments>
<argument name="tokenUiComponentProviders" xsi:type="array">
<item name="sample" xsi:type="object">
SampleModelUiTokenUiComponentProvider
</item>
</argument>
</arguments>
</type>
© 2016 Magento, Inc. Page | 41
© 2016 Magento, Inc. Page | 42
Display in the customer profile
• Implement one of renderers: CardRendererInterface or
TokenRendererInterface
• Add to layout
<referenceContainer name="content">
<referenceBlock name="vault.cards.list">
<block class="MagentoSampleBlockCustomerCardRenderer" name="sample.car
d.renderer" template="Magento_Vault::customer_account/credit_card.phtml"/>
</referenceBlock>
</referenceContainer>
© 2016 Magento, Inc. Page | 43
Summary
• Different payment integrations can use the same
components
• Adaptation for new requirements
• Do not need to store credit cards
• Payment tokens more secure
© 2016 Magento, Inc. Page | 44
Useful links
http://devdocs.magento.com/guides/v2.1/payments-integrations/bk-payments-
integrations.html - How to add payment integration
https://github.com/magento/magento2-samples/tree/master/sample-module-
payment-gateway - Sample Payment Gateway
http://devdocs.magento.com/guides/v2.1/howdoi/checkout/checkout_pa
yment.html - Add payment method to the Checkout Page
http://www.slideshare.net/elogic_commerce/payment-integration-
patterns-magento2 - Types of payment integrations
https://plugins.jetbrains.com/plugin/8024 - Magento 2 PHPStorm Plugin

More Related Content

What's hot

Writing RESTful web services using Node.js
Writing RESTful web services using Node.jsWriting RESTful web services using Node.js
Writing RESTful web services using Node.jsFDConf
 
Domain Modeling Made Functional (KanDDDinsky 2019)
Domain Modeling Made Functional (KanDDDinsky 2019)Domain Modeling Made Functional (KanDDDinsky 2019)
Domain Modeling Made Functional (KanDDDinsky 2019)Scott Wlaschin
 
Building better security for your API platform using Azure API Management
Building better security for your API platform using Azure API ManagementBuilding better security for your API platform using Azure API Management
Building better security for your API platform using Azure API ManagementEldert Grootenboer
 
Abstract Factory Design Pattern
Abstract Factory Design PatternAbstract Factory Design Pattern
Abstract Factory Design PatternBharat Khatri
 
ASP.NET Developer Roadmap 2021
ASP.NET Developer Roadmap 2021ASP.NET Developer Roadmap 2021
ASP.NET Developer Roadmap 2021Ronak Sankhala
 
Workshop Microservices - Construindo APIs RESTful com Spring Boot
Workshop Microservices - Construindo APIs RESTful com Spring BootWorkshop Microservices - Construindo APIs RESTful com Spring Boot
Workshop Microservices - Construindo APIs RESTful com Spring BootRodrigo Cândido da Silva
 
From framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvFrom framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvCodelyTV
 
Bloc for Pharo: Current State and Future Perspective
Bloc for Pharo: Current State and Future PerspectiveBloc for Pharo: Current State and Future Perspective
Bloc for Pharo: Current State and Future PerspectiveESUG
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code firstConfiz
 
Implementing security requirements for banking API system using Open Source ...
 Implementing security requirements for banking API system using Open Source ... Implementing security requirements for banking API system using Open Source ...
Implementing security requirements for banking API system using Open Source ...Yuichi Nakamura
 
Magento 2 Database Tables, Schema, Main tables for main features of Magento 2...
Magento 2 Database Tables, Schema, Main tables for main features of Magento 2...Magento 2 Database Tables, Schema, Main tables for main features of Magento 2...
Magento 2 Database Tables, Schema, Main tables for main features of Magento 2...gideonvbabu
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design PatternsLilia Sfaxi
 
What is APIGEE? What are the benefits of APIGEE?
What is APIGEE? What are the benefits of APIGEE?What is APIGEE? What are the benefits of APIGEE?
What is APIGEE? What are the benefits of APIGEE?IQ Online Training
 
RonDB, a NewSQL Feature Store for AI applications.pdf
RonDB, a NewSQL Feature Store for AI applications.pdfRonDB, a NewSQL Feature Store for AI applications.pdf
RonDB, a NewSQL Feature Store for AI applications.pdfmikael329498
 
Implement API Gateway using Azure API Management
Implement API Gateway using Azure API ManagementImplement API Gateway using Azure API Management
Implement API Gateway using Azure API ManagementAlexander Laysha
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentAbid Malik
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 

What's hot (20)

Writing RESTful web services using Node.js
Writing RESTful web services using Node.jsWriting RESTful web services using Node.js
Writing RESTful web services using Node.js
 
Domain Modeling Made Functional (KanDDDinsky 2019)
Domain Modeling Made Functional (KanDDDinsky 2019)Domain Modeling Made Functional (KanDDDinsky 2019)
Domain Modeling Made Functional (KanDDDinsky 2019)
 
Building better security for your API platform using Azure API Management
Building better security for your API platform using Azure API ManagementBuilding better security for your API platform using Azure API Management
Building better security for your API platform using Azure API Management
 
Abstract Factory Design Pattern
Abstract Factory Design PatternAbstract Factory Design Pattern
Abstract Factory Design Pattern
 
ASP.NET Developer Roadmap 2021
ASP.NET Developer Roadmap 2021ASP.NET Developer Roadmap 2021
ASP.NET Developer Roadmap 2021
 
Workshop Microservices - Construindo APIs RESTful com Spring Boot
Workshop Microservices - Construindo APIs RESTful com Spring BootWorkshop Microservices - Construindo APIs RESTful com Spring Boot
Workshop Microservices - Construindo APIs RESTful com Spring Boot
 
Dot net syllabus book
Dot net syllabus bookDot net syllabus book
Dot net syllabus book
 
From framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytvFrom framework coupled code to #microservices through #DDD /by @codelytv
From framework coupled code to #microservices through #DDD /by @codelytv
 
Bloc for Pharo: Current State and Future Perspective
Bloc for Pharo: Current State and Future PerspectiveBloc for Pharo: Current State and Future Perspective
Bloc for Pharo: Current State and Future Perspective
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
 
Implementing security requirements for banking API system using Open Source ...
 Implementing security requirements for banking API system using Open Source ... Implementing security requirements for banking API system using Open Source ...
Implementing security requirements for banking API system using Open Source ...
 
Magento 2 Database Tables, Schema, Main tables for main features of Magento 2...
Magento 2 Database Tables, Schema, Main tables for main features of Magento 2...Magento 2 Database Tables, Schema, Main tables for main features of Magento 2...
Magento 2 Database Tables, Schema, Main tables for main features of Magento 2...
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Attacking REST API
Attacking REST APIAttacking REST API
Attacking REST API
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
What is APIGEE? What are the benefits of APIGEE?
What is APIGEE? What are the benefits of APIGEE?What is APIGEE? What are the benefits of APIGEE?
What is APIGEE? What are the benefits of APIGEE?
 
RonDB, a NewSQL Feature Store for AI applications.pdf
RonDB, a NewSQL Feature Store for AI applications.pdfRonDB, a NewSQL Feature Store for AI applications.pdf
RonDB, a NewSQL Feature Store for AI applications.pdf
 
Implement API Gateway using Azure API Management
Implement API Gateway using Azure API ManagementImplement API Gateway using Azure API Management
Implement API Gateway using Azure API Management
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 

Similar to Magento Payment & Vault framework

How to implement payment gateway integration for non-credit card on Magento2
How to implement payment gateway integration for non-credit card on Magento2How to implement payment gateway integration for non-credit card on Magento2
How to implement payment gateway integration for non-credit card on Magento2Hirokazu Nishi
 
Safex pay wl-pg-presentation
Safex pay wl-pg-presentationSafex pay wl-pg-presentation
Safex pay wl-pg-presentationNeha Sahay
 
Payment gateway
Payment gatewayPayment gateway
Payment gatewayHananBahy
 
Presentation safex pay
Presentation safex payPresentation safex pay
Presentation safex payvinay soni
 
Introducing safex pay 2018
Introducing safex pay 2018Introducing safex pay 2018
Introducing safex pay 2018Neha Sahay
 
Presentation safex pay
Presentation safex payPresentation safex pay
Presentation safex payJyotiBisht23
 
Safex pay avantgarde -presentation
Safex pay avantgarde -presentationSafex pay avantgarde -presentation
Safex pay avantgarde -presentationNeha Sahay
 
Safex pay avantgarde -presentation
Safex pay avantgarde -presentationSafex pay avantgarde -presentation
Safex pay avantgarde -presentationNeha Sahay
 
Get Paid presentation_20190123
Get Paid presentation_20190123Get Paid presentation_20190123
Get Paid presentation_20190123Peter Walker
 
Authorize Net CIM Magento 2 Extension by MageDelight
Authorize Net CIM Magento 2 Extension by MageDelightAuthorize Net CIM Magento 2 Extension by MageDelight
Authorize Net CIM Magento 2 Extension by MageDelightMageDelight
 
Safex pay avantgarde -presentation
Safex pay avantgarde -presentationSafex pay avantgarde -presentation
Safex pay avantgarde -presentationParvezKhan173
 
Ccavenue presentation
Ccavenue presentationCcavenue presentation
Ccavenue presentationAnurag Vikram
 
Magento 2 CBK T-Pay
Magento 2 CBK T-PayMagento 2 CBK T-Pay
Magento 2 CBK T-PayMeetanshi
 
Why Payment gateway integration is important.pdf
Why Payment gateway integration is important.pdfWhy Payment gateway integration is important.pdf
Why Payment gateway integration is important.pdfIntegrated IT Solutions
 
07 factors to consider while choosing an ecommerce payment gateway
07 factors to consider while choosing an ecommerce payment gateway07 factors to consider while choosing an ecommerce payment gateway
07 factors to consider while choosing an ecommerce payment gatewaySnehaDas60
 

Similar to Magento Payment & Vault framework (20)

How to implement payment gateway integration for non-credit card on Magento2
How to implement payment gateway integration for non-credit card on Magento2How to implement payment gateway integration for non-credit card on Magento2
How to implement payment gateway integration for non-credit card on Magento2
 
Safex pay wl-pg-presentation
Safex pay wl-pg-presentationSafex pay wl-pg-presentation
Safex pay wl-pg-presentation
 
Payment gateway
Payment gatewayPayment gateway
Payment gateway
 
Show me the money
Show me the moneyShow me the money
Show me the money
 
Presentation safex pay
Presentation safex payPresentation safex pay
Presentation safex pay
 
Introducing safex pay 2018
Introducing safex pay 2018Introducing safex pay 2018
Introducing safex pay 2018
 
Presentation safex pay
Presentation safex payPresentation safex pay
Presentation safex pay
 
Payment integration patterns в Magento2
Payment integration patterns в Magento2Payment integration patterns в Magento2
Payment integration patterns в Magento2
 
Safex pay avantgarde -presentation
Safex pay avantgarde -presentationSafex pay avantgarde -presentation
Safex pay avantgarde -presentation
 
Safex pay avantgarde -presentation
Safex pay avantgarde -presentationSafex pay avantgarde -presentation
Safex pay avantgarde -presentation
 
Magento
MagentoMagento
Magento
 
Magento
MagentoMagento
Magento
 
Get Paid presentation_20190123
Get Paid presentation_20190123Get Paid presentation_20190123
Get Paid presentation_20190123
 
Authorize Net CIM Magento 2 Extension by MageDelight
Authorize Net CIM Magento 2 Extension by MageDelightAuthorize Net CIM Magento 2 Extension by MageDelight
Authorize Net CIM Magento 2 Extension by MageDelight
 
Safex pay avantgarde -presentation
Safex pay avantgarde -presentationSafex pay avantgarde -presentation
Safex pay avantgarde -presentation
 
Ccavenue presentation
Ccavenue presentationCcavenue presentation
Ccavenue presentation
 
Magento 2 CBK T-Pay
Magento 2 CBK T-PayMagento 2 CBK T-Pay
Magento 2 CBK T-Pay
 
Payments
PaymentsPayments
Payments
 
Why Payment gateway integration is important.pdf
Why Payment gateway integration is important.pdfWhy Payment gateway integration is important.pdf
Why Payment gateway integration is important.pdf
 
07 factors to consider while choosing an ecommerce payment gateway
07 factors to consider while choosing an ecommerce payment gateway07 factors to consider while choosing an ecommerce payment gateway
07 factors to consider while choosing an ecommerce payment gateway
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Magento Payment & Vault framework

  • 1. © 2016 Magento, Inc. Page | 1 Magento Payment & Vault Framework
  • 2. © 2016 Magento, Inc. Page | 2 Software Engineer at Magento Ievgen Sentiabov
  • 3. © 2016 Magento, Inc. Page | 3 Checkout
  • 4. © 2016 Magento, Inc. Page | 4 Lifecycle Add product to the shopping cart Specify shipping address Select shipping carrier Select payment method Order creationAll are happy
  • 5. © 2016 Magento, Inc. Page | 5 Select shipping address
  • 6. © 2016 Magento, Inc. Page | 6 Payment form
  • 7. © 2016 Magento, Inc. Page | 7 PCI compliance • HTTPS • Encryption • Do not store credit cards
  • 8. © 2016 Magento, Inc. Page | 8 Order confirmation
  • 9. © 2016 Magento, Inc. Page | 9 Payment Integrations
  • 10. © 2016 Magento, Inc. Page | 10 Type of integrations • Redirect to Payment Provider • Hosted Page • Transparent Redirect
  • 11. © 2016 Magento, Inc. Page | 11 Redirect to Payment Provider • PayPal Express Checkout • eWAY Responsive Shared Page • WorldPay HTML Redirect Select payment method Redirect to Payment Provider Return to the store Order creation
  • 12. © 2016 Magento, Inc. Page | 12 Hosted Page • Braintree Hosted Fields • PayPal Payments Advanced • PayPal Payflow Link • PayPal WPPHS • eWAY iframe • Authorize.net Direct Post Select payment method Pay in “iframe” Order creation
  • 13. © 2016 Magento, Inc. Page | 13 Transparent Redirect • PayPal Payflow Pro • CyberSource Secure Acceptance Select payment method Pay in store Order creation
  • 14. © 2016 Magento, Inc. Page | 14 "+" "-" Transparent Redirect More UI customization Less secure More development Redirect to Payment Provider Pay on trusted gateway Easy for integration Leave store to pay Hosted Page All data in iframe Less UI customization More difficulties with additional features like 3D Secure
  • 15. © 2016 Magento, Inc. Page | 15 How it works
  • 16. © 2016 Magento, Inc. Page | 16
  • 17. © 2016 Magento, Inc. Page | 17 Payment Provider Gateway
  • 18. © 2016 Magento, Inc. Page | 18 Evolution of integrations
  • 19. © 2016 Magento, Inc. Page | 19 Evolution of integrations • Inherits AbstractMethod • Configures Adapter via virtual types • Overrides via children • methods • Configuration via xml • Inheritance • Composition • Code duplication • Components
  • 20. © 2016 Magento, Inc. Page | 20 Payment Gateway interaction
  • 21. © 2016 Magento, Inc. Page | 21 Components • Command Pool • Gateway Command (authorization, invoicing) • Request Builder • Http/Soap/SDK Client • Response Validator • Response Handler
  • 22. © 2016 Magento, Inc. Page | 22 Command Pool
  • 23. © 2016 Magento, Inc. Page | 23 How to build request • Extends common BuilderComposite • Builders implement BuilderInterface • Composite can contain other composites
  • 24. © 2016 Magento, Inc. Page | 24 Customer Builder Payment Builder Address Builder array ( 'request' => array ( 'customer' => array ( 'firstName' => 'John', 'lastName' => 'Doe', 'phone' => '444-44-444-44', 'email' => 'john.doe@magento.com', ), 'amount' => '18.00', 'paymentMethodNonce' => '16069c7e53066', 'orderId' => '000000006', 'billing' => array ( 'streetAddress' => 'Somewhere under palm tree', 'locality' => 'Paradize City', 'region' => 'CA', 'postalCode' => '90230', 'countryCodeAlpha2' => 'US', ), 'shipping' => array ( 'streetAddress' => 'Somewhere under palm tree', 'locality' => 'Paradize City', 'region' => 'CA', 'postalCode' => '90230', 'countryCodeAlpha2' => 'US', ), ), );
  • 25. © 2016 Magento, Inc. Page | 25 Request client • Implementation of MagentoPaymentGatewayHttpTransferFactoryInterface • Client implements • MagentoPaymentGatewayHttpClientInterface
  • 26. © 2016 Magento, Inc. Page | 26 Validation • Extends common ValidatorComposite • A validator implements ValidatorInteface public function validate(array $validationSubject); • The validator should return implementation of ResultInterface
  • 27. © 2016 Magento, Inc. Page | 27 Response handlers • Handler implements HandlerInterface • List of handler and extends HandlerChain
  • 28. © 2016 Magento, Inc. Page | 28 Command Combine all components for payment integrations
  • 29. © 2016 Magento, Inc. Page | 29 Gateway Command Transfer Factory Request Client Payment Processor Validator Composite Request Builder Handler Chain Handlers execute subject request request requestresponse response Validators Builders
  • 30. © 2016 Magento, Inc. Page | 30
  • 31. © 2016 Magento, Inc. Page | 31 Vault integration
  • 32. © 2016 Magento, Inc. Page | 32
  • 33. © 2016 Magento, Inc. Page | 33 Vault as part of payment integration
  • 34. © 2016 Magento, Inc. Page | 34 Features • Tokenized credit cards • Does not require additional infrastructure • Uses existing payment integration • Adaptation for new requirements • Testable code
  • 35. © 2016 Magento, Inc. Page | 35 Common steps 1. Vault facade for existing payment integration 2. Handlers to store payment token 3. Vault commands (authorize, sale, etc.) 4. Providers to work with stored tokens
  • 36. © 2016 Magento, Inc. Page | 36 How to store Payment Token • Use one of available factories -> PaymentTokenInterfaceFactory • Last 4 numbers • Expiration date • Credit card type • Client details Credit Card Account
  • 37. © 2016 Magento, Inc. Page | 37 • Payment token creation $paymentToken = $this->paymentTokenFactory->create(); $paymentToken->setGatewayToken($token); $paymentToken->setTokenDetails(json_encode([ 'type' => $transaction->cardDetails->cardType, 'maskedCC' => $transaction->cardDetails->last4, 'expirationDate' => $transaction->cardDetails->expirationDate ]));
  • 38. © 2016 Magento, Inc. Page | 38 • Store payment token in Extension Attributes $extAttrs = $payment->getExtensionAttributes(); $extAttrs->setVaultPaymentToken($paymentToken);
  • 39. © 2016 Magento, Inc. Page | 39
  • 40. © 2016 Magento, Inc. Page | 40 Display on Checkout Page • Implementation of TokenUiComponentProviderInterface provider: - Specify UI component for rendering - Transmit data from Payment Token • Add new provider to list of Vault providers components <type name="MagentoVaultModelUiTokensConfigProvider"> <arguments> <argument name="tokenUiComponentProviders" xsi:type="array"> <item name="sample" xsi:type="object"> SampleModelUiTokenUiComponentProvider </item> </argument> </arguments> </type>
  • 41. © 2016 Magento, Inc. Page | 41
  • 42. © 2016 Magento, Inc. Page | 42 Display in the customer profile • Implement one of renderers: CardRendererInterface or TokenRendererInterface • Add to layout <referenceContainer name="content"> <referenceBlock name="vault.cards.list"> <block class="MagentoSampleBlockCustomerCardRenderer" name="sample.car d.renderer" template="Magento_Vault::customer_account/credit_card.phtml"/> </referenceBlock> </referenceContainer>
  • 43. © 2016 Magento, Inc. Page | 43 Summary • Different payment integrations can use the same components • Adaptation for new requirements • Do not need to store credit cards • Payment tokens more secure
  • 44. © 2016 Magento, Inc. Page | 44 Useful links http://devdocs.magento.com/guides/v2.1/payments-integrations/bk-payments- integrations.html - How to add payment integration https://github.com/magento/magento2-samples/tree/master/sample-module- payment-gateway - Sample Payment Gateway http://devdocs.magento.com/guides/v2.1/howdoi/checkout/checkout_pa yment.html - Add payment method to the Checkout Page http://www.slideshare.net/elogic_commerce/payment-integration- patterns-magento2 - Types of payment integrations https://plugins.jetbrains.com/plugin/8024 - Magento 2 PHPStorm Plugin

Editor's Notes

  1. 2
  2. 3
  3. 4
  4. 5
  5. 6
  6. 8
  7. 9
  8. 10
  9. 11
  10. 12
  11. 13
  12. 14
  13. 15
  14. 16
  15. 17
  16. 18
  17. 19
  18. 20
  19. 21
  20. 22
  21. 23
  22. 24
  23. 25
  24. 26
  25. 27
  26. 28
  27. 29
  28. 30
  29. 31
  30. 32
  31. 33
  32. 34
  33. 35
  34. 36
  35. 37
  36. 38
  37. 39
  38. 40
  39. 41
  40. 42
  41. 43
  42. 44