VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Customization
 Order Details passed to paypal
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

aquanautica
Starting Member

10 Posts

Posted - August 01 2007 :  16:55:14  Show Profile  Visit aquanautica's Homepage  Reply with Quote
Does anyone know of a way to pass the cart contents along to paypal so when the invoice is viewed from paypal's side there is more then just an order number and total in it?

Right now when I choose to check-out using paypal, I could have 10 items in my cart, shipping and tax but it is all lumped into one fee and an order number when the customer gets to paypal. Sad part is the customer never sees the order number and only see the total cost of everything without a breakdown. Any advice is appreciated.

support
Administrator

4266 Posts

Posted - August 01 2007 :  20:52:03  Show Profile  Visit support's Homepage  Reply with Quote
Hi there,

The customer can only see the total in PayPal if you use the default built in PayPal interface.

We have a module available from our download page however that allows you send the items to PayPal for display:

http://www.vpasp.com/sales/epdownload650.asp

PayPal Standard Add-On
Description: Send cart items to PayPal instead of just sending total

Hope this helps

Thanks
Cam

VP-ASP Support
Go to Top of Page

aquanautica
Starting Member

10 Posts

Posted - August 03 2007 :  01:33:15  Show Profile  Visit aquanautica's Homepage  Reply with Quote
Thanks Cam that looks like what I am looking for. Just as long as it works with the IPN, we're good to go.
Aric
Go to Top of Page

aquanautica
Starting Member

10 Posts

Posted - August 08 2007 :  11:03:27  Show Profile  Visit aquanautica's Homepage  Reply with Quote
Cam, That didn't do the trick afterall. I am using the IPN interface which doesn't allow me to alter the callout. Can you please advise or allow me to open a support ticket for some inhouse work?
Go to Top of Page

support
Administrator

4266 Posts

Posted - August 08 2007 :  19:03:09  Show Profile  Visit support's Homepage  Reply with Quote
Hi Aric,

You can post a ticket in our help desk at:
https://www.vpasp.com/virtprog/helpdesk

Thanks
Cam

VP-ASP Support
Go to Top of Page

SuperSpec
Starting Member

7 Posts

Posted - August 13 2007 :  16:45:13  Show Profile  Reply with Quote
Aquanatica:

I'm just starting to configure PayPal; were you able to resolve the issue so that cart contents were passed to PayPal using IPN?

Thanks,
Ron
Go to Top of Page

aquanautica
Starting Member

10 Posts

Posted - August 14 2007 :  12:16:54  Show Profile  Visit aquanautica's Homepage  Reply with Quote
Hi Ron,
Yes, it worked perfectly for the exception of one detail. The paypal IPN doesn't have the ability of adding state sales tax to the handling portion of an order without applying it to the shipping as well. Really not that big of a deal as it only equates to a few cents/dollars per order that has a separate handling charge. Otherwise it works nicely and did what I needed it to. I will tell you that Paypal is VERY picky on the capitalization of your site name and email address and it will NOT work if you say put a capital H in http:, and stuff like that.
Kind Regards,
Aric
Go to Top of Page

SuperSpec
Starting Member

7 Posts

Posted - August 14 2007 :  12:35:17  Show Profile  Reply with Quote
Thanks Aric. Specifically, I was wanting to know what was done to make it work and pass the cart details. IE, it didn't work intitially for you, and you posted a ticket. What did they/you change to get it to work properly? (I'm just starting to work with my IPN, and it's not passing cart contents either).
Go to Top of Page

aquanautica
Starting Member

10 Posts

Posted - August 14 2007 :  12:46:29  Show Profile  Visit aquanautica's Homepage  Reply with Quote
Hello agian Ron,
Yes; the one that I downloaded from the "6.5 add-on" section is for the standard version of the PayPal gateway, that's why I had to send a ticket. They in turn sent me the IPN version of the order details. The actual file is paypalipngateway.asp and the only lines that are really different are as follows:

