SlideShare uma empresa Scribd logo
1 de 23
Anatomy of payment
systems in Drupal 8
Oleg Natalushko http://drupal.org/u/niko
Plan
• Current status of payments in Drupal 8.
• Common developers mistakes.
• Drupal commerce 2.x payment
• Payment
• Payment offsite API
About me
• More than 100 implemented drupal projects.
• 15 years experience Backend developer
• 5 years experience Drupal developer
• Maintainer of commerce interkassa
• Maintainer of Payment platon
• Maintainer of commerce probokassa
• Maintainer of Payment offsite API
Payment types.
• Payment emulation
• On site
• Off site
Drupal payment contrib.
Drupal 7
• Drupal commerce 1.x
• Payment
• Payment Gateway API
Drupal 8
• Drupal Commerce 2.x
• Payment
• Payment offsite API
W3C PAYMENT REQUEST API
SPECIFICATION
• Payment Request API
• Basic Card Payment
• Payment Method Identifiers
https://www.w3.org/TR/payment-request/
Payment
workflow
Real payment workflow
Real payment workflow
(Drupal developer think)
Checkout Payment system IPN call* Result page
Known contrib issues
• Partitional payment not supported
• Support only one payment instance per payment module
• Not fixed result pages
• Success URL: checkout/ORDER_ID/payment/return/ORDER_PAYMENT_REDIRECT_KEY
• Fail URL: checkout/ORDER_ID/payment/back/ORDER_PAYMENT_REDIRECT_KEY
• Payment transaction created only on success
• Send order ID to payment system
• Custom result urls used
Drupal commerce 2.x plan
- The payment gateway config entity + UI
- The payment gateway plugin type
- The payment type YAML plugin
- The credit_card payment type
- The payment method content entity (for storing tokenized payment
information), which uses the payment types as bundles
- The payment content entity, which uses payment types as bundles
A payment would have a workflow:
New -> Pending -> Complete -> Cancelled | (Partially) Refunded.
https://www.drupal.org/node/2711013
Payment method configuration
Payment method configuration
Payment module
•Config, Schema and Plugin
•Implement PaymentMethodConfigurationBase
• processBuildConfigurationForm() including tabs
magic
• defaultConfiguration()
• buildConfigurationForm()
• validateConfigurationForm()
• submitConfigurationForm()
• Status Selector (5 methods)
Payment Offsite API module
•Config, Schema, Plugin
•Implement PaymentMethodConfigurationBaseOffsite
• processBuildConfigurationForm()
• validateConfigurationForm()
• submitConfigurationForm()
• defaultConfiguration()
Payment form
Payment form
Payment module requirements
•Implement Routing
•Implement Redirect form controller (with
cleanup)
•Implement Access controller
•Implement signature generator
•Implement is configured checker
•Auto submit library
• Implement Operation provider (configuration
loader) getPaymentMethodConfiguration()
• Implement payment method deriver
getDerivativeDefinitions()
Payment Offsite API module
PaymentMethod plugin
•Extend PaymentMethodBaseOffsite or
PaymentMethodOffsiteSimple
•Implement
• paymentForm()
• isConfigured()
• getSignature() (simple)
•Use $this->addPaymentFormData()
•Use $this->generateForm()
•Configure auto submit via UI
Payment result pages
Payment
system
IPN
callback
Call Result
pages callback
Success page
Pending page
Fail page
Hidden fallback call
(optional)
Payment result pages
Payment module requirements
•Implement
• Routing
• Result pages controller
• Access controller
•Fallback support (optional)
Payment Offsite API module
PaymentMethod plugin
•Implement
• getResultPages()
• get<Result>Content()
• getSignature() (simple)
•Fallback call supports per result
page using getResultPages()
Payment IPN callback
Payment
system
IPN callback
Call IPN
Access check
Call IPN
Validate
Call IPN
Execute
Set order
internal status
according to
status mapping
Payment method plugin + configuration
Payment IPN callback
Payment module require
Implement
•Routing
•IPN controller
•IPN validator
•Access controller
Payment Offsite API module
Implement in PaymentMethod plugin
•ipnExecute()
•ipnValidate()
Also you could extend PaymentMethodOffsiteSimple and use
•validateEmpty()
•validateRequiredKeys()
•validateMerchant()
•validateSignature()
•validateTransactionId()
•validateAmount()
You must implement if going to use default validators:
•getMerchantIdName()
•getTransactionIdName()
•getAmountName()
•getSignatureName()
•getRequiredKeys()
Payment offsite API Interface
interface PaymentMethodOffsiteInterface {
public function ipnExecute();
public function ipnValidate();
public function getResultPages();
public function paymentForm();
public function isConfigured();
}
Payment offsite API
Simple Interface
interface PaymentMethodOffsiteSimpleInterface extends PaymentMethodOffsiteInterface {
const SIGN_IN = 'IN';
const SIGN_OUT = 'OUT';
public function getSignature($signature_type = self::SIGN_IN);
public function getMerchantIdName();
public function getTransactionIdName();
public function getAmountName();
public function getSignatureName();
public function getRequiredKeys();
}
Payment offsite API
• Fully compatible with Payment module
• Fallback mode support
• Multiple payment instances support
• Simplify payment method creation
• IPN and result pages callbacks
• Payment form
@Todo provide integration to commerce_payment
@see https://www.drupal.org/sandbox/niko/2685859
Thank you
Oleg Natalushko
Site: http://bighameleon.com
Skype: onatalushko
Phone: +380674176171
Drupal.org: https://www.drupal.org/u/niko

