Patch: PayPal WPS + Multiple Currency + Tax + Assorted improvements

11 views
Skip to first unread message

Michael Tyson

unread,
Jan 4, 2010, 4:09:37 PM1/4/10
to potion...@googlegroups.com
Hello!

I've recently set up Potion Store for my business, A Tasty Pixel - the store is now up and running with PayPal WPS at http://atastypixel.com/store.

I've written about the (quite smooth) experience here: http://atastypixel.com/blog/2010/01/04/experiences-setting-up-potion-store/

In the process, I made some changes to Potion Store, in what is hopefully a fairly sensible and reusable way, and I thought I'd share them.  Changes were made with the intention that they may find their way back to the repository, so everything's properly configurable and made to work alongside existing features.

Here are the added features:

• PayPal Website Payments Standard support (see config/paypal_wps.yml for setup instructions)
• Uses PayPal’s Payment Data Transfer feature to bring the customer back to the store and integrate with Google Analytics, and Instant Payment Notification (with all the proper verification) to actually process the order.
• Embeds all order information in PayPal item number, so no order caching is necessary (one caveat: As the coupons are embedded in the item number, which has a maximum length of 127 characters, coupon codes should be relatively short)


• Regional tax calculation and reporting
• Specify tax rates per country or per state in config/store.yml, and these will be selected automatically based on the customer’s location (obtained from their IP address).
• Includes tax details in receipt


• Multiple currency support, for adjusting price per-currency, tied to the customer’s location.
• Set default currency, and currency for admin reporting in config/store.yml
• Reports in admin will be in the specified reporting currency; amounts converted automatically
• Automatically selects currency based on customer’s location (from IP address)
• Automatically looks up exchange rates using Xavier Media’s currency API
• Manually specify regional prices for products, or let the store convert from the price in the default currency automatically

There are a couple of minor improvements too; support for running from a sub-directory instead of the webroot, extra unit tests, some formatting/javascript improvements, lengthened serial number field, and some other bits and pieces.

All additions have corresponding unit tests, all of which pass, but I'm afraid don't have the facilities to test other payment methods, other than PayPal WPS.


One patch file is the full patch, the other excludes the ‘vendor’ directory for better readability.

I hope it's useful!

Thanks so much for making this available, Andy - Potion Store was a brilliant alternative in a sea of rather underwhelming store options.

Cheers!
Michael


-- 
Michael Tyson | atastypixel.com

aim: mikerusselltyson
twitter: MichaelTyson

Michael

unread,
Jan 11, 2010, 2:40:21 PM1/11/10
to Potion Store Discussions
I discovered a minor bug in the regional price display in store
admin.. Here's an updated patch:

http://atastypixel.com/blog/wp-content/uploads/2010/01/ATP-Potion-Store-Patch-11-Jan-2010.zip

Michael

unread,
Jan 17, 2010, 7:44:31 AM1/17/10
to Potion Store Discussions
Another bugfix, this one more critical: I discovered a rounding error
in tax calculations than led to some orders failing.

Updated patch: http://atastypixel.com/blog/wp-content/uploads/2010/01/ATP-Potion-Store-Patch-17-Jan-2010.zip

If anyone's actually used this patch yet and would like an incremental
update instead of a brand new patch, let me know.

Tony Arnold

unread,
Jan 17, 2010, 7:48:14 AM1/17/10
to potion...@googlegroups.com
Hi Michael,

Cool stuff!

I'd love to see you fork the main git repository and commit your changes to Github. That might make it easier to cherry pick the features based upon your changes.

thanks,


Tony Arnold

dreamcat four

unread,
Jan 17, 2010, 9:05:04 AM1/17/10
to potion...@googlegroups.com
Yeah, me too thanks, its good work :)
+1

On Sun, Jan 17, 2010 at 12:48 PM, Tony Arnold <tonya...@gmail.com> wrote:
> I'd love to see you fork the main git repository and commit your changes to Github. That might make it easier to cherry pick the features based upon your changes.
>
> thanks,
>
>
> Tony Arnold
>
>
>
>

> --
> You received this message because you are subscribed to the Google Groups "Potion Store Discussions" group.
> To post to this group, send email to potion...@googlegroups.com.
> To unsubscribe from this group, send email to potion-store...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/potion-store?hl=en.
>
>
>
>

Michael Tyson

unread,
Jan 17, 2010, 9:30:01 AM1/17/10
to potion...@googlegroups.com
Hi Tony,

Wow, I had no idea I could do that.  Brilliant.


I googled for about 20 minutes or so trying to figure out how to switch/rebase a git repository to track that fork, but couldn't figure it out.  I thought it might look something like "git pull --rebase g...@github.com:michaeltyson/potionstore.git master", but it's apparently not.  The man-page is a little too jargon-ful to really help ;-)
Any ideas?



On 17 Jan 2010, at 13:48, Tony Arnold wrote:

Cool stuff! 

I'd love to see you fork the main git repository and commit your changes to Github. That might make it easier to cherry pick the features based upon your changes.

thanks,


Tony Arnold

dreamcat four

unread,
Jan 17, 2010, 11:19:32 AM1/17/10
to potion...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages