Elsewhere

NYC Camp News & Announcements: <a href="/news/announcing-nyc-camp-2014">Announcing NYC Camp 2014</a>

Planet Drupal - mer, 16/04/2014 - 05:27

NYC Camp (aka 'nice camp') is an annual 4 day mini Drupal conference held in NYC dedicated to Drupal learning and contribution. Best of all it's completely free and volunteer powered! This past year we had a spectacular event packed with trainings, sessions, summits and sprints. We've got a great event in the works and expect NYC Camp 2014 to rock even harder than last year!

Interested in volunteering? Yes You! Sign up to participate and contribute to your NYC Drupal community here

Stay up to date on all upcoming NYCCamp News by following us on twitter @NYCCampDrupal

Catégories: Elsewhere

David Pashley: Bad Password Policies

Planet Debian - mer, 16/04/2014 - 03:03

After the whole Heartbleed fiasco, I’ve decided to continue my march towards improving my online security. I’d already begun the process of using LastPass to store my passwords and generate random passwords for each site, but I hadn’t completed the process, with some sites still using the same passwords, and some having less than ideal strength passwords, so I spent some time today improving my password position. Here’s some of the bad examples of password policy I’ve discovered today.

First up we have Live.com. A maximum of 16 characters from the Microsoft auth service. Seems to accept any character though.

 

This excellent example is from creditexpert.co.uk, one of the credit agencies here in the UK. They not only restrict to 20 characters, they restrict you to @, ., _ or |. So much for teaching people how to protect themselves online.

Here’s Tesco.com after attempting to change my password to ”QvHn#9#kDD%cdPAQ4&b&ACb4x%48#b”. If you can figure out how this violates their rules, I’d love to know. And before you ask, I tried without numbers and that still failed so it can’t be the “three and only three” thing. The only other idea might be that they meant “‘i.e.” rather than “e.g.”, but I didn’t test that.

Here’s a poor choice from ft.com, refusing to accept non-alphanumeric characters. On the plus side they did allow the full 30 characters in the password.

 

The finest example of a poor security policy is a company who will remain nameless due to their utter lack of security. Not only did they not use HTTPS, they accepted a 30 character password and silently truncated it to 20 characters, the reason I know this is because when I logged out and tried to log in again and then used the “forgot my password” option, they emailed me the password in plain text.

I have also been setting up two-factor authentication where possible. Most sites use the Google Authenticator application on your mobile to give you a 6 digit code to type in in addition to your password. I highly recommend you set it up too. There’s a useful list of sites that implement 2FA and links to their documentation at http://twofactorauth.org/.

I realise that my choice LastPass requires me to trust them, but I think the advantages outweigh the disadvantages of having many sites using the same passwords and/or low strength passwords. I know various people cleverer than me have looked into their system and failed to find any obvious flaws.

The post Bad Password Policies appeared first on David Pashley.com.

Catégories: Elsewhere

AGLOBALWAY: Redirect user after login (or filling out other forms)

Planet Drupal - mer, 16/04/2014 - 00:50
Redirecting a user to a specific path after a form submission is a feature required by most CMS websites. In Drupal, as with most things, there’s multiple ways to do it. Here’s a couple we use, depending on the site’s requirements:  

This is a method can be used for all the forms. Two steps here:

  1. Change block thank you page urlThis method only works for a form in a block. In admin->structure->block, find the block containing the form and there is a configuration named “Thank You Page”. Put in the redirect url here or leave blank for no redirect. The benefit of this way is both developers and the website administrator can change it without touching code while the limitation is the form must be put in a form. 
  2. Add a submit handler to form_alter
    1. Add a submit handler to the form_alter with the condition that the form id is the one we want to customize.
    2. Assign the redirect path to $form_state['redirect'] in the handler function.

 

Tags: drupal planet
Catégories: Elsewhere

groups.drupal.org frontpage posts: NYC Camp Media sprint report

Planet Drupal - mar, 15/04/2014 - 23:09

