Tag: WordPress

WordPress PHP PayPal Payout Helper Class

View on GitHub

At-A-Glance

Platform: WordPress
Language: PHP
Keywords: RESTful API, PayPal, eCommerce, WooCommerce

Overview

We live in an international, interconnected world. We work for one another on all sorts of solutions. And we all want to get paid for our work, right? Right.

It’s not uncommon for people to use a CMS like WordPress to advertise, facilitate, and implement their business. And when doing so, an eCommerce platform handles all of the sales, taxes, and so on. But what if we’re not paying for a product, but rather providing payment to another person for a service rendered?

The client in this example is running a business in Australia, and connects those needing professional SEO services with qualified freelancers. The desired solution would not only ensure the proper flow of payment from the former to the latter, but also automate the process so that recurring contracts with a monthly or bi-weekly payout schedule would take place without requiring manual input.

Approach

The prevailing idea was to have a solution that was as seamless as possible with current WordPress and WooCommerce functionality. The modularity of WordPress and, by extension, WooCommerce means that new classes to handle a situation like this can be added onto the platform is relatively straightforward. With that in mind, I worked to craft a class that drew the information required from existing sources, work it through the PayPal API, and update all of the pertinent data without interfering with other processes.

In most instances, this is a process that is done manually. By automating things, we could make the work of the client more smooth, provided that we could ensure the success of these transactions should they run automatically as a CRON job based on whenever the appropriate payout should be made, as well as checking for the proper currencies on payout.

Result

Thanks to the functionality of WooCommerce and PayPal, the incoming currency was the only type that requires a callout. Once the recipients information is entered and the transaction started, PayPal handles the rest. However, giving it the incoming currency is crucial, in that PayPal is informed that default currency values should not be used.

Then, it’s a matter of making sure the correct credentials are culled for both payer and recipient from the WordPress database. This information is entered by both parties as part of their registration for the site. The class consolidates this information and, along with the currency type and amount, facilitates the transaction.

Code Monkey Flails At Code

Courtesy Plognark.com

*makes various ‘ook’ and ‘eek’ sounds*

*slaps paws against keyboard*

*throws monitor*

So over the last few months I’ve been learning a lot about myself.

In addition to exploring my inner mental and emotional landscape, coming to terms with seizing my own sovereignty, and doing my utmost to unlearn some nasty learned behaviors, I’ve made strides in returning to a dayjob that is rewarding in both a personal and financial aspect. A couple of weeks ago, I finally found one. I’m very happy to be here.

But ye gods and little fishes, is it frustrating sometimes.

I’ve discovered that I’m actually a pretty logical thinker. To me, A should lead to B which results in C. However, sometimes my head weasels try to derail that and take me from A to B by way of Z. That’s dumb, and I’m getting better at not doing it. Even if sometimes my boss has to say “Josh, are you making things harder than they have to be again?”

I’m still not sure where I picked up my habit of trying to play life on Hard Mode.

Since I started working here, I’ve had several jam sessions regarding programming logic and order of operations related to specific tasks and goals. It’s been difficult at times for me to comprehend what goes on under the hood of certain functions, as at first the logic seems to fly in the face of common sense. However, taking a step back to realize what the code is actually doing as opposed to what we want it to do has helped. I’m still frustrated, to be sure, but at least I better understand why the hell the thing I want to work is not working.

“Hey, am I just dumb, or is it this code that’s dumb?”

That’s in jest. I know I’m not dumb. I can just overlook a fact or miss an aspect of a function that makes a thing work the way it should.

We’re looking at moving on from using WordPress as our foundation for our products, and building something in more modern, secure, and malleable code structures. I feel that getting tossed into the deep end of the current workload here has prepared me for that sort of looking ahead. I know this work will be worth it.

Man oh man, it hurts sometimes, though.

It’s like going to the gym after you’ve skipped out for a while. Or getting back to long-distance running after taking the winter off because fuck that, it’s cold outside. It hurts. You ache, and you struggle to breathe, and why in the name of all that’s good and awesome am I doing this to myself. But it’s worth it. Soon it won’t hurt so much. And the results will be even more magical than they are now.

Until then, it’s poo-tossing time.

*ook ook eek*

Thursdays are for talking tech.

Change is Coming

Courtesy norebbo.com

Change is never easy. But it is necessary. Growth and change are what make us alive. They are dynamic elements to existence; without them, we stagnate and remain static, which to me is worse than death. I’ve been meaning to make some changes to this webspace for a while, now, and I think the time is near to do just that.

My plan is to do as some of my contemporaries have done, and move the blog you’re currently reading to a location subordinate to the main page. The main page can then feature my products, my services, my broadcasts, my efforts for fundraising, and all of that good stuff. I think it’s a bit more professional to have that sort of thing front and center, and this sort of thing available if you really want it, but not “all up in your grill” as soon as you plug in my address.

If any folks who’ve made this transition have tips, please let me know! Also if there are good themes to download and/or worth an investment, I’m all ears. I’m hoping that making changes to the site, and to what I can do in terms of telling stories and entertaining people, will make 2015 the best year yet.

Behold, the Webfolio!

Web Alchemy

It’s been a busy week for me, and it’s far from over. My mind’s practically on fire with everything coming at me, and I knew there was something necessary to start tying things together, to fully utilize that fire in a productive way. I needed a single location to feature my work, easy to locate and quick to load, to which I can point those interested in seeing exactly what I bring to the table in terms of programming skill and web-based creativity.

Hence, the webfolio!

Featuring projects past and present, I mean to provide little snapshots of my adeptness at programming, my willingness to work on a team and my propensity for trying new things. I’ll be updating this as my experience grows, but for now it features four of my best sites to date.

Waterfall Jewelers, featuring what may be my programmatic pride and joy to date: a Flash-based Pandora build-a-bracelet app;

Ellipsis Enterprises, an agile little brochure site;

Specialty Ring Inc., a site featuring JQuery drop-down navigation and real-time AJAX form authentication;

and GoreCon Inc., a brochure site including a WordPress blog skinned to reflect the shiny design.

More to come, as my skills and opportunities continue to grow!

© 2024 Blue Ink Alchemy

Theme by Anders NorenUp ↑