Mais conteúdo relacionado

Destaque

Formularios en Drupal 8
Formularios en Drupal 8Formularios en Drupal 8
Formularios en Drupal 8
Atenea tech
 
Cisco connect jabber client update
Cisco connect   jabber client updateCisco connect   jabber client update
Cisco connect jabber client update
Vitor Costa
 
Virtual Meeting Options - Adobe Connect Vs. Cisco WebEx - Final 1
Virtual Meeting Options - Adobe Connect Vs. Cisco WebEx - Final 1Virtual Meeting Options - Adobe Connect Vs. Cisco WebEx - Final 1
Virtual Meeting Options - Adobe Connect Vs. Cisco WebEx - Final 1
Clayton Boessen
 
Lesson 3 Sentence Expansion
Lesson 3   Sentence ExpansionLesson 3   Sentence Expansion
Lesson 3 Sentence Expansion
bsimoneaux
 

Destaque (20)

Julgamento de eichmann autoria mediata e tribunal de exceção uma análise jurí...
Julgamento de eichmann autoria mediata e tribunal de exceção uma análise jurí...Julgamento de eichmann autoria mediata e tribunal de exceção uma análise jurí...
Julgamento de eichmann autoria mediata e tribunal de exceção uma análise jurí...
 
Custom entities in d8
Custom entities in d8Custom entities in d8
Custom entities in d8
 
Formularios en Drupal 8
Formularios en Drupal 8Formularios en Drupal 8
Formularios en Drupal 8
 
Entidades en drupal 8
Entidades en drupal 8Entidades en drupal 8
Entidades en drupal 8
 
Open Source CMS TYPO3 at Cisco WebEx
Open Source CMS TYPO3 at Cisco WebExOpen Source CMS TYPO3 at Cisco WebEx
Open Source CMS TYPO3 at Cisco WebEx
 
9 - GMRC-DREWBERRY - WB_WR_Management_meeting-Sep-16
9 - GMRC-DREWBERRY - WB_WR_Management_meeting-Sep-169 - GMRC-DREWBERRY - WB_WR_Management_meeting-Sep-16
9 - GMRC-DREWBERRY - WB_WR_Management_meeting-Sep-16
 