New York city Drupal camp happened last weekend in United Nations HQ and there was, among numerous other things, Media sprint going on. Organizers did their best to bring some of the most active Drupal Media contributors on-site. We are very happy and thankful that they made this possible, as we managed to achieve some very important steps forward.

Plans for Drupal 8

Main part of our efforts at the camp was roadmap for Media in Drupal 8 as part of which we achieved few very important conclusions:

  • Storage components: there are still different opinions about the storage part (AKA "File entity" approach vs. "Media entity" approach - for more info check https://groups.drupal.org/node/384813). We decided that this is fine. We will continue to work on both solutions, while trying to find as many sticking points as possible and share as much code as possible. Entire ecosystem will be split into several sub-components in order for this to be possible.
  • Decoupled components architecture: as already mentioned we're dividing Media ecosystem into smaller pieces, which will be easier to develop and maintain. We will make sure to make every component as generally usable as possible. This will allow us to use them with both storage solutions and also, when applicable, in more general contexts (not necessary related to media itself). "Full featured" media solutions will still exist, but will mostly provide glue that will make individual components able to work together.
  • Media browser/selector/creator: this part of the system will be responsible for browsing media collections, picking and/or creating individual or multiple media items. It will be used in different contexts as fields (entity reference, file, image, ...), WYSIWYG, global, etc. This component will not be related to media by it's nature. It should be possible to use it also in other similar use-cases (browsing and picking nodes for an entity reference field for example). Existing tools/systems should be used where possible (Views for entity browsing, existing field widgets for entity creation, ...).
  • WYSIWYG integration: core now supports image embeds by default, but we still want to be able to embed other types of media. WYSIWYG entity embed framework will be responsible for that. It will be able to embed any entity using techniques that were already tested in D7. Entity-specific solutions that we know from D7 world (node_embed, ...) will become obsolete as a result of that.
  • Display configuration: we will create two levels of display configuration. Field formatter level will provide more basic functionality, while ensuring simpler interface for site builders and administrators. This approach is expected to be used on simpler sites. Media/File entity render will, on the other hand, provide more powerful display configuration system with more complexity. Both storage solutions will share some parts of display configuration components, but it will not be possible to re-use everything.
  • 3Rd party providers: both storage solutions will need own 3Rd party integrations due to fundamental differences in storage implementation.
Next events/sprints Getting involved

In order for Media to really rock in D8 we need a lot of help (by this I mean A LOT!). Are you personally interested in media on Drupal or you run a Drupal company/shop and have to deal with funky media problems and desperately need a powerful and extensible solution for that? Are you able to dedicate some of your (or one or your employees) time to achieve that goal?

We need you! No matter which skills you have! We need help with back-end and front-end development. We also need design/UX skills to create good editorial experience. Are you not a coder, but have good ideas? We need those!

You can reach us on #drupal-media or on groups.drupal.org/media. There will be weekly "scrums" held in Google Hangout onAir every Tuesday at 3:30PM GMT (follow groups.drupal.org/media for announcements).

We need your user stories

There are as many possible media use-cases as there are Drupal websites. In order to be able to design the system in a way that will work for most possible situations we need your feedback - your user stories. Please take few minutes to think about your past project that dealt with Media and try to remember interesting problems that you'be been facing. Then use our form and send them our way in a form of a user story.

Google Summer of Code 2014

We have two quite strong media related project proposals for this year's Summer of code. We are hoping for both of them to be accepted. We will be able to publish more informations about that in the second part of April.

Please help Aaron Winborn

Aaron is a long time Drupal contributor, author of many media-related modules and a great and inspiring person. He is fighting ALS and he needs our help. Please consider contributing to his fund to help them make his and his families life just a little bit easier. Thank you!

We would like to thank camp organizers one more time. They prepared an unforgettable event for us. We would definitely not be able to achieve this progress without their support!

Catégories: Elsewhere

Petter Reinholdtsen: FreedomBox milestone - all packages now in Debian Sid

Planet Debian - mar, 15/04/2014 - 22:10

The Freedombox project is working on providing the software and hardware to make it easy for non-technical people to host their data and communication at home, and being able to communicate with their friends and family encrypted and away from prying eyes. It is still going strong, and today a major mile stone was reached.

Today, the last of the packages currently used by the project to created the system images were accepted into Debian Unstable. It was the freedombox-setup package, which is used to configure the images during build and on the first boot. Now all one need to get going is the build code from the freedom-maker git repository and packages from Debian. And once the freedombox-setup package enter testing, we can build everything directly from Debian. :)

