link to paypal from checkout not working

way_designs
Contributor
Contributor

Have just been notified by a client that  link from checkout to paypal is not working with the following error:

 

https://www.paypal.com/webapps/shoppingcart/error?flowlogging_id=6b04fbb85ebaf&code=AMOUNT_ERROR&mfi...

any advice greatly appreciated

 

url is waydesigns.com.au/stickers/cart.html

Login to Me Too
8 REPLIES 8

angelleye
Advisor
Advisor

Can you provide a copy of the request so we can see the value being passed for the amount?  Apparently there must be something incorrect about that value.

Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

way_designs
Contributor
Contributor

@angelleye wrote:

Can you provide a copy of the request so we can see the value being passed for the amount?  Apparently there must be something incorrect about that value.


thanks angelleye. do you mean a copy of the code? I am using simplecart for the store and when I click on the proceed to checkout I am receiving a message branded with Paypal logo saying "We're sorry, things don't appear to be working at the moment. Please try again later."

 

Below is the code for one of the products - all the others have the same cost and use the same code with only product name changing:

 

<div class="clear"></div>
<ul class="buttons">
<li class="left"><a class="ovalbutton price_button" href="#"><span>$ 5.50 + $1 p&h</span></a></li>
<li class="right"><a href="#" class="ovalbutton cart_button" onclick="simpleCart.add('name=mccrae ', 'price=6.50','quantity=1','thumb=images/thumb4.gif');" ><span>Add to cart</span></a>
</li>
</ul>
<div class="clear"></div>

 

I have attached the javascript text below: (hope this is what you are after) I had to change my email address in code to simonat rather than simon@ to get the msg thru

 

 