Open Source CMS TYPO3 at Cisco WebEx
Open Source CMS TYPO3 at Cisco WebExOpen Source CMS TYPO3 at Cisco WebEx
Open Source CMS TYPO3 at Cisco WebEx
 
Virgin Media Case Study - WebEx
Virgin Media Case Study - WebEx Virgin Media Case Study - WebEx
Virgin Media Case Study - WebEx
 
Cisco connect jabber client update
Cisco connect   jabber client updateCisco connect   jabber client update
Cisco connect jabber client update
 
Cisco WebEx vulnerability: it’s a kind of magic
Cisco WebEx vulnerability: it’s a kind of magicCisco WebEx vulnerability: it’s a kind of magic
Cisco WebEx vulnerability: it’s a kind of magic
 
Tesco Case Study - WebEx
Tesco Case Study - WebEx Tesco Case Study - WebEx
Tesco Case Study - WebEx
 
Virtual Meeting Options - Adobe Connect Vs. Cisco WebEx - Final 1
Virtual Meeting Options - Adobe Connect Vs. Cisco WebEx - Final 1Virtual Meeting Options - Adobe Connect Vs. Cisco WebEx - Final 1
Virtual Meeting Options - Adobe Connect Vs. Cisco WebEx - Final 1
 
Gotomeeting vs Webex: Comprehensive Analysis
Gotomeeting vs Webex: Comprehensive AnalysisGotomeeting vs Webex: Comprehensive Analysis
Gotomeeting vs Webex: Comprehensive Analysis
 
Social Media Assessment Case Study Citrix Webex
Social Media Assessment Case Study Citrix WebexSocial Media Assessment Case Study Citrix Webex
Social Media Assessment Case Study Citrix Webex
 
Zoom.us Vs WebEx Vs GotoMeeting
Zoom.us Vs WebEx Vs GotoMeetingZoom.us Vs WebEx Vs GotoMeeting
Zoom.us Vs WebEx Vs GotoMeeting
 
Lesson 3 Sentence Expansion
Lesson 3   Sentence ExpansionLesson 3   Sentence Expansion
Lesson 3 Sentence Expansion
 
Drupal 8 & Commerce 2.x insights
Drupal 8 & Commerce 2.x insightsDrupal 8 & Commerce 2.x insights
Drupal 8 & Commerce 2.x insights
 
Troubleshooting Urouter Problems: WebEx Presentation
Troubleshooting Urouter Problems: WebEx PresentationTroubleshooting Urouter Problems: WebEx Presentation
Troubleshooting Urouter Problems: WebEx Presentation
 
Cisco Webex Distributed Framework and Data Store Design
Cisco Webex Distributed Framework and Data Store DesignCisco Webex Distributed Framework and Data Store Design
Cisco Webex Distributed Framework and Data Store Design
 
Expansion strategies
Expansion strategiesExpansion strategies
Expansion strategies
 

Semelhante a Anatomy of payment systems in Drupal 8

Redesigning PayPal APIs for Scale and Simplicity - QCon San Francisco 2013
Redesigning PayPal APIs for Scale and Simplicity - QCon San Francisco 2013Redesigning PayPal APIs for Scale and Simplicity - QCon San Francisco 2013
Redesigning PayPal APIs for Scale and Simplicity - QCon San Francisco 2013
Deepak Nadig
 

Semelhante a Anatomy of payment systems in Drupal 8 (20)

Show me the money
Show me the moneyShow me the money
Show me the money
 
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
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
March 2015: Plugins Worth Paying For
March 2015: Plugins Worth Paying ForMarch 2015: Plugins Worth Paying For
March 2015: Plugins Worth Paying For
 
Magento Payment & Vault framework
Magento Payment & Vault frameworkMagento Payment & Vault framework
Magento Payment & Vault framework
 
Spring batch
Spring batchSpring batch
Spring batch
 
Dancing with websocket
Dancing with websocketDancing with websocket
Dancing with websocket
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
 