lines 42-43:
<INPUT TYPE="hidden" NAME="cmd" VALUE="_cart">
<input type="hidden" name="upload" value="1" />
where as line 43 is added and line 42 is modified from:
<INPUT TYPE="hidden" NAME="cmd" VALUE="_ext-enter">

This is added after line 50:
<input type="hidden" name="tax_cart" value="<%=getsess("taxes")%>" />
<input type="hidden" name="handling_cart" value="<%=getsess("handling") + getsess("smprice")%>" />
<%addindividualitems%>

and this is added to line 116:
end sub

sub addindividualitems ()
Dim arrCart, scartItem, ii
arrCart = GetSessA("CartArray")
scartItem = GetSess("CartCount")

For ii = 1 To scartItem%>
<input type="hidden" name="item_name_<%=ii%>" value="<%=left(arrcart(cproductname,ii), instr(arrcart(cproductname,ii), "<br />") - 1)%>" />
<input type="hidden" name="quantity_<%=ii%>" value="<%=arrcart(cquantity,ii)%>" />
<input type="hidden" name="item_number_<%=ii%>" value="<%=arrcart(cproductid,ii)%>" />
<input type="hidden" name="amount_<%=ii%>" value="<%=replace(arrcart(cunitprice,ii), getconfig("xcurrencysymbol"), "")%>" />
<%next

which becomes line 116 after you add the lines above..

If you are going to be usng the modified callouts I would suggest downloading a free program called "winmerge" as it will allow you to load 2 files at once and it compares then side by side, making this task a LOT easier. I wish you the best of luck!
Kind Regards,
Aric
Go to Top of Page

SuperSpec
Starting Member

7 Posts

Posted - August 14 2007 :  14:32:56  Show Profile  Reply with Quote
Hi again Aric,

First THANKS for being so specific regarding the necessary code. I can easily change the code, but I'm not sure of which page you're referring to changing. I already have paypalipngateway.asp, which has none of the code above. Are you saying that you/they modified paypalipngateway.asp to include this code, the standard PayPal gateway page, or a different page?
Go to Top of Page

aquanautica
Starting Member

10 Posts

Posted - August 14 2007 :  14:55:38  Show Profile  Visit aquanautica's Homepage  Reply with Quote
Hi Ron,
No problem on the IPN stuff. This is specifically the paypalIPNgateway.asp. The only line of code you will see in it that matches what I previously posted in the quote:
where as line 43 is added and line 42 is modified from:
<INPUT TYPE="hidden" NAME="cmd" VALUE="_ext-enter">

so on yours you should see on line 42 the code listed above. What you will want to do is replace that with the new lines 42-43 listed in my last post then add all the rest of the code on the appropriate lines starting from the top working down so your line numbers match-up. The file I am using however has been modified so that it no longer appears to people that paypal is how they will be checking out. It just looks like you will be paying with a credit card then it takes you to a custom page in paypal where you can sign in or just pay with a cc without an account. I had that done because I figured I would get a ton of dropped carts if people felt they HAVE to pay with paypal. I think you'll get my drift. Anyway, I hope this helps and if you need anything else, just keep on posting...I'm waiting for someone to help me on another post I left, so I am watching them all constantly. Below is a copy of the IPN I am using....again, I have a little bit of mods done to it, but if you use the winmerge, you'll see what they are and you just don't have to copy that part. If you copy then past this entire code into a notepad doc then rename it paypalipngateway.asp.ord it will be done so you can compare.

<%
'**********************************************************
' Paypal Specific code when integrating with other agteways
' Instant payment Notification code
' Support Currency and comma as secimal point
' Change Paypal URL
' VP-ASP 5.50 Feb 28, 2005
'***********************************************************
const PAYPALEMAIL="[email protected]" ' enter your details
const PAYPALMYSITE="https://www.yoursite.com" ' enter your details

