SlideShare a Scribd company logo
Google
Checkout with
Ruby on Rails
Software Engineer, Consultant, Trainer
http://simplabs.com
Open Source
http://github.com/marcoow
http://github.com/simplabs
Marco Otte-Witte
USA/UK only!
Merchant Accounts
• Production Merchant Account
https://checkout.google.com/sell
• Sandbox Merchant Accournt
http://sandbox.google.com/checkout/sell
• => Merchant ID, Merchant Key
APIs
• HTML and XML APIs
• Notification APIs
• Example uses HTML API via HTTParty
Very(!) simple example
• Create Purchase with Google Checkout
• When Google Checkout confirms the
payment handle the Purchase in the app
Create Purchase
• Post an HTML Form to Google
• or create via HTML API:
post("/requestForm/Merchant/#{merchant_id}", :body => {
:_type => 'checkout-shopping-cart',
:'shopping-cart.items.item-1.item-name' => product.name,
:'shopping-cart.items.item-1.item-description' => product.description,
:'shopping-cart.items.item-1.quantity' => 1,
:'shopping-cart.items.item-1.unit-price' => price,
:'shopping-cart.items.item-1.unit-price.currency' => currency
})
• => returns serial-number to later identify
the purchase
Create Purchase
Notifications
• Register for Notifications:
(need SSH tunnel for local development)
Complete Purchase
• State Change Notifications:
def callback
type = params[:'_type']
serial_number = params[:'serial-number']
if type == 'order-state-change-notification'
order_state = params[:'new-financial-order-state']
purchase = GoogleCheckoutPurchase.find_by_serial_number(serial_number)
case order_state.try(:downcase)
when 'charged'
purchase.book!
when 'payment_declined', 'cancelled', 'cancelled_by_google'
purchase.fail!
end
end
render :text => "serial-number=#{serial_number}", :status => :ok
rescue
head :internal_server_error
end
A lot more can
be done!
Resources
• http://code.google.com/intl/de-DE/apis/checkout/
• https://rubygems.org/gems/google4r-checkout
Q&A

More Related Content

Viewers also liked

Ember.SimpleAuth
Ember.SimpleAuthEmber.SimpleAuth
Ember.SimpleAuth
Marco Otte-Witte
 
Open eGo, open source eGov-platform - Congres 2009 - V-ICT-OR
Open eGo, open source eGov-platform - Congres 2009 - V-ICT-OROpen eGo, open source eGov-platform - Congres 2009 - V-ICT-OR
Open eGo, open source eGov-platform - Congres 2009 - V-ICT-OR
Bart Gysens
 
Excellent
ExcellentExcellent
Excellent
Marco Otte-Witte
 
Day 1 Jordan's Energy Efficiency Policies
Day 1 Jordan's Energy Efficiency PoliciesDay 1 Jordan's Energy Efficiency Policies
Day 1 Jordan's Energy Efficiency Policies
RCREEE
 
RSpec
RSpecRSpec
Rails is not just Ruby
Rails is not just RubyRails is not just Ruby
Rails is not just Ruby
Marco Otte-Witte
 

Viewers also liked (6)

Ember.SimpleAuth
Ember.SimpleAuthEmber.SimpleAuth
Ember.SimpleAuth
 
Open eGo, open source eGov-platform - Congres 2009 - V-ICT-OR
Open eGo, open source eGov-platform - Congres 2009 - V-ICT-OROpen eGo, open source eGov-platform - Congres 2009 - V-ICT-OR
Open eGo, open source eGov-platform - Congres 2009 - V-ICT-OR
 
Excellent
ExcellentExcellent
Excellent
 
Day 1 Jordan's Energy Efficiency Policies
Day 1 Jordan's Energy Efficiency PoliciesDay 1 Jordan's Energy Efficiency Policies
Day 1 Jordan's Energy Efficiency Policies
 
RSpec
RSpecRSpec
RSpec
 
Rails is not just Ruby
Rails is not just RubyRails is not just Ruby
Rails is not just Ruby
 

Similar to Google Checkout with Ruby on Rails

Google Checkout for Umbraco
Google Checkout for UmbracoGoogle Checkout for Umbraco
Google Checkout for Umbraco
Warren Buckley
 
Shopify
ShopifyShopify
Shopify
Nascenia IT
 
