Hello,

Basic Cart seems to be a nice upcoming project, integration would be great :)
http://drupal.org/project/basic_cart
http://drupal.org/project/payment

======
Module maintainer edit

Help us integrate Basic Cart with Payment

The campaign goal is to integrate Basic Cart with Payment, so customers can pay for orders, while keeping Basic Cart light-weight. With your support, the code for this can be written, and documentation can be published to help you use Payment quickly and easily.

Help finance this Indiegogo Campaign and together we will make this possible.

If you like Basic Cart and would like to have a payment possibility, please support our campaign.

Comments

xano’s picture

Component: User interface » Code
Status: Active » Postponed

This project will never provide that integration, since it is too specific and we cannot ship with support for all sorts of third party payment methods or webshops. That would make this project too hard to maintain. Instead, a separate project will have to be created that provides integration between Payment and Basic Cart. I will mark this issue postponed, so it will be visible in the issue queue and anyone wanting to provide this integration can link to the newly created project here.

xano’s picture

Title: Integrate with Basic Cart » Payment/Basic Cart integration
Project: Payment » Basic Cart
Status: Postponed » Active

Moving this to the Basic Cart queue so we can discuss this feature with the Basic Cart maintainer.

The idea is that Basic Cart can use Payment to allow orders to be paid. Basic Cart itself can remain very basic, as it will only require a small bridge between payments and orders; Payment can process all payment-related information and all Basic Cart will need to do is display the payment form and store the order and payment IDs together so they can be linked.

alex dicianu’s picture

This is an interesting idea ... Like you said, I would like to leave Basic Cart in a basic form and add another submodule to it, which can be called Basic Cart Payment (that depends on Payment for example). This way, when the webmaster activates the payment module, the payment form will appear in the checkout process.

xano’s picture

Exactly. A very basic integration module could do the following:

  • Provide payment forms for orders by constructing a Payment object and displaying payment_form().
  • Maintain a DB table that links order IDs to Payment IDs.
  • Implement hook_payment_status_change() to update orders once their payments are completed.

The module would not need to know about payment methods, nor would it have to do any form magic, because all that is part of Payment. If you'd like more information, I'm available on IRC as well.

alex dicianu’s picture

Cool stuff!! :-)
At a glance, this seems really simple and easy to integrate ... I'll try to do it for the next beta release. I could start only with the basic integration and if the need would occur, other features would be added along the way.

PS: I think I'll contact you on IRC to talk a bit about testing the payment process. I'm not too keen on spending 1€ or so every time I test it ... ;-) Or maybe you can just send me an email through the contact form with the testing procedure ... I'm not sure it will be a good idea to publish it here for everyone to see.

xano’s picture

Oh that's all very easy to accomplish. Testing can be done without transferring any money at all. Just ping me on IRC and I'll walk you through the details :)

xano’s picture

@dicix: have you been able to make any progress with this?

alex dicianu’s picture

No quite ... I've been really busy with a freelance project I've contracted. Hopefully, I'll finish in the next couple of days. So this week, with a bit of luck will be Basic Cart - Payment week :)

xano’s picture

How's it going? If you will be in Munich next week (I'll be there too), I can help you if anything is still unclear.

xano’s picture

Any updates? I just committed a big update to the payment form. Instead of payment_form(), we now have payment_form_embedded() and payment_form_standalone().

alex dicianu’s picture

Yeah!!! Nice :)
I was actually waiting for this feature ... Another thing that is causing me some headaches is that the form is payment method agnostic and currently the only payment method available is iDEAL. I saw a future Paypal integration in progress.

In my opinion, just by enabling Basic_cart_payment (the integration module) and Paypal as a payment method would allow users to proceed with the online payment. Do you have any idea as to when the Paypal method will be available? I saw a recently added module (on September 2, 2012) called Payment Paypal. This might be just what we're looking for ... Only problem is that the module is still in dev.

What do you think of it?

xano’s picture

The MAJOR flaw of past payment solutions was that contexts (forms, webshops, etc) were not payment method agnostic and vice versa, so this agnosticism in Payment is definitely by design, to ensure interoperability.

I have no idea when Paypal will be available, because I am not its maintainer. I will continue working on one or two payment methods of my own in a short while, but it will take a few months before we have a handful of stable payment methods. That's the price of working with new technologies :)

xano’s picture

I see you released RC1 this week. I assume everything's going smoothly? :)

alex dicianu’s picture

Yes, I released the RC1 because there were some annoying bugs that I wanted to get rid of :)
Regarding the integration, it's actually really slow and tedious. I am actually trying to integrate paypal as well, following the Ubercart model.

