News:

Support the VirtueMart project and become a member

Main Menu

Beanstream payment method for Virtuemart

Started by rwcorbett, December 17, 2009, 18:21:25 PM

Previous topic - Next topic

Syn

I've been playing with this payment mod for a few days now and it's definitely well done.  However, it doesn't seem to log payment information on the backend, especially if the transaction was declined.  Was it meant to do this, or was this not implemented?

I'm still trying to figure out what exactly is done on the beanstream end of things and what needs to be implemented directly from our end.  In testing though, it has generally worked well.

rwcorbett

Thanks @Syn!

I haven't implemented American Express... is that maybe something that BeanStream does?

As for backend logging... it wasn't a requirement for my client so I didn't implement it.

It really shouldn't bee too difficult if you know your way around PHP and MySQL.

What is it that you are trying to do with backend logging specifically?


rwcorbett


Syn

Quote from: rwcorbett on July 15, 2010, 15:12:46 PM
Thanks @Syn!

I haven't implemented American Express... is that maybe something that BeanStream does?

As for backend logging... it wasn't a requirement for my client so I didn't implement it.

It really shouldn't bee too difficult if you know your way around PHP and MySQL.

What is it that you are trying to do with backend logging specifically?

I basically wanted to have the payment log recorded on the Virtuemart backend.  Your solutions works well, but in this partcular case I needed something that records the payment info on the backend and also prevents orders from being confirmed if the transaction is declined.

I implemented the other solution on this site, that was created a few years ago.  It seems to be working well.

rwcorbett

@Syn

could you forward me the link to that solution! I must have missed it (hence I wrote this) and would like to try it out  ;D

thanks in advance!


kraymitchell

Has anything been done on this mod for the backend payment info being recorded? Wouldn't want confirmations sent out when they were declined!


GooRu

Hi...

Any chance you have some code that does not transfer to Beanstream but does it on site?

Curt


Quote from: rwcorbett on December 17, 2009, 18:21:25 PM
Hi there all,

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



* 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 / Cape Breton Web Design
* (c) Robb Corbett / Cape Breton Web Design
* contact me at: robb@cbwebco.com -or- robb.corbett@gmail.com
* if you choose to use this implementation you are welcome to, but please leave this header
*   inplace. I assume no liability for the functioning of this module on your site.


{edit: fixed url, again} HERE IS A LINK TO THE FILE : http://rwcorbett.ca/Beanstream%20Payment%20Method.v1.1.zip

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.

Have Fun!  ;)

-Robb

robb [at] cbwebco.com
www.capebretonwebdesign.com
Joomla Web Development, Hosting and site management


GooRu

There is a company that will write the gateway for $200. Anyone want to get in on it?

This will be for a Beanstream gateway that transacts on the clients site.
Joomla Web Development, Hosting and site management

madscience

I have Joomla 1.5.15 and this doesn't work for me.
I'm not sure why either.
on my end this is the last screen i get:


Thank you for your order.

Success Your order has been successfully placed!

A confirmation email has been sent to: admin@XXXX.com

$db1 = new ps_DB(); $q = "SELECT country_2_code FROM #__vm_country WHERE country_3_code='".$user->country."' ORDER BY country_2_code ASC"; $db1->query($q); $url = "https://www.beanstream.com/scripts/payment/payment.asp"; //https://www.beanstream.com/scripts/payment/payment.asp?merchant_id=XXXXXXXXX $fName = $dbbt->f("first_name"); $lName = $dbbt->f("last_name"); $tax_total = $db->f("order_tax") + $db->f("order_shipping_tax"); $discount_total = $db->f("coupon_discount") + $db->f("order_discount"); $shipping = sprintf("%.2f", $db->f("order_shipping")); $post_variables = Array( //"errorPage"=>"https://www.beanstream.com/samples/order_form.asp", // ## NOT REQUIRED ## //"trnCardNumber"=>"XXXXXXXXX", //test MC number //"trnExpMonth"=>"12", //testing //"trnExpYear"=>"12", //testing "trnOrderNumber"=>$db->f("order_id"), "trnAmount"=>round( $db->f("order_subtotal")+$tax_total+$shipping-$discount_total, 2), "trnCardOwner"=>$dbbt->f("first_name")." ".$dbbt->f("last_name"), "ordAddress1"=>$dbbt->f('address_1'), "ordAddress2"=>$dbbt->f('address_2'), "ordCity"=>$dbbt->f('city'), "ordProvince"=>$dbbt->f('state'), "ordPostalCode"=>$dbbt->f('zip'), "ordName"=>$dbbt->f("first_name")." ".$dbbt->f("last_name"), "ordEmailAddress"=>$dbbt->f('user_email'), "ordPhoneNumber"=>$dbbt->f('phone_1'), "ordCountry"=>$db1->f('country_2_code'), //**************************************************************************** "merchant_id"=>"XXXXXXXXX" //**************************************************************************** ); if( $page == "checkout.thankyou" ) { $query_string = "?"; foreach( $post_variables as $name => $value ) { $query_string .= $name. "=" . urlencode($value) ."&"; } // ## 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 = "admin@XXXXXX.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 ## vmRedirect( $url . $query_string ); } else { // ## MODIFY THIS TEXT TO SUIT YOUR NEEDS ## echo '
Please read the following information, and click the button to continue.

You will be directed to a secure payment form hosted by Beanstream, where you may pay for your order using VISA or Mastercard. Once we receive confirmation of payment from Beanstream, we will ship your order. Thank you.
'; echo '
'; echo '
Proceed to Credit Card Processing →
'; foreach( $post_variables as $name => $value ) { echo ''; } echo '
'; } ?>

Follow this link to view the Order Details.


Is there anyone who can point me in the right direction for a module that works with Beanstream and virtuemart 1.5.15 ?
Any help will be greatly appreciated!
If you require some type of donation or payment let me know.

Cheers.

*Mad

Quick Reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
16-7+3:
Shortcuts: ALT+S post or ALT+P preview