Chrome Web Store に登録してみた
Chrome Web Store に登録してみたChrome Web Store に登録してみた
Chrome Web Store に登録してみた
Kosei Moriyama
 
A Tale of Two Shopping Carts - Cart66 vs WooCommerce
A Tale of Two Shopping Carts - Cart66 vs WooCommerceA Tale of Two Shopping Carts - Cart66 vs WooCommerce
A Tale of Two Shopping Carts - Cart66 vs WooCommerce
Andrew Makar
 
Flamingo Commerce Module Details
Flamingo Commerce Module DetailsFlamingo Commerce Module Details
Flamingo Commerce Module Details
i-love-flamingo
 
Building Ecommerce Storefronts on the JAMstack
Building Ecommerce Storefronts on the JAMstackBuilding Ecommerce Storefronts on the JAMstack
Building Ecommerce Storefronts on the JAMstack
BigCommerce
 
Testing In App Billing
Testing In App BillingTesting In App Billing
Testing In App Billing
Ryan Harter
 
OpenCart Amazon Connector Extension
OpenCart Amazon Connector ExtensionOpenCart Amazon Connector Extension
OpenCart Amazon Connector Extension
Webkul Software Pvt. Ltd.
 
An Introduction to Drupal Commerce & Real World Examples
An Introduction to Drupal Commerce & Real World ExamplesAn Introduction to Drupal Commerce & Real World Examples
An Introduction to Drupal Commerce & Real World Examples
Phase2
 
Customer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
Customer Automation Masterclass - Workshop 1: Data Enrichment using ClearbitCustomer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
Customer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
JanBogaert8
 
How to migrate Yahoo Store to Shopify with Litextension
How to migrate Yahoo Store to Shopify with LitextensionHow to migrate Yahoo Store to Shopify with Litextension
How to migrate Yahoo Store to Shopify with Litextension
LitExtension
 
B2C-Commerce-Developer Dumps
B2C-Commerce-Developer DumpsB2C-Commerce-Developer Dumps
B2C-Commerce-Developer Dumps
addisonkalven
 
LA2M Google Tools Presentation Apr 1st 09
LA2M Google Tools Presentation Apr 1st 09LA2M Google Tools Presentation Apr 1st 09
LA2M Google Tools Presentation Apr 1st 09
oneilldec
 
Custom Automation Masterclass – Workshop 2: Email validation using kKckbox
Custom Automation Masterclass – Workshop 2: Email validation using kKckboxCustom Automation Masterclass – Workshop 2: Email validation using kKckbox
Custom Automation Masterclass – Workshop 2: Email validation using kKckbox
JanBogaert8
 
AEM & eCommerce integration
AEM & eCommerce integrationAEM & eCommerce integration
AEM & eCommerce integration
Lokesh BS
 
Ecommerce for Associations
Ecommerce for AssociationsEcommerce for Associations
Ecommerce for Associations
HighRoad Solution
 
How To: Use Google Search Ap Is On Your Blog
How To: Use Google Search Ap Is On Your BlogHow To: Use Google Search Ap Is On Your Blog
How To: Use Google Search Ap Is On Your Blog
mutex07
 
Cart creation-101217222728-phpapp01
Cart creation-101217222728-phpapp01Cart creation-101217222728-phpapp01
Cart creation-101217222728-phpapp01
Jason Noble
 
How to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdfHow to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdf
Katy Slemon
 
How to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdfHow to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdf
Katy Slemon
 

Similar to Google Checkout with Ruby on Rails (20)

Google Checkout for Umbraco
Google Checkout for UmbracoGoogle Checkout for Umbraco
Google Checkout for Umbraco
 
Shopify
ShopifyShopify
Shopify
 
Chrome Web Store に登録してみた
Chrome Web Store に登録してみたChrome Web Store に登録してみた
Chrome Web Store に登録してみた
 
A Tale of Two Shopping Carts - Cart66 vs WooCommerce
A Tale of Two Shopping Carts - Cart66 vs WooCommerceA Tale of Two Shopping Carts - Cart66 vs WooCommerce
A Tale of Two Shopping Carts - Cart66 vs WooCommerce
 
Flamingo Commerce Module Details
Flamingo Commerce Module DetailsFlamingo Commerce Module Details
Flamingo Commerce Module Details
 
