Author Topic: Beanstream payment method for Virtuemart  (Read 28599 times)

rwcorbett

  • Beginner
  • *
  • Posts: 18
Beanstream payment method for Virtuemart
« on: December 17, 2009, 18:21:25 pm »
Hi there all,

Just so you know - I don't really have time to maintain this... and am busy so if I don't reply to your questions then it's not because I don't like you, it's because I am too busy! This is released under the MIT Licence so you can use it however you want, but I will not be officially supporting it.

I have worked up a new payment method to communicate with Beanstream (also works with TD Canada Trust's OnlineMart). It is based on the built-in PayPal module and is a variation on the idea given to me by erikas_boy (gotta give credit where credit is due - thanks Chris!). Everything you need - including setup examples - should be in the .zip

Code: [Select]
* Beanstream Payment Processing Plugin
* - takes the customer offsite to enter in the creditcard info on Beanstream's server
* - the DB is queried to auto-fill most of the sections on the form
* - the payment form option for "Allow Price Modification" should be set to 'no' on your
*   Beanstream control panel
* - HOW TO INSTALL: (see images included in the zip)
* 1) YOU WILL NEED TO FILL YOU MERCHANT ID IN ON LINE 51 below.
* 2) create a new payment method using payment class = ps_payment & method type = HTML-Form based
* 3) copy and paste this entire PHP block (line 1 to line 70) into the configuration block
*
* based on the PayPal module that is included with VirtueMart
* date: 16 Dec, 2009
* written by Robb Corbett

{edit: it is now on gitHub} fork project or download from here : https://github.com/rwcorbett/VirtueMart_Beanstream_Payment_Method

{edit: it's really just a simple PHP form submit to Beanstream's payment site. I modded some files that existed in in the default VM install to make them talk with Beanstream. It was done when working on Joomla 1.4 (I think) and an old version of VM. But please take alook and then write your own implementation based on this as I'm sure that the newer versions of Joomla, VM, and the Beanstream API will require you to change things anyways.}

Have Fun!  ;)

-Robb

jboulton

  • Beginner
  • *
  • Posts: 14
Re: Beanstream payment method for Virtuemart
« Reply #1 on: March 21, 2010, 03:06:09 am »
With Beanstream and Virtuemart are you able to have subscription payments and Interac transactions?

I am not a Beanstream client; however I am looking into their services.  I am currently an Internetsecure client and use Authorize.net with them; however I can't incorporate subscription payments or Intarac transactions with the Authorize.net payment module.


Syn

  • Beginner
  • *
  • Posts: 29
Re: Beanstream payment method for Virtuemart
« Reply #2 on: April 09, 2010, 04:00:46 am »
Thanks for creating this.  I haven't installed it yet, but are there any bugs that you've noticed?

Has anyone else tried this?

rwcorbett

  • Beginner
  • *
  • Posts: 18
Re: Beanstream payment method for Virtuemart
« Reply #3 on: April 19, 2010, 13:40:23 pm »
Thanks for creating this.  I haven't installed it yet, but are there any bugs that you've noticed?

