SlideShare una empresa de 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

Más contenido relacionado

Destacado

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
 

Destacado (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
 

Similar 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
 

Similar 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

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
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
nilamkumrai
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Último (20)

WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
𓀤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...
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
 
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...
 
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
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 

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 del 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