Some key packages used by Freedombox are freedombox-setup, plinth, pagekite, tor, privoxy, owncloud and dnsmasq. There are plans to integrate more packages into the setup. User documentation is maintained on the Debian wiki. Please check out the manual and help us improve it.

To test for yourself and create boot images with the FreedomBox setup, run this on a Debian machine using a user with sudo rights to become root:

sudo apt-get install git vmdebootstrap mercurial python-docutils \ mktorrent extlinux virtualbox qemu-user-static binfmt-support \ u-boot-tools git clone http://anonscm.debian.org/git/freedombox/freedom-maker.git \ freedom-maker make -C freedom-maker dreamplug-image raspberry-image virtualbox-image

Root access is needed to run debootstrap and mount loopback devices. See the README in the freedom-maker git repo for more details on the build. If you do not want all three images, trim the make line. Note that the virtualbox-image target is not really virtualbox specific. It create a x86 image usable in kvm, qemu, vmware and any other x86 virtual machine environment. You might need the version of vmdebootstrap in Jessie to get the build working, as it include fixes for a race condition with kpartx.

If you instead want to install using a Debian CD and the preseed method, boot a Debian Wheezy ISO and use this boot argument to load the preseed values:

url=http://www.reinholdtsen.name/freedombox/preseed-jessie.dat

I have not tested it myself the last few weeks, so I do not know if it still work.

If you wonder how to help, one task you could look at is using systemd as the boot system. It will become the default for Linux in Jessie, so we need to make sure it is usable on the Freedombox. I did a simple test a few weeks ago, and noticed dnsmasq failed to start during boot when using systemd. I suspect there are other problems too. :) To detect problems, there is a test suite included, which can be run from the plinth web interface.