I found some bugs in the payment test method. For instance, when trying to add the test method, the save can't be completed because of some internal error. I also had some validation problems regarding the payment methods (empty descriptions, fallback methods) where the validation message wasn't so clear (empty catch {}). Here is an example below from the payment.classes.inc:

function availablePaymentMethods(array $payment_methods = array()) {
  if (!$payment_methods) {
    $payment_methods = entity_load('payment_method', FALSE);
  }
  $available = array();
  foreach ($payment_methods as $payment_method) {
    if ($payment_method->enabled) {
      try {
        $payment_method->validate($this, FALSE);
        $available[$payment_method->pmid] = $payment_method;
      }
      catch (PaymentValidationException $e) {
      }
    }
  }

  return $available;
  }
}

Anyway, it's still work in progress. I hope I'll finish it soon :)

xano’s picture

Payment::availablePaymentMethods() only needs to know which payment methods are available to a certain payment and does not care why a payment method is not available, that's why it doesn't do anything with the exception. By default, though, all PaymentExceptions are logged and displayed on screen.

xano’s picture

If you're still having trouble grasping the concept, I created the Payment handbook which should explain it.

alex dicianu’s picture

Hi Xano,
Yes, good idea :) I have more or less, understood the concept, but the documentation is really helpful.

xano’s picture

See http://drupal.org/node/1809680 for a more extensive explanation about your questions from #14.

xano’s picture

I am looking at your payment integration branch. Here are my thoughts:
- You are wrapping Payment's payment methods in your own callback in basic_cart_payment_payment_methods(), why? To allow other payment platforms to hook into Basic Cart (which makes Basic Cart more flexible, but also less basic).
- You are not using Payment::availablePaymentMethods() to check whether a payment method can actually be used to process a payment. Not doing so can cause bad UX for customers since they will be presented with payment methods that cannot be used and choosing one of them will result in failed payments no matter what.
- Take a look at Payment for Drupal Commerce, Payment for Webform, Payment Form Field, or Payment Reference Field for examples of how to write a context for Payment.
- Implementing hook_payment_line_item_info() allows your Basic Cart line items to be manipulated through the UI.

inferno_msk’s picture

Integration with userpoints planned?

xano’s picture

@inferno_msk, please don't hijack issues. If you would like to request another feature, create another issue dedicated to it.

xano’s picture

@dicix: Is there any progress on this issue, or do you have any questions you would like to have answered?

alex dicianu’s picture

@Xano: I would love to work on this issue, but I have very little to no time for it. If someone could help me with some patches, it would be much appreciated.

Seph’s picture

Curious as to where this is? I have a project that would be great to use this on. Is it usable yet?

alex dicianu’s picture

It's still work in progress ...

xano’s picture

With more people getting interested in this feature, it may be a good idea to publish a roadmap, so people can discuss the specifics of the implementation and maybe start working on patches. Also, if you are already working on a patch, please post it here, so people can post re-rolls and help with testing.

jorditr’s picture

I just add my opinion here. I think that having a "light" ecommerce environment is a good thing, after years of working with Ubercart and seeing how Commerce, evolves Basic cart is a good contender. In Drupal 7, with the help of Views, Rules and other modules, Basic Cart helps building something simple, but that could be powerful. The point on ecommerce solutions is payment... and the Payment module has a good strategy, trying to be an independent layer of payment that could be adopted even by the big Drupal ecommerce solutions. It would be sweet that Basic cart and Payment integrates. But, well, that's just my opinion :-)

Thanks for your efforts.

alex dicianu’s picture

I finally have some time to work on this issue. I'm trying to make this work on the branch 7.x-2.x-payment-integration.
I'm currently having problems executing the payment. After selecting the payment method, I run the following lines of code, but unfortunately nothing happens. I don't get redirected to the paypal interface ...

$payment = basic_cart_payment_get_payment($order->nid);
$payment->execute();

@Xano, can you please have a look and see what am I doing wrong?

Thanks.

xano’s picture

I have no idea how your code is set up, but you may not want to try with Paypal, but with a basic payment method, as it is easier to debug.

andypost’s picture

So the code lives in 7.x-2.x-payment-integration branch in repo so basic_cart_payment.module

c13l0’s picture

Subscribing. This is exactly what I need. Sorry to not be able to help out with the code. Thanks for all the work put into this module to add the payment. Paypal is probably perfect for most small business use case scenarios.

xano’s picture

Basic Cart is already used by 500 sites and it seems the maintainer may not have sufficient time to dive into Payment's API to get integration off the ground. If more people are interested in having Payment integration, I can start a Kickstarter project like Kickstarter* that will allow me to add this integration for you.

*) Kickstarter itself does not operate in Europe, which is where I am based.

alex dicianu’s picture