Building Ecommerce Storefronts on the JAMstack
Building Ecommerce Storefronts on the JAMstackBuilding Ecommerce Storefronts on the JAMstack
Building Ecommerce Storefronts on the JAMstack
 
Testing In App Billing
Testing In App BillingTesting In App Billing
Testing In App Billing
 
OpenCart Amazon Connector Extension
OpenCart Amazon Connector ExtensionOpenCart Amazon Connector Extension
OpenCart Amazon Connector Extension
 
An Introduction to Drupal Commerce & Real World Examples
An Introduction to Drupal Commerce & Real World ExamplesAn Introduction to Drupal Commerce & Real World Examples
An Introduction to Drupal Commerce & Real World Examples
 
Customer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
Customer Automation Masterclass - Workshop 1: Data Enrichment using ClearbitCustomer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
Customer Automation Masterclass - Workshop 1: Data Enrichment using Clearbit
 
How to migrate Yahoo Store to Shopify with Litextension
How to migrate Yahoo Store to Shopify with LitextensionHow to migrate Yahoo Store to Shopify with Litextension
How to migrate Yahoo Store to Shopify with Litextension
 
B2C-Commerce-Developer Dumps
B2C-Commerce-Developer DumpsB2C-Commerce-Developer Dumps
B2C-Commerce-Developer Dumps
 
LA2M Google Tools Presentation Apr 1st 09
LA2M Google Tools Presentation Apr 1st 09LA2M Google Tools Presentation Apr 1st 09
LA2M Google Tools Presentation Apr 1st 09
 
Custom Automation Masterclass – Workshop 2: Email validation using kKckbox
Custom Automation Masterclass – Workshop 2: Email validation using kKckboxCustom Automation Masterclass – Workshop 2: Email validation using kKckbox
Custom Automation Masterclass – Workshop 2: Email validation using kKckbox
 
AEM & eCommerce integration
AEM & eCommerce integrationAEM & eCommerce integration
AEM & eCommerce integration
 
Ecommerce for Associations
Ecommerce for AssociationsEcommerce for Associations
Ecommerce for Associations
 
How To: Use Google Search Ap Is On Your Blog
How To: Use Google Search Ap Is On Your BlogHow To: Use Google Search Ap Is On Your Blog
How To: Use Google Search Ap Is On Your Blog
 
Cart creation-101217222728-phpapp01
Cart creation-101217222728-phpapp01Cart creation-101217222728-phpapp01
Cart creation-101217222728-phpapp01
 
How to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdfHow to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdf
 
How to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdfHow to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdf
 

Recently uploaded

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 

Google Checkout with Ruby on Rails

  • 2. Software Engineer, Consultant, Trainer http://simplabs.com Open Source http://github.com/marcoow http://github.com/simplabs Marco Otte-Witte
  • 4. Merchant Accounts • Production Merchant Account https://checkout.google.com/sell • Sandbox Merchant Accournt http://sandbox.google.com/checkout/sell • => Merchant ID, Merchant Key
  • 5. APIs • HTML and XML APIs • Notification APIs • Example uses HTML API via HTTParty
  • 6. Very(!) simple example • Create Purchase with Google Checkout • When Google Checkout confirms the payment handle the Purchase in the app
  • 7. Create Purchase • Post an HTML Form to Google • or create via HTML API: post("/requestForm/Merchant/#{merchant_id}", :body => { :_type => 'checkout-shopping-cart', :'shopping-cart.items.item-1.item-name' => product.name, :'shopping-cart.items.item-1.item-description' => product.description, :'shopping-cart.items.item-1.quantity' => 1, :'shopping-cart.items.item-1.unit-price' => price, :'shopping-cart.items.item-1.unit-price.currency' => currency }) • => returns serial-number to later identify the purchase
  • 9. Notifications • Register for Notifications: (need SSH tunnel for local development)
  • 10. Complete Purchase • State Change Notifications: def callback type = params[:'_type'] serial_number = params[:'serial-number'] if type == 'order-state-change-notification' order_state = params[:'new-financial-order-state'] purchase = GoogleCheckoutPurchase.find_by_serial_number(serial_number) case order_state.try(:downcase) when 'charged' purchase.book! when 'payment_declined', 'cancelled', 'cancelled_by_google' purchase.fail! end end render :text => "serial-number=#{serial_number}", :status => :ok rescue head :internal_server_error end
  • 11. A lot more can be done!
  • 13. Q&A