Give it a go and let us know how it goes on the mailing list, and help us get the new release published. :) Please join us on IRC (#freedombox on irc.debian.org) and the mailing list if you want to help make this vision come true.

Catégories: Elsewhere

Isovera Ideas & Insights: It's OK Not to Be Sexy

Planet Drupal - mar, 15/04/2014 - 20:49

It's OK not to be sexy.  

Catégories: Elsewhere

X-Team: Use Drupal Vagrant Rsync feature to maximize performance

Planet Drupal - mar, 15/04/2014 - 20:49
We all know that Drupal doesn’t do really well under the default shared folder of VirtualBox. When we were given the task of creating a new box for one of our clients, we immediately went with NFS file system to circumvent this issue. We quickly realized two things: Vagrant is way faster with NFS enabled...
Catégories: Elsewhere

DrupalCon Austin News: Calling All Mentors!

Planet Drupal - mar, 15/04/2014 - 19:21


If you’ve ever attended a sprint, you know how important mentors are. We're asking for interested volunteers to sign up to act as mentors for the DrupalCon Austin sprints. We’re expecting 600 attendees to get involved, and need all the help we can get!

Catégories: Elsewhere

DrupalCon Austin News: DrupalCon Austin 2014 Grant and Scholarship Recipients Have Been Selected

Planet Drupal - mar, 15/04/2014 - 17:56

We’re pleased to announce that the grant and scholarship recipients for DrupalCon Austin 2014 have been selected and finalized!

Thanks to generosity from our sponsors, we were able to extend offers of financial aid to 33 individuals worldwide!

There were over 100 applicants for financial aid for DrupalCon Austin, and selecting the best candidates for the convention was difficult work. Every candidate underwent a comprehensive evaluation by a committee of volunteers from the Drupal community.

Catégories: Elsewhere

Digett: Crawling vs. Indexing: Robots.txt and sitemap.xml

Planet Drupal - mar, 15/04/2014 - 16:55

Sometimes you need to prevent a site, page or everything at a particular path from showing up in Google search. I've heard people say to just disallow the page in robots.txt file. This is actually incorrect.

read more

Catégories: Elsewhere

Open Source Training: 27 Funny, Imaginative and Odd Drupal Logos

Planet Drupal - mar, 15/04/2014 - 16:28

Some organizations are very serious about their logos. They produce exhaustive guidelines on how their logo should and should not be used.

The Drupal community takes the opposite approach. The Drupal logo is called "Druplicon" and is released under the GPL license. That licensing allows designers to do whatever they want with the logo.

That design freedom has led to some funny, imaginative and downright strange variations on the Drupal logo.

Here are 27 of our favorites from events around the world.

Catégories: Elsewhere

DrupalCon Austin News: The Austin Schedule is Live

Planet Drupal - mar, 15/04/2014 - 15:36

For a few months now, we have been telling you about all the great content and fun things to do at DrupalCon Austin. Now you can see for yourself! The schedule is live and you can see it here.

You can use the master schedule to build your own personal schedule by clicking the plus or minus on the calendar icons next to the events you wish to attend. You can also access your personal schedule from the master schedule and your profile. See the screenshot below:

Catégories: Elsewhere

Drupalize.Me: What is Drupal (8)?

Planet Drupal - mar, 15/04/2014 - 14:20

With the release of Drupal 8 approaching, it’s time again to answer and update the age old question: What is Drupal?

Catégories: Elsewhere

Frederick Giasson: Registering an OSF Network in OSF for Drupal (Screencast)

Planet Drupal - mar, 15/04/2014 - 14:05

In this screencast, I explain how we can link (register) one or multiple OSF Web Services networks to a single OSF for Drupal instance. I discuss how this OSF Web Services mechanism can be used to bring datasets from multiple different OSF instances into the same Drupal portal. I also cover how we can use the same OSF Web Services network as the backend for multiple Drupal portals (which uses OSF for Drupal).

We briefly discuss the distributed aspect of the Open Semantic Framework (OSF), but this topic will be discussed more in deep in a subsequent screencast.

 


Catégories: Elsewhere

INsReady: How fast does Drupal grow in China? A perspective from DrupalCampChina 2014

Planet Drupal - mar, 15/04/2014 - 12:37

March 22nd, 2014, we have concluded DrupalCampChina 2014 (announcement). This is the second year that Drupal Shanghai Community has teamed up with Techyizu.org (a Shanghai-based volunteer-driven organization and supporters of the China startup and tech community.) to succefully organize DrupalCamp within Barcamp. For those who don't know, Barcamp is the same style as DrupalCamp, but wider topics and larger audience. We organize Barcamp to attract a variety of people in the related industries; In Spring, 2014, this Barcamp received over 700 people. On Drupal side, we also had large attendance, fun discussion & collaboration and a rooftop afterparty. I was very happy to see large increase in presentations and people at the DrupalCamp (comparing to DrupalCampChina 2013), and therefore, I am eager to share my observation publicly.

Keynote attendance doubled
Thanks to The Drupal Community Cultivation Grant (and the Committee), this year we received the grant help again to bring in an international well-known Drupal contributor to speak at our camp keynote. John Albin Wilkins offered the favor and presented "Drupal for a Better Web". During his keynote, I realized there were around 200 people packed in this conference room. I also recognized many local Drupal community leaders from other Chinese cities, such as Beijing, Hangzhou, etc. Comparing to last year keynote, we almost had 100% increase in keynote attendance.

Sessions doubled
Last year, we had one track at the DrupalCamp, and besides a keynote, there were 4 hour-long sessions. This year, we had two tracks and total 8 sessions and a keynote. Thanks to all the presenters at DrupalCamp, you all made this camp succesfull!

Marketing presence
In the past 3 years of my volunteering and community activities in Shanghai, China. I almost exclusively interacted with developers, designers and entrepreneurs who work with Drupal on daily basis. However, at this DrupalCamp, I saw a person with professional cameras and camcorders busy recording all the sessions. I had a pleasure talking to him, and learned that he doesn't use Drupal, but he believes in his partners who develop a business on Drupal, and he decides to dedicate his efforts of Marketing and Sales for Drupal. As many people would agree, in the Drupal world, we are in high demand of talent, but we are even in higher demand of people who market Drupal well and explain what Drupal is to others. I am glad to see the presence of marketing professionals at this camp, which shows the business side of Drupal is promising in China. I believe they are good at helping companies discover and invest in Drupal as their business solution.

Future collaboration
6 Barcamps have been organized in the past 3 years in Shanghai. However, Barcamp didn't get very technical until 2013 we organized DrupalCampChina 2013. This year, we promoted DrupalCamp through the regular channels via Barcamp and media friends. Then at the camp, I saw Javascript, Node.js and a few other stacks of technologies sessions talking about Internet of things. Not only those presenters offered different choices and opinions and helped Drupal to educate the same audience on Internet or Web; but also, most of those presenters support open source and likely the Shanghai Drupal community will extend the communication to those local open source communities for future collaboration.

I am very glad how this camp turned out. I see great collaboration between local Drupal community and Drupal Association on bringing an oversee speaker, the collaboration among different communities to organize a large Barcamp and DrupalCamp, the collaboration within the camp during presentations. This collaboration builds us a good foundation to further advocate Drupal in China, and we will see a larger DrupalCamp next year!

More photos about DrupalCampChina 2014, please see the album on Google+

Files:  PANO_20140322_120703.jpg IMG_2591.JPG IMG_2624.JPG IMG_2575.JPG IMG_2592.JPGTag: Drupal PlanetDrupalCampChina
Catégories: Elsewhere

Bálint Réczey: Proposing amd64-hardened architecture for Debian

Planet Debian - mar, 15/04/2014 - 12:02

Facing last week’s Heartbleed bug the need for improving the security of our systems became more apparent than usually. In Debian there are widely used methods for Hardening packages at build time and guidelines for improving the default installations’ security.

Employing such methods usually come at an expense, for example slower code execution of binaries due to additional checks or additional configuration steps when setting up a system. Balancing between usability and security Debian chose an approach which would satisfy the most users by using C/C++ features which only slightly decrease execution speed of built binaries and by using reasonable defaults in package installations.

All the architectures supported by  Debian aims using the same methods for enhancing security but it does not have to stay the same way. Amd64 is the most widely used architecture of Debian according to popcon and amd64 hardware comes with powerful CPU-s. I think there would be a significant amount of people (being one of them :-)) who would happily use a version of Debian with more security features enabled by default sacrificing some CPU power and installing and setting up additional packages.