This is actually a very good idea. I fully support this and will also chip in.

IWasBornToWin’s picture

Not to sound too stupid, but why would anyone use this module and not receive a payment? Maybe as a pre order, and then contact customer to retrieve payment info?

What are my options right now? It looks like you're working on some type of payment collection here, just wondering what I can do until that happens.

The simplicity is great, thanks.

IWasBornToWin’s picture

?

kerrycurtain’s picture

I too would love to see Basic Cart integrated with Payment. We only have a few items for sale on our site and the simplicity of Basic Cart is perfect.

Without an immediate payment system there are customers that change their mind between placing the order and our contact. Payment on checkout secures customer commitment to the order.

Payment would definitely improve the effectiveness of this great little module. Hoping this is possible.

xano’s picture

I just launched an Indiegogo campaign to support the development of this feature. The funds will be used to cover the time to write the code, test it, and provide documentation on how to use the newly added features.

For those of you who are unfamiliar with Indiegogo: it is a crowfunding platform. This allows people and organizations to receive funding (money) from a lot of different people (the crowd), without all those different people having to know each other.

My name is Bart and I am the developer listed at the bottom of the campaign page. I will develop the integration between the two modules and I am in contact with Alex Dicianu (@dicix, Basic Cart's maintainer) to make sure everything goes well. All development will happen here in the issue queue to ensure transparency and that everybody can give feedback.

xano’s picture

Issue summary: View changes

hhihkihk

xano’s picture

We just received our first donation. Thanks!

Note that if everybody in this thread supports the campaign with just €100, we can have this integration within a few weeks and you won't even have to spend time on it!

xano’s picture

Issue summary: View changes

Indiegogo campaign

xano’s picture

The campaign will last for 20 more days (it ends on December 28) and at this moment we have raised €30. We are thankful for the donations so far, but this is not enough to get anything serious done. We'd love it if some more people can chip in, so we have at least a couple hundred euros, which allows us to spend some decent time on this issue and make the integration happen in January 2014. Thank you!

IWasBornToWin’s picture

Issue summary: View changes

Is there ever a plan to add paypal or any payment option to this module? Are there really people online needing a shopping cart WITHOUT an ability to collect the money right then? Should anything in life with the words "Shopping cart" also have some sort of money changing capability? Or am I the slow one here?

IWasBornToWin’s picture

Priority: Normal » Critical
velocis’s picture

I love the simplicity of Basic Cart
I have already written a PayPal sub module that sits nicely into basic cart without having to mod basic_cart or basic_cart_order.
Just talking to dicix to work out the best way to release it and if he wants to support that direction.
The model I have built allows for multiple payment processors to be loaded in, I am half way through writitng the one for www.eway.com.au (an Australian processor)

My work is not in competition to the integration into payment work, but rather a simpler more lightweight alternative until that is finished.

Stay tuned.

travisc’s picture

Doh I missed the crowd funding by a few years, what do we need to do to get this done?

@Alex Dicianu How far would you say this is this along http://cgit.drupalcode.org/basic_cart/commit/?h=7.x-3.x-payment?

Based on the Indygogo estimate, we are not looking at more than 20 hours development. Wonder if that has changed for the 3.x branch?

travisc’s picture

So far it looks like the branch http://cgit.drupalcode.org/basic_cart/commit/?h=7.x-3.x-payment? is basically working with Paypal Standard Payment at least.

Found some issues with Tokens

Tokens Problems detected
The following tokens or token types are not defined as arrays:

$info['tokens']['basic_cart_order']['products']
The following token types are not defined but have tokens:

$info['types']['basic_cart_order']

Will report on what else i find.

matthieu_collet’s picture

Hello

it works with the last dev branch, but when you come back from paypal you have a blank page, without confirmation. payment is saved in module payment, but nothing else

I have this notice :

Notice : Undefined variable: view dans basic_cart_payment_finish() (ligne 141 dans /..../sites/all/modules/basic_cart/basic_cart_payment/basic_cart_payment.module).

somebody else has the problem ?

just to remove comment in the last function :

//drupal_goto('checkout/thank-you');

pfhenley86’s picture

Hi,

The module is awesome! It would be great if there was an ability to customize the form fields on checkout. I am using a webform to get other options for the payments and then it redirects to the cart so for my case it's a bit tedious to fill out another form on check out. If there is already a way to add/remove checkout values please let me know! Thanks.

norman.lol’s picture

Status: Active » Closed (outdated)

Thank you everyone for taking the time to report and discuss this issue. 🙇🏻‍♂️

As the Drupal 7 versions of this module are no longer supported, I’ll be closing this issue. 🔚

Huge thanks and credit to everyone who contributed in any way. ✨

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.