Redesigning PayPal APIs for Scale and Simplicity - QCon San Francisco 2013
Redesigning PayPal APIs for Scale and Simplicity - QCon San Francisco 2013Redesigning PayPal APIs for Scale and Simplicity - QCon San Francisco 2013
Redesigning PayPal APIs for Scale and Simplicity - QCon San Francisco 2013
 
Payments using Stripe.com
Payments using Stripe.comPayments using Stripe.com
Payments using Stripe.com
 
Client-side Auth with Ember.js
Client-side Auth with Ember.jsClient-side Auth with Ember.js
Client-side Auth with Ember.js
 
Single Page Apps with Drupal 8
Single Page Apps with Drupal 8Single Page Apps with Drupal 8
Single Page Apps with Drupal 8
 
SPUnite17 Timer Jobs Event Handlers
SPUnite17 Timer Jobs Event HandlersSPUnite17 Timer Jobs Event Handlers
SPUnite17 Timer Jobs Event Handlers
 
ASP.NET MVC 2.0
ASP.NET MVC 2.0ASP.NET MVC 2.0
ASP.NET MVC 2.0
 
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 Harness SharePoint and jQuery to Make Dynamic Displays and Applications Harness SharePoint and jQuery to Make Dynamic Displays and Applications
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 
Asp.net mvc 6 with sql server 2014
Asp.net mvc 6 with sql server 2014Asp.net mvc 6 with sql server 2014
Asp.net mvc 6 with sql server 2014
 
Play Framework workshop: full stack java web app
Play Framework workshop: full stack java web appPlay Framework workshop: full stack java web app
Play Framework workshop: full stack java web app
 
Process Orchestration with Flowable and Spring Boot
Process Orchestration with Flowable and Spring BootProcess Orchestration with Flowable and Spring Boot
Process Orchestration with Flowable and Spring Boot
 
IBM Licensing: Technical fundamentals for discovery
IBM Licensing: Technical fundamentals for discoveryIBM Licensing: Technical fundamentals for discovery
IBM Licensing: Technical fundamentals for discovery
 
Automating your php infrastructure with the zend server api
Automating your php infrastructure with the zend server apiAutomating your php infrastructure with the zend server api
Automating your php infrastructure with the zend server api
 

Último

Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Sheetaleventcompany
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
anilsa9823
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
SofiyaSharma5
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 

Último (20)

Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 