My proposal for serving those security-focused users is introducing a new architecture targeting amd64 hardware, but with more security related C/C++ features turned on for every package (currently hardening has to be enabled by the maintainers in some way) through compiler flags as a start.

Introducing the new architecture would also let package maintainers enabling additional dependencies and build rules selectively for the new architecture improving the security further. On the users’ side the advantage of having a separate security enhanced architecture instead of a Debian derivative is the potential of installing a set of security enhanced packages using multiarch. You could have a fast amd64 installation as a base and run Apache or any other sensitive server from the amd64-hardened packages!

I have sent the proposal for discussion to debian-dev, too. Please join the discussion there or leave a comment here.

Catégories: Elsewhere

David Herron: Static HTML website builders (AkashaCMS, etc) slashes web hosting costs to the bone

Planet Drupal - mar, 15/04/2014 - 10:52

Today's web is supposedly about fancy software on both server and client, building amazingly flexible applications merging content and functionality from anywhere.  What, then, is the role of old-school HTML websites?  In particular, why am I wasting my time building AkashaCMS and not building websites with Drupal?


Catégories: Elsewhere

flink: "But that's easy in Drupal, isn't it?"

Planet Drupal - mar, 15/04/2014 - 10:17

Many a time a customer’s casual challenge of “But that’s easy in Drupal isn’t it?” has resulted in us taking up the gauntlet and putting in some hard yards to indeed "make that easy”.