var NextId=1,Custom="Custom",GoogleCheckout="GoogleCheckout",PayPal="PayPal",Email="Email",AustralianDollar=AUD="AUD",CanadianDollar=CAD="CAD",CzechKoruna=CZK="CZK",DanishKrone=DKK="DKK",Euro=EUR="EUR",HongKongDollar=HKD="HKD",HungarianForint=HUF="HUF",IsraeliNewSheqel=ILS="ILS",JapaneseYen=JPY="JPY",MexicanPeso=MXN="MXN",NorwegianKrone=NOK="NOK",NewZealandDollar=NZD="NZD",PolishZloty=PLN="PLN",PoundSterling=GBP="GBP",SingaporeDollar=SGD="SGD",SwedishKrona=SEK="SEK",SwissFranc=CHF="CHF",USDollar=USD="USD";
function Cart(){

var me = this;
/* member variables */
me.Version = '2.0.1';
me.Shelf = new Shelf();
me.items = {};
me.isLoaded = false;
me.pageIsReady = false;
me.quantity = 0;
me.total = 0;
me.taxRate = 0;
me.taxCost = 0;
me.shippingFlatRate = 0;
me.shippingTotalRate = 0;
me.shippingQuantityRate = 0;
me.shippingRate = 0.;
me.shippingCost = 95;
me.currency = AUD;
me.checkoutTo = PayPal;
me.email = "simonatwaydesigns.com.au";
me.merchantId = "";
me.cartHeaders = ['Image','Name','Price','Quantity','Total'];

 

/******************************************************
checkout management
******************************************************/

me.checkout = function() {
if( simpleCart.quantity === 0 ){
error("Cart is empty");
return;
}
switch( simpleCart.checkoutTo ){
case PayPal:
simpleCart.paypalCheckout();
break;
case GoogleCheckout:
simpleCart.googleCheckout();
break;
case Email:
simpleCart.emailCheckout();
break;
default:
simpleCart.customCheckout();
break;
}
};

me.paypalCheckout = function() {

var me = this,
winpar = "scrollbars,location,resizable,status",
strn = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart" +
"&upload=1" +
"&business=" + me.email +
"&currency_code=" + me.currency,
counter = 1,
itemsString = "";


if( me.taxRate ){
strn = strn +
"&tax_cart=" + me.currencyStringForPaypalCheckout( me.taxCost );
}

for( var current in me.items ){
var item = me.items[current];

var optionsString = "";
for( var field in item ){
if( typeof(item[field]) != "function" && field != "id" && field != "price" && field != "quantity" && field != "name" && field != "shipping") {
optionsString = optionsString + ", " + field + "=" + item[field] ;
}
}
optionsString = optionsString.substring(2);

itemsString = itemsString + "&item_name_" + counter + "=" + item.name +
"&item_number_" + counter + "=" + counter +
"&quantity_" + counter + "=" + item.quantity +
"&amount_" + counter + "=" + me.currencyStringForPaypalCheckout( item.price ) +
"&on0_" + counter + "=" + "Options" +
"&os0_" + counter + "=" + optionsString;
counter++;
}

if( me.shipping() != 0){
itemsString = itemsString + "&item_name_" + counter + "=Shipping" +
"&item_number_" + counter + "=" + counter +
"&quantity_" + counter + "=1" +
"&amount_" + counter + "=" + me.currencyStringForPaypalCheckout( me.shippingCost );
}


strn = strn + itemsString ;
window.open (strn, "paypal", winpar);
};

me.googleCheckout = function() {
var me = this;
if( me.currency != USD && me.currency != GBP ){
error( "Google Checkout only allows the USD and GBP for currency.");
return;
} else if( me.merchantId === "" || me.merchantId === null || !me.merchantId ){
error( "No merchant Id for google checkout supplied.");
return;
}

var form = document.createElement("form"),
counter = 1;
form.style.display = "none";
form.method = "POST";
form.action = "https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/" +
me.merchantId;
form.acceptCharset = "utf-8";

for( var current in me.items ){
var item = me.items[current];
form.appendChild( me.createHiddenElement( "item_name_" + counter, item.name ) );
form.appendChild( me.createHiddenElement( "item_quantity_" + counter, item.quantity ) );
form.appendChild( me.createHiddenElement( "item_price_" + counter, item.price ) );
form.appendChild( me.createHiddenElement( "item_currency_" + counter, me.currency ) );
form.appendChild( me.createHiddenElement( "item_tax_rate_" + counter, me.taxRate ) );
form.appendChild( me.createHiddenElement( "_charset_" , "" ) );

var descriptionString = "";

for( var field in item){
if( typeof( item[field] ) != "function" &&
field != "id" &&
field != "quantity" &&
field != "price" )
{
descriptionString = descriptionString + ", " + field + ": " + item[field];
}
}
descriptionString = descriptionString.substring( 1 );
form.appendChild( me.createHiddenElement( "item_description_" + counter, descriptionString) );
counter++;
}

document.body.appendChild( form );
form.submit();
document.body.removeChild( form );
};



me.emailCheckout = function() {
return;
};

me.customCheckout = function() {
return;
};

Login to Me Too

angelleye
Advisor
Advisor

The cart code seems to building a PayPal Standard payment request, but what I need to see is the final result of that.  The actual URL that it ends up generating and sending you to.

Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

way_designs
Contributor
Contributor

The message and url I receive from paypal once clicking on 'proceed to checkout' is the one I posted in my initial message.

url:

https://www.paypal.com/webapps/shoppingcart/error?flowlogging_id=dae9c1e6907ed&code=AMOUNT_ERROR&mfi...

 

message:

We're sorry, things don't appear to be working at the moment. Please try again later.

Login to Me Too

angelleye
Advisor
Advisor
That is the response. I want to see the request.
Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

way_designs
Contributor
Contributor

Sorry I dont understand. Once the user clicks 'proceed to checkout' this is what appears. There is no other dialogue it goes straight into paypal - well it used to. The code from the cart sending the data to paypal is what I posted earlier above the javascript

Login to Me Too

angelleye
Advisor
Advisor

Right, you've posted the code that generates the request, and you've posted the response that results from that request, but you have not posted the actual request that the code generates, which is where the problem apparently lies, and is what we need to see.  Please adjust the code to save logs of the payment request or output it to the screen or something so that you post it here.  My guess is that once you see the actual request you will find a problem with the data and it will be easy to fix.

Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

MTS_Ciaran
Moderator
Moderator

Hey, so I was able to pull the data from our logs related to the error you posted above, the issue is that you are passing the "$" symbol in the amount variables: e.g. 

 

amount_1=$6.50

 

The amount variables only allow numbers and a decimal. Remove the $ and you should be good to go. 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.