Has anyone else tried this?
Thanks! My client (there's only one using it right now) hasn't reported anything to me yet so I can't say for sure...

With Beanstream and Virtuemart are you able to have subscription payments and Interac transactions?
... I can't incorporate subscription payments or Intarac transactions with the Authorize.net payment module.
I haven't tried this with Interac yet - my client didn't have that option. They're website does say that they accept it though - maybe try the customer support/tech suport at 1.888.472.2072. Found at their site: http://www.beanstream.com/public/index.asp

shamsmughal

  • Beginner
  • *
  • Posts: 4
Re: Beanstream payment method for Virtuemart
« Reply #4 on: June 10, 2010, 17:43:22 pm »
Hi, I am trying to figure out the way to customize the BeanStream so it should send the confirmation email when the Order is confirmed from BeanStream Payment Processor.

Right now, it sends the confirmation email before the anything is approved by BeanStream.

Please help

rwcorbett

  • Beginner
  • *
  • Posts: 18
Re: Beanstream payment method for Virtuemart
« Reply #5 on: June 10, 2010, 18:23:18 pm »
Right now, it sends the confirmation email before the anything is approved by BeanStream.
2 quick questions:
- what is sending the email? Joomla, Virtuemart or Beanstream?

- is your page receiving the confirmation POST variable in the HTTP header?

Could you maybe post some code so we can see what you're working with? (you can exclude your merchant ID and personal stuff.

shamsmughal

  • Beginner
  • *
  • Posts: 4
Re: Beanstream payment method for Virtuemart
« Reply #6 on: June 10, 2010, 20:56:28 pm »
rwcorbett, thanks for your prompt reply.

I have copied your code and instructions at the top of this post. I go to my Virtumart Administration then Add Payment Method. Set up the BeanStream configuration as you posted in this thread.

When from the cart we submit order, it goes to the beanstream page where we have to fill out our payment information. As when we are filling the information, a mail received that "The Following order was received." Even we didn't submit the payment form yet.

In one other thread I found there are two files to be placed in administrator/components/com_virtuemart/classes/payments/  one is ps_beanstream.php and other is ps_beanstream.cfg.php.

We have not included this because there are no attachment with your post.

Please help

rwcorbett

  • Beginner
  • *
  • Posts: 18
Re: Beanstream payment method for Virtuemart
« Reply #7 on: June 10, 2010, 21:43:17 pm »
As when we are filling the information, a mail received that "The Following order was received." Even we didn't submit the payment form yet.

There is nothing in my PHP code that is sending email so it is one of those other things I mentioned that is sending it. Who is the mail from? Can you post the mail header for me?

In one other thread I found there are two files to be placed in administrator/components/com_virtuemart/classes/payments/  one is ps_beanstream.php and other is ps_beanstream.cfg.php.

We have not included this because there are no attachment with your post.
No - I decided to use the built in HTML payment method - my 'module' is simply a PHP/HTML script that submits the payment to Beanstream... so no, I did not write the ps_ files.

rwcorbett

  • Beginner
  • *
  • Posts: 18
Re: Beanstream payment method for Virtuemart
« Reply #8 on: June 10, 2010, 22:17:01 pm »
hmmm... it looks like the email is coming from Virtuemart to me. Check the settings for the store and get back to me.

shamsmughal

  • Beginner
  • *
  • Posts: 4
Re: Beanstream payment method for Virtuemart
« Reply #9 on: June 10, 2010, 22:26:18 pm »
Robb, Store settings are seems to be perfect. As per my understanding, when using PayPal IPN we can customize the http response. But with BeanStream not getting the right way. I have checked all the files with no luck.

Please help.

rwcorbett

  • Beginner
  • *
  • Posts: 18
Re: Beanstream payment method for Virtuemart
« Reply #10 on: June 11, 2010, 01:05:59 am »
As per my understanding, when using PayPal IPN we can customize the http response.
Yes, PayPal IPN can do that, but my method doesn't use that as far as I know... what do you have the "Payment class name" set to on your "Payment Methods" admin page? IT SHOULD NOT be using the ps_paypal one... it should use ps_payment, VirtueMart's generic payment PHP processor.
I know that ps_paypal does contain PHPMailer code... but neither ps_payment or my Beanstream addon do not.

Check that first... but if that is not it then try looking at: /administrator/components/com_virtuemart/notify.php or
/administrator/components/com_virtuemart/classes/payment/ps_payment.php

and see what you can sort out. Also, trace your HTTP headers before, during and after the transaction... maybe we can find out where this mystery email is being generated from.

Since my client (there's only one using it right now) hasn't really complained about anything of that nature yet I have had no reason to disrupt their site with further development so I'm not really able to re-write the module at this time, too many other things going on.

I can help you try to troubleshoot if you get me that info...

rwcorbett

  • Beginner
  • *
  • Posts: 18
Re: Beanstream payment method for Virtuemart
« Reply #11 on: June 11, 2010, 01:07:43 am »
oh and @ shamsmughal... your're going to want to go into your previous post and edit out the email addresses and IP routes... just replace them with xxxxxxx@xx.xxx or something. No need for unwanted spam!  ;D

-Robb

shamsmughal

  • Beginner
  • *
  • Posts: 4
Re: Beanstream payment method for Virtuemart
« Reply #12 on: June 11, 2010, 16:07:02 pm »
Rob, I didn't understand your last post. What email address and Ip routes and unwanted spam?

I have checked the notify.php and ps_payment.php. I think notify.php is only used for paypal and we can not use with BeanStream.

As ps_payment.php is the default process for the ones who don't have their own class.

Can you please tell me where I can find the default code for sending confirmation email?

Thanks

rwcorbett

  • Beginner
  • *
  • Posts: 18
Re: Beanstream payment method for Virtuemart
« Reply #13 on: June 11, 2010, 17:40:58 pm »
Rob, I didn't understand your last post. What email address and Ip routes and unwanted spam?
the whole world can see your email address and IP's here: http://forum.virtuemart.net/index.php?topic=64471.msg239933#msg239933
Quote
Can you please tell me where I can find the default code for sending confirmation email?

I think that you are trying to do something like this:
insert at line 60:

Code: [Select]
// ## SEND AN EMAIL ##
// NOTE: I haven't tested this mailout yet... it could be modified to
// send a confirmation email upon successful transaction. I am not sure which
// variables Beanstream sends back to server upon successful (or failed) transaction.
$to = "foo@example.com";
$subject = "the subject";
$message = "hello world from PHP Mail\nthe transaction ID was " . $db->f("order_id");
$headers = "From: bar@example.com" . '\r\n' . "Reply-To: bar@example.com" . '\r\n' . "X-Mailer: PHP/" . phpversion();
mail($to, $subject, $message, $headers);
// ## END PHP MAIL ##

NOTE: I haven't tested this mailout yet... it could be modified to
send a confirmation email upon successful transaction. I am not sure which
variables Beanstream sends back to server upon successful (or failed) transaction.

Syn

  • Beginner
  • *
  • Posts: 29
Re: Beanstream payment method for Virtuemart
« Reply #14 on: July 02, 2010, 20:47:41 pm »
Thanks for your great work rwcorbett.  Will this process American Express payments too?