Clearly 8,500 D7 modules on drupal.org is not enough.

As we were working on a government project last year the question popped up again and we had to rise to the occasion. The project was eventually put on ice, but during its course another module baby was born. We called it Views Aggregator Plus and set her free in Drupalland. It seemed a waste not to share it.

One thing we've learned about releasing modules: you have no idea upfront which ones will thrive. We thought we had created a niche application and planned for one install, namely that single install on that site that never happened. But the module usage statistics prove that it has found applications way beyond its initial purpose. Not bad for a module that wasn't meant to see the light outside that one web site!

As so often in Drupal, further enhancements were very much driven by the needs the community raised, thus taking the module into directions we’d never anticipated, like its application as a Webform submissions post-processor.

For your inspiration we contacted some of the early adopters we came to know through the module's issue queue and collected from them some examples of how Drupal site builders all over the world get value out of Views Aggregator Plus.

We hope you enjoy the screenshots and explanations below. Among these may be just that thing you also needed to be easy in Drupal.

Special thanks to Nick Veenhof of Acquia and Mads Bordinggaard Christensen of Rillbar Records who happily shared screenshots and application stories.

Example 1

by Nick Veenhof of Acquia

"My View displays a list of Search Cores. I configured the module to apply grouping on the customer name. The aggregation functions applied on remaining fields were summations on the column cells of selected fields. This is how the Document Count and Query Count columns were created."

 

 

 

Example 2

by Mads Bordinggaard Christensen of Rillbar Records

"My company is primarily a wholesale distributor of music on vinyl and CD’s. After each quarter I have to send out statements to all the different Record labels who deliver their products to us. The attached PDF is an example of a dummy record company, presenting the amount of sold items within the period.

Dummy Records have 2 different products in their catalogue. The CD has sold 32 items and the vinyl 20 within the period. These sales are however spread out on 6 different orders. So instead of having 6 table rows representing each order, I can use Views Aggregator Plus to compress and group the rows using a unique value, in this case the product SKU.

Before using Views Aggregator Plus each order of the given product had its own line, and it quickly became very unclear and messy. Some products sell a lot of items, but maybe only 1 or 2 on each order, so it can quickly result in a lot of rows (especially for the record labels who had to sum the amount of sold items in order to make an invoice for me).

So Views Aggregator Plus is a really important factor in creating these statements to our suppliers. Apart from that it allows us to quickly pull an exact amount of sold items from the database within a given period (using the date range as a contextual filter)."

 

Example 3

by Rik de Boer, founder of flink

Lastly the use-case for which Views Aggregator Plus was initially developed.

"I've illustrated the construction of the VAP View (bottom) through two intermediate phases, both normal Views. The top one shows a number of government projects (names omitted) by industry, their budgets and their durations (a duration is a Date field with start and end values).

After enabling the Views PHP module a PHP code snippet field (see below) was added to turn the date ranges into more readable keywords: "not started”, “underway” or “closed”. A copy of the PHP field was added thus creating an identical column (with a different title) in preparation for the next step.The duration column was excluded from display.

For the final View the format was flicked from “Table” to “Table with aggregation options”. The “Industry” field was grouped (compressed) and tallied, the budget value field was group-summed.

“No. projects underway” had the “Count (having regexp)” aggregation function applied with “underway” as the regular expression to count. The same aggregation function was applied to “No. projects closed” except that this time the counting parameter was “closed".

To make the “Totals” row, column sum functions were added for all fields except the first. And finally sorting was enabled… voila!"

<?php $start_date = strtotime($data->field_field_duration[0]['raw']['value']); $end_date = strtotime($data->field_field_duration[0]['raw']['value2']); echo time() < $start_date ? 'not started' : (time() < $end_date ? 'underway' : 'closed'); ?> File under:  Planet Drupal
Catégories: Elsewhere

ThinkShout: Refactoring The iATS Drupal Commerce Module

Planet Drupal - mar, 15/04/2014 - 09:00

Last month, we wrapped up a project for nonprofit-oriented payment processor, iATS Payments. iATS Payments wanted to invest in gaining wider adoption of their services and enlisted ThinkShout's help in building a PHP wrapper for their existing SOAP API.

