Wednesday, December 07, 2011

How to display a product-description in the Paypal expresscheckout

How to display a product-description in the Paypal expresscheckout

I found how to display a product-description in the Paypal expresscheckout screen.

For about one year, I couldn't display it because of an incomplete sample code provided by Paypal.

Today I found and tested how to do it.

--------------------------------------------
You should change the function, CallShortcutExpressCheckout(), like,...


====================
expresscheckout.php
====================

[OLD]
$resArray = CallShortcutExpressCheckout ($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL);

[NEW]
$resArray = CallShortcutExpressCheckout ($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $product_description);

====================
paypalfunctions.php
====================
[OLD]
function CallShortcutExpressCheckout( $paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL)

[NEW]
function CallShortcutExpressCheckout( $paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $product_description)

[OLD]
$nvpstr = $nvpstr . "&CURRENCYCODE=" . $currencyCodeType;
[NEW]
$nvpstr = $nvpstr . "&CURRENCYCODE=" . $currencyCodeType;
$nvpstr = $nvpstr . "&DESC=".$product_description;//append product_description

*********************************************
[Japanese=日本語]

Paypal の ExpressCheckout 画面に商品情報を出す方法が一年も分かりませんでしたが、
今日分かったのでメモしておきます。

CallShortcutExpressCheckout() という関数を拡張することが必要です。

拡張方法は、上記をみてください。
*********************************************