Core Paypal Payment Module - pm_paypal.php Configuration

11.06.2016 02:21
#1
Bilmar
Joomshopping forum user no avatar
Name: Mark
23.05.2016
Сообщения: 124
Quote
Core Paypal Payment Module - pm_paypal.php Configuration

I am hoping you can give me some direction to help edit the core Paypal payment extension to send the product data and attributes to Paypal.

If I use a hybrid of programming to get the data and attributes like this:

function _addProductToForm($product, $product_item){
if (isset($product->product_attributes) && $product->product_attributes!=''){
$desc = trim($product->product_name."\n".$product->product_attributes);
}else{
$desc = trim($product->product_name);
}
$name = $product->product_name;
if ($this->productNameWithAttributs){
$name = $desc;
}
return '&L_PAYMENTREQUEST_0_NAME'.$product_item.'='.urlencode($name).
'&L_PAYMENTREQUEST_0_NUMBER'.$product_item.'='.urlencode($product->product_ean).
'&L_PAYMENTREQUEST_0_DESC'.$product_item.'='.urlencode($desc).
'&L_PAYMENTREQUEST_0_AMT'.$product_item.'='.round($product->product_item_price, 2).
'&L_PAYMENTREQUEST_0_QTY'.$product_item.'='.$product->product_quantity;
}


How can I then use that data to insert it into the Paypal form to submit it to Paypal like this:

<?php $items = unserialize($_SESSION['items']); ?>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="business" value="email@yahoo.ca">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="return" value="http://www.mysite.com/">

<?php
$suffix = 1;
foreach($items as $item):
?>
<input type="hidden" name="item_name_<?php echo $suffix; ?>" value="<?php echo $item['name']; ?>">

<?php
$suffix++;
endforeach;
?>

<input type="submit" name="paypal" id="paypal" value="Checkout" />
</form>

What I need to know is what to do to get the function to insert the product name and attributes into this script?

What should this line read: <?php $items = unserialize($_SESSION['items']); ?>

And then what should this line read to insert them into the script: <input type="hidden" name="item_name_<?php echo $suffix; ?>" value="<?php echo $item['name']; ?>">

Maybe collectively we can figure this out and help each other to get this solved.


Последнее изменение: 11.06.2016 03:23
 
15.06.2016 03:42
#2
Bilmar
Joomshopping forum user no avatar
Name: Mark
23.05.2016
Сообщения: 124
Quote
Aw: Core Paypal Payment Module - pm_paypal.php Configuration


function _addProductToForm($product, $product_item){
if (isset($product->product_attributes) && $product->product_attributes!=''){
$desc = trim($product->product_name."\n".$product->product_attributes);
}else{
$desc = trim($product->product_name);
}
$name = $product->product_name;
if ($this->productNameWithAttributs){
$name = $desc;
}
return '&L_PAYMENTREQUEST_0_NAME'.$product_item.'='.urlencode($name).
'&L_PAYMENTREQUEST_0_NUMBER'.$product_item.'='.urlencode($product->product_ean).
'&L_PAYMENTREQUEST_0_DESC'.$product_item.'='.urlencode($desc).
'&L_PAYMENTREQUEST_0_AMT'.$product_item.'='.round($product->product_item_price, 2).
'&L_PAYMENTREQUEST_0_QTY'.$product_item.'='.$product->product_quantity;
}



How can I use that data to insert it into the Paypal form to submit it to Paypal like this:

What Does This Line Need To Read:
<?php $items = unserialize($_SESSION['items']); ?>


<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="business" value="email@yahoo.ca">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="return" value="http://www.mysite.com/">

Then these lines should allow us to get each item from the cart:
<?php
$suffix = 1;
foreach($items as $item):
?>
<input type="hidden" name="item_name_<?php echo $suffix; ?>" value="<?php echo $item['name']; ?>">

<?php
$suffix++;
endforeach;
?>


<input type="submit" name="paypal" id="paypal" value="Checkout" />
</form>

What I need to know is what to do to get the function to insert the product name and attributes into this script?

What should this line read:
<?php $items = unserialize($_SESSION['items']); ?>


And then what should this line read to insert them into the script:
<input type="hidden" name="item_name_<?php echo $suffix; ?>" value="<?php echo $item['name']; ?>">


Any ideas?

 
22.06.2016 22:13
#3
Bilmar
Joomshopping forum user no avatar
Name: Mark
23.05.2016
Сообщения: 124
Quote
Aw: Core Paypal Payment Module - pm_paypal.php Configuration

It seems like lots of people are having very similar issues with the core Paypal solution.

Would it be possible to have someone on your team take some time to review the core payment solution and make some upgrades to it?

I have searched through this forum a lot and it seems like these issues go back to 2013 with no resolutions or upgrades. I am attempting to address some of the issues on my own and i think i have a very good solution (above code) but I am having problems implementing it.

 
23.06.2016 07:47
#4
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Сообщения: 25856
Quote
Aw: Core Paypal Payment Module - pm_paypal.php Configuration

In pm_paypal will only information about order number.
All information
see admin / shop / orders.

 
23.06.2016 16:02
#5
Bilmar
Joomshopping forum user no avatar
Name: Mark
23.05.2016
Сообщения: 124
Quote
Aw: Core Paypal Payment Module - pm_paypal.php Configuration

webdesigner - 23.06.2016 07:47
In pm_paypal will only information about order number.
All information
see admin / shop / orders.


I know that's how it is currently set up but it doesn't have to be and it would be so much easier to have all the data sent to Paypal for shipping.

Not to mention, there are still problems with orders remaining in "Pending" status after a successful payment via Paypal which may be resolved by addressing the pm_paypal page.

 
26.06.2016 16:35
#6
Bilmar
Joomshopping forum user no avatar
Name: Mark
23.05.2016
Сообщения: 124
Quote
Aw: Core Paypal Payment Module - pm_paypal.php Configuration

As many post with issues in this forum about Paypal, I can't understand how more people are not commenting on this post to try and help each other out to resolve this situation?

I am willing to test out everything and clearly this not only benefits everyone in the forum, it would benefit Joomshopping too since it will be a major upgrade and fix to the core payment processing.

Lets figure this out....

 
11.07.2016 03:35
#7
Bilmar
Joomshopping forum user no avatar
Name: Mark
23.05.2016
Сообщения: 124
Quote
Aw: Core Paypal Payment Module - pm_paypal.php Configuration

Solved

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.