Being a bunch of software engineers who have implemented our fair share of APIs (both good and bad), we knew we had to achieve certain goals if we were going to ease the adoption of iATS Payments within PHP applications:

  • Comprehensive: The wrapper handles all communication with the iATS Payments SOAP API, validation of API calls, and error handling.
  • Well documented: We made use of phpDocumentor to generate easily browsable documentation from our code comments.
  • Reliable: Via a comprehensive test suite covering every API call written in PHPUnit.

With the new PHP wrapper finished and unit tests passing, our attention shifted to the project we felt would most benefit from the work we'd done: the Commerce iATS Drupal module. This module leverages Drupal Commerce to facilitate payment processing via iATS Payments on any Drupal website.

We had already integrated Commerce iATS into some of our clients' websites, so we knew it was a great module, but it was written before there was a standard iATS Payments PHP wrapper and contained some unwieldy code that could be eliminated by using the new PHP wrapper. With support from the community and sponsorship from iATS, we rewrote the module, drastically reducing complexity, which any engineer can appreciate, and improved stability, which site owners love even more. We're excited to replicate the success of our partnership with MailChimp, which created a win for the community, the vendor, and, yes, ThinkShout.

Refactoring Commerce iATS

In refactoring Commerce iATS, we didn't just plug in the PHP wrapper and call it a day. While Commerce iATS was originally written with support for only credit card payments, our PHP wrapper supports all payment methods provided by iATS Payments and we wanted to make sure Commerce iATS had room to grow and take advantage of those payment methods.

Some of the problems

Looking through the code of the existing Commerce iATS module, we realized the current design would not scale well as we added additional payment methods.

As an example, take a look at the 2.x-dev release of Commerce iATS.

Here the function commerce_iats_soap_process_submit_form_submit() is being used to handle a lot more logic than a form submit handler ideally would. Breaking it down:

A lot of code in commerce_iats_soap_process_submit_form_submit() is later duplicated when commerce_iats_customer_code_charge_submit_form_submit() is called.

The refactor

We set out to redesign the module's architecture and rebuild it with modularity and expansion in mind. Here's what we did.

Created a new standard payment processing function
  • This function handles the API call, response handling, transaction creation and logging.
  • To handle multiple payment methods, the function accepts a callback function as a parameter. This callback function is the function that makes the API call via the PHP Wrapper and returns the response.

The first lines of commerce_iats_process_payment() demonstrate how the callback function is used:

