awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
864 stars 475 forks source link

Introduce EDD_Gateway #4195

Open cklosowski opened 8 years ago

cklosowski commented 8 years ago

Much like in RCP and the 2.4 release of recurring payments, create a Base Gateway class for other gateways to extend.

pippinsplugins commented 8 years ago

The new EDD_Recurring_Gateway class is also going to be a good starting point.

pippinsplugins commented 7 years ago

Note: we should build a sample gateway / doc that gets published when this is live.

brashrebel commented 7 years ago

Models: https://github.com/restrictcontentpro/restrict-content-pro/blob/master/includes/gateways/class-rcp-payment-gateway.php https://github.com/woocommerce/woocommerce/blob/master/includes/abstracts/abstract-wc-payment-gateway.php

sunnyratilal commented 7 years ago

Tracking PR setup at #5382

pippinsplugins commented 7 years ago

Also look at the EDD_Recurring_Gateway class as a model please.

pippinsplugins commented 7 years ago

@sunnyratilal looking good! A few notes on the progress:

  1. We should use EDD_Payment and not edd_insert_payment() to create the payment records. This is our chance to get rid of the really confusing and difficult to use $purchase_data array.

  2. The payment creation should be handled by the base gateway class so that gateways do not have to do it themselves. Gateways should be able to overwrite the order creation but it should not be required.

sunnyratilal commented 7 years ago

@pippinsplugins Should the $purchase_data be passed into the constructor for EDD_Gateway and then class variables be set up? Similar to that of RCP_Payment_Gateway?

pippinsplugins commented 7 years ago

Yes I think so

On Wed, Jan 18, 2017 at 6:39 PM Sunny Ratilal notifications@github.com wrote:

@pippinsplugins https://github.com/pippinsplugins Should the $purchase_data be passed into the constructor for EDD_Gateway and then class variables be set up? Similar to that of RCP_Payment_Gateway?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/easydigitaldownloads/easy-digital-downloads/issues/4195#issuecomment-273647569, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_HfY0DPJp7FWRfjUU4OSpiyWf2wj_qks5rTrC7gaJpZM4HFhfv .

pippinsplugins commented 7 years ago

@sunnyratilal looks like we're making great progress here, but I'm a bit concerned with this being completed so close to the beta release.

I think we should punt and then finish early in the 2.8 cycle to help ensure we don't break anything.

cklosowski commented 7 years ago

I'm seeing this both ways.

  1. By including it in a major release, it's only ever going to hit release/2.x branch, never master until the release is ready. Because of this it's unlikely we'll get people testing it out much past a few devs who install betas. Because of that, earlier in the cycle is better.

  2. Same argument, but it means we've got less impact to more users.

If we postpone it to 2.8 i'm fine with that, but I want it to be one of (if not the) the first things we hit and a blog post months ahead of the beta release.

sunnyratilal commented 7 years ago

After discussing with @cklosowski, I'm happy to punt to 2.8 as well.

pippinsplugins commented 7 years ago

One of the most important things, I think, however, is that we have it running on our own sites for a few weeks, and that we continually test other development on top of this. This close to beta means that won't happen.

Let's hit this as early as possible in 2.8.

sunnyratilal commented 7 years ago

For future ref: we need to implement port and test the changes introduced in #4422 to EDD_Gateway_PayPal