const paypalgatewaylocation="https://www.paypal.com/cgi-bin/webscr"
const CurrencyCode="USD" ' other values are EUR, CAD, GBP, JPY, USD

'*************************************************************************
' Use these in European countries
'**************************************************************************1
' Used only for Countries using comma as secimal point
const CommaAsDecimal="No" '
' Used only if you want amount converted to $US
const ConvertToUS="No" ' uses conversion rate in shop Configuration
' Used only if an LCID is not set in shop Configuration
const ResetLcid="1036" ' Reset LCid id

Sub paypalPerformGateway
dim returnurl, cancelreturnurl, websess
Dim subject
returnurl=paypalMysite & "/paypalipnresult.asp?oid=" & oid
returnurl=addwebsess(returnurl)
cancelreturnurl=paypalMysite & "/paypalipnresult.asp?cancel=Yes"
cancelreturnurl=addwebsess(cancelreturnurl)
subject=getconfig("xEmailSubject") & " - " & oid
websess=request("websess")

' BYZ: 01-AUG-2007: Moved header info into separate config file:
'shopwriteheaderpic "Pay with PayPal Instant Payment Notification Interface","images/icons/paypal.gif"


Response.write "<form method=post action=" & paypalgatewaylocation & ">"
paypalGetDatabaseFields
%>
<INPUT TYPE="hidden" NAME="cmd" VALUE="_cart">
<input type="hidden" name="upload" value="1" />
<INPUT TYPE="hidden" NAME="redirect_cmd" VALUE="_xclick">
<input type="hidden" name="business" value="<%=paypalemail%>">
<input type="hidden" name="return" value="<%=returnurl%>">
<input type="hidden" name="cancel_return" value="<%=cancelreturnurl%>">
<input type="hidden" name="item_name" value="<%=subject%>">
<input type="hidden" name="quantity" value="1">
<INPUT TYPE="hidden" NAME="undefined_quantity" VALUE="1">
<input type="hidden" name="currency_code" value="<%=currencycode%>">
<input type="hidden" name="tax_cart" value="<%=getsess("taxes")%>" />
<input type="hidden" name="handling_cart" value="<%=getsess("handling") + getsess("smprice")%>" />
<%addindividualitems%>
<input type="hidden" name="item_number" value="<%=oid%>">
<input type="hidden" name="custom" value="<%=websess%>">
<input type="hidden" name="bn" value="vp-asp">
<div class="std_table ac">
<input type="submit" value="Click Here to Pay by Credit Card" name="submit" class="submitbtn"</div>
</form>
<%
End sub


Sub paypalGetDatabaseFields
Dim Dbc, myname, amount
Dim StrSql
OpenOrderdb dbc ' Open the database
strsql = "select * from orders where orderid=" & oid
Set Orders = dbc.execute(strsql)
If Not Orders.eof then
amount=orders("orderamount")
If CommaAsDecimal="Yes" then
Convertamount amount
else
amount=formatnumber(amount,2)
amount=replace(amount,",","")
end if

paypaldofield "amount", amount
paypaldofield "first_name", orders("ofirstname")
paypaldofield "last_name", orders("olastname")
paypaldofield "address1", orders("oaddress")
paypaldofield "city", orders("ocity")
paypaldofield "state", orders("ostate")
paypaldofield "zip", orders("opostcode")
paypaldofield "day_phone_a", orders("ophone")
else
debugwrite "Cannot find order"
end if
Closerecordset Orders
ShopCloseDatabase dbc
end sub