<?php function commerce_iats_process_payment($payment_method, $payment_data, $order, $charge, $payment_callback) { // Process the payment using the defined callback method. $response = $payment_callback($payment_method, $payment_data, $order, $charge); Broke payment methods out into their own include files

As an example, here's the credit card payment method. Each payment method file contains these standard Commerce functions (where credit_card is the payment method:)

  • commerce_iats_credit_card_settings_form()
  • commerce_iats_credit_card_submit_form()
  • commerce_iats_credit_card_submit_form_validate()
  • commerce_iats_credit_card_submit_form_submit()

Then we added our own callback function, commerce_iats_process_credit_card_payment().

The callback function handles building the API request and getting a response from the API. To show how this works, here's a line from commerce_iats_credit_card_submit_form_submit():

<?php return commerce_iats_process_payment($payment_method, $payment_data, $order, $charge, 'commerce_iats_process_credit_card_payment');

As you can see, all the payment information from the form submit handler is being passed into commerce_iats_process_payment(). That function then calls the callback function commerce_iats_process_credit_card_payment() to make the API call and get the response.

This design is very easy to extend and allows us to add as many additional payment methods as we need in a very clean way. We were able to use this design to implement Commerce Card on File as a submodule of Commerce iATS, eliminating that dependency from the base module.

Roadmap and next steps

All our work on Commerce iATS is currently available in the 2.0-beta1 release. Please take a look and let us know if you have any feedback.

We're already hard at work along with our partners at iATS Payments to integrate more of their payment processing facilities into the Commerce iATS module. While the module currently only supports credit card payments, ACH/EFT and Direct Debit payments will arive before DrupalCon Austin. Speaking of, both ThinkShout and iATS Payments will be attending and spending some time at the iATS booth, number 508. Come find us to say hello and talk some e-commerce.

Keep an eye on the Commerce iATS project page and this blog for more updates.

Catégories: Elsewhere

Andrew Pollock: [life] Day 77: Port of Brisbane tour

Planet Debian - mar, 15/04/2014 - 07:14

Sarah dropped Zoe around this morning at about 8:30am. She was still a bit feverish, but otherwise in good spirits, so I decided to stick with my plan for today, which was a tour of the Port of Brisbane.

Originally the plan had been to do it with Megan and her Dad, Jason, but Jason had some stuff to work on on his house, so I offered to take Megan with us to allow him more time to work on the house uninterrupted.

I was casting around for something to do to pass the time until Jason dropped Megan off at 10:30am, and I thought we could do some foot painting. We searched high and low for something I could use as a foot washing bucket, other than the mop bucket, which I didn't want to use because of potential chemical residue. I gave up because I couldn't anything suitable, and we watched a bit of TV instead.

Jason dropped Megan around, and we immediately jumped in the car and headed out to the Port. I missed the on ramp for the M4 from Lytton Road, and so we took the slightly longer Lytton Road route, which was fine, because we had plenty of time to kill.

The plan was to get there for about 11:30am, have lunch in the observation cafe on the top floor of the visitor's centre building, and then get on the tour bus at 12:30pm. We ended up arriving much earlier than 11:30am, so we looked around the foyer of the visitor's centre for a bit.

It was quite a nice building. The foyer area had some displays, but the most interesting thing (for the girls) was an interactive webcam of the shore bird roost across the street. There was a tablet where you could control the camera and zoom in and out on the birds roosting on a man-made island. That passed the time nicely. One of the staff also gave the girls Easter eggs as we arrived.

We went up to the cafe for lunch next. The view was quite good from the 7th floor. On one side you could look out over the bay, notably Saint Helena Island, and on the other side you got quite a good view of the port operations and the container park.

Lunch didn't take all that long, and the girls were getting a bit rowdy, running around the cafe, so we headed back downstairs to kill some more time looking at the shore birds with the webcam, and then we boarded the bus.

It was just the three of us and three other adults, which was good. The girls were pretty fidgety, and I don't think they got that much out of it. The tour didn't really go anywhere that you couldn't go yourself in your own car, but you did get running commentary from the driver, which made all the difference. The girls spent the first 5 minutes trying to figure out where his voice was coming from (he was wired up with a microphone).

The thing I found most interesting about the port operations was the amount of automation. There were three container terminals, and the two operated by DP World and Hutchinson Ports employed fully automated overhead cranes for moving containers around. Completely unmanned, they'd go pick a container from the stack and place it on a waiting truck below.

What I found even more fascinating was the Patrick terminal, which used fully automated straddle carriers, which would, completely autonomously move about the container park, pick up a container, and then move over to a waiting truck in the loading area and place it on the truck. There were 27 of these things moving around the container park at a fairly decent clip.

Of course the girls didn't really appreciate any of this, and half way through the tour Megan was busting to go to the toilet, despite going before we started the tour. I was worried about her having an accident before we got back, she didn't, so it was all good.

I'd say in terms of a successful excursion, I'd score it about a 4 out of 10, because the girls didn't really enjoy the bus tour all that much. I was hoping we'd see more ships, but there weren't many (if any) in port today. They did enjoy the overall outing. Megan spontaneously thanked me as we were leaving, which was sweet.

We picked up the blank cake I'd ordered from Woolworths on the way through on the way home, and then dropped Megan off. Zoe wanted to play, so we hung around for a little while before returning home.

Zoe watched a bit more TV while we waited for Sarah to pick her up. Her fever picked up a bit more in the afternoon, but she was still very perky.

Catégories: Elsewhere

Pages

Subscribe to jfhovinne agrégateur - Elsewhere