Anatomy of payment systems in Drupal 8

  • 1. Anatomy of payment systems in Drupal 8 Oleg Natalushko http://drupal.org/u/niko
  • 2. Plan • Current status of payments in Drupal 8. • Common developers mistakes. • Drupal commerce 2.x payment • Payment • Payment offsite API
  • 3. About me • More than 100 implemented drupal projects. • 15 years experience Backend developer • 5 years experience Drupal developer • Maintainer of commerce interkassa • Maintainer of Payment platon • Maintainer of commerce probokassa • Maintainer of Payment offsite API
  • 4. Payment types. • Payment emulation • On site • Off site
  • 5. Drupal payment contrib. Drupal 7 • Drupal commerce 1.x • Payment • Payment Gateway API Drupal 8 • Drupal Commerce 2.x • Payment • Payment offsite API
  • 6. W3C PAYMENT REQUEST API SPECIFICATION • Payment Request API • Basic Card Payment • Payment Method Identifiers https://www.w3.org/TR/payment-request/
  • 9. Real payment workflow (Drupal developer think) Checkout Payment system IPN call* Result page
  • 10. Known contrib issues • Partitional payment not supported • Support only one payment instance per payment module • Not fixed result pages • Success URL: checkout/ORDER_ID/payment/return/ORDER_PAYMENT_REDIRECT_KEY • Fail URL: checkout/ORDER_ID/payment/back/ORDER_PAYMENT_REDIRECT_KEY • Payment transaction created only on success • Send order ID to payment system • Custom result urls used
  • 11. Drupal commerce 2.x plan - The payment gateway config entity + UI - The payment gateway plugin type - The payment type YAML plugin - The credit_card payment type - The payment method content entity (for storing tokenized payment information), which uses the payment types as bundles - The payment content entity, which uses payment types as bundles A payment would have a workflow: New -> Pending -> Complete -> Cancelled | (Partially) Refunded. https://www.drupal.org/node/2711013
  • 13. Payment method configuration Payment module •Config, Schema and Plugin •Implement PaymentMethodConfigurationBase • processBuildConfigurationForm() including tabs magic • defaultConfiguration() • buildConfigurationForm() • validateConfigurationForm() • submitConfigurationForm() • Status Selector (5 methods) Payment Offsite API module •Config, Schema, Plugin •Implement PaymentMethodConfigurationBaseOffsite • processBuildConfigurationForm() • validateConfigurationForm() • submitConfigurationForm() • defaultConfiguration()
  • 15. Payment form Payment module requirements •Implement Routing •Implement Redirect form controller (with cleanup) •Implement Access controller •Implement signature generator •Implement is configured checker •Auto submit library • Implement Operation provider (configuration loader) getPaymentMethodConfiguration() • Implement payment method deriver getDerivativeDefinitions() Payment Offsite API module PaymentMethod plugin •Extend PaymentMethodBaseOffsite or PaymentMethodOffsiteSimple •Implement • paymentForm() • isConfigured() • getSignature() (simple) •Use $this->addPaymentFormData() •Use $this->generateForm() •Configure auto submit via UI
  • 16. Payment result pages Payment system IPN callback Call Result pages callback Success page Pending page Fail page Hidden fallback call (optional)
  • 17. Payment result pages Payment module requirements •Implement • Routing • Result pages controller • Access controller •Fallback support (optional) Payment Offsite API module PaymentMethod plugin •Implement • getResultPages() • get<Result>Content() • getSignature() (simple) •Fallback call supports per result page using getResultPages()
  • 18. Payment IPN callback Payment system IPN callback Call IPN Access check Call IPN Validate Call IPN Execute Set order internal status according to status mapping Payment method plugin + configuration
  • 19. Payment IPN callback Payment module require Implement •Routing •IPN controller •IPN validator •Access controller Payment Offsite API module Implement in PaymentMethod plugin •ipnExecute() •ipnValidate() Also you could extend PaymentMethodOffsiteSimple and use •validateEmpty() •validateRequiredKeys() •validateMerchant() •validateSignature() •validateTransactionId() •validateAmount() You must implement if going to use default validators: •getMerchantIdName() •getTransactionIdName() •getAmountName() •getSignatureName() •getRequiredKeys()
  • 20. Payment offsite API Interface interface PaymentMethodOffsiteInterface { public function ipnExecute(); public function ipnValidate(); public function getResultPages(); public function paymentForm(); public function isConfigured(); }
  • 21. Payment offsite API Simple Interface interface PaymentMethodOffsiteSimpleInterface extends PaymentMethodOffsiteInterface { const SIGN_IN = 'IN'; const SIGN_OUT = 'OUT'; public function getSignature($signature_type = self::SIGN_IN); public function getMerchantIdName(); public function getTransactionIdName(); public function getAmountName(); public function getSignatureName(); public function getRequiredKeys(); }
  • 22. Payment offsite API • Fully compatible with Payment module • Fallback mode support • Multiple payment instances support • Simplify payment method creation • IPN and result pages callbacks • Payment form @Todo provide integration to commerce_payment @see https://www.drupal.org/sandbox/niko/2685859
  • 23. Thank you Oleg Natalushko Site: http://bighameleon.com Skype: onatalushko Phone: +380674176171 Drupal.org: https://www.drupal.org/u/niko

Notas do Editor

  1. Checkout/payment screenshot to explain what is payment type plugin
  2. All 3 routines are processed with method plugin configured with config from configuration plugin