Sub Convertamount (amount)
dim savelcid, oamount, ydualconversionrate
savelcid=Getconfig("xlcid")
If ConvertToUs="Yes" and Getconfig("Xdualconversionrate")<>"" then
ydualconversionrate=getconfig("xdualconversionrate")
if isnumeric(ydualconversionrate) then
ydualconversionrate=cdbl(ydualconversionrate)
oamount=amount*ydualconversionrate
amount=oamount
end if
end if
session.lcid="2057"
amount=formatnumber(amount,2)
amount=replace(amount,",","")
If Savelcid<>"" then
session.lcid=savelcid
else
session.lcid=ResetLcid
end if
end sub
'
Sub paypalDoField (fieldname,fieldvalue)
if fieldvalue="" or isNull(fieldvalue) then
exit sub
end if
Response.write "<input type=hidden name=" & Chr(34) & fieldname & Chr(34) & " value=" & Chr(34) & Fieldvalue & Chr(34) & ">" & vbcrlf
end sub

sub addindividualitems ()
Dim arrCart, scartItem, ii
arrCart = GetSessA("CartArray")
scartItem = GetSess("CartCount")

For ii = 1 To scartItem%>
<input type="hidden" name="item_name_<%=ii%>" value="<%=left(arrcart(cproductname,ii), instr(arrcart(cproductname,ii), "<br />") - 1)%>" />
<input type="hidden" name="quantity_<%=ii%>" value="<%=arrcart(cquantity,ii)%>" />
<input type="hidden" name="item_number_<%=ii%>" value="<%=arrcart(cproductid,ii)%>" />
<input type="hidden" name="amount_<%=ii%>" value="<%=replace(arrcart(cunitprice,ii), getconfig("xcurrencysymbol"), "")%>" />
<%next
end sub
%>
Go to Top of Page

SuperSpec
Starting Member

7 Posts

Posted - August 14 2007 :  15:38:24  Show Profile  Reply with Quote
Gotcha! I'm must have been a little slow on the uptake. BTW, I am doing the same thing regarding credit cards, I want my customers to know they have options other than PayPal, too. I'll make the changes and let you know how it works for me, thanks again. How are you testing your changes, do you use the PayPal sandbox? I can't send money to myself to test.
Go to Top of Page

aquanautica
Starting Member

10 Posts

Posted - August 14 2007 :  17:07:10  Show Profile  Visit aquanautica's Homepage  Reply with Quote
Yes; I messed around for a few hours til I got the sandbox to work. It is a real pain in the butt. If you google for the paypal developers network you will find a seperate paypal site to make a new account for testing purposes. My advice is read very carefully as that is what slowed me down the most (I speed read) and you'll miss some important steps. Once you sign up for the developers account and make your two test accounts (one merchant one customer) you will go into the paypalipngateway.asp and add the term sandbox infront of paypal i.e. https://sandobx.paypal.com/.../.../... then when you check out it will have everything set. You'll also change the email address in the gateway asp to match your merchant testing account you set up on the developers site. Also, when make a customer account...don't forget to select additional details BEFORE you select finished, so you can put some test money in the account to use for paying (you can put as much as you like...I was a millionaire for a few minutes :). I probaby didn't make any sense, but I am here if you need more hep.
Kind Regards,
Aric
Go to Top of Page

Richie500
Starting Member

USA
4 Posts

Posted - September 01 2007 :  16:13:11  Show Profile  Visit Richie500's Homepage  Reply with Quote
Could someone send me the paypalIPN as i have downloaded the same Gateway 3 times without noticing that I have a limit of just 3 per year. My email address is [email protected]

Thanks
Go to Top of Page

support
Administrator

4266 Posts

Posted - September 02 2007 :  09:20:29  Show Profile  Visit support's Homepage  Reply with Quote
Hi Richie,

These requests are best submitted to our help desk and our support team will look up your record for youi and reset it so you cn access further gateways from our download center.

Thanks
Cam

VP-ASP Support.
Go to Top of Page

soncci
VP-ASP New User

USA
86 Posts

Posted - February 16 2008 :  16:12:41  Show Profile  Visit soncci's Homepage  Reply with Quote
I am trying to apply the instructions on this Topic to have all the items and prices passed to the Paypal checkout, with no luck at all.
I don't need the tx part. That is taken care already.
Is there anybody out there that did it succesfully?
Please help.

www.supply2000intl.com
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000