kmitgroup / google-checkout-php-sample-code

Automatically exported from code.google.com/p/google-checkout-php-sample-code
0 stars 0 forks source link

Description-based delivery is not available #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a cart
2. create an item:
$item_1 = new GoogleItem($name, $desc, $quantity, $amount);

2. Set digital content for description only:
$item_1->SetURLDigitalContent(false, false, 'instructions here');

3. Add the item to the cart etc

What is the expected output? 
checkout accepts the order and displays the instructions on completion.

What do you see instead?
<error-message>There must be some content in a digital content</error-message>

What version of the product are you using? 
1.2.5c
On what operating system?
Linux

It happens because googlecart.php expects $item->digital_url if
$item->digital_description is used. If no url is given then empty digital
content is sent and so comes the error. 
Supplying a url means no error but does not then use the description-based
delivery described in the docs.

Solution:
at line 457 of googlecart.php add:

else if(!empty($item->digital_description)) {
    $xml_data->element('description', substr($item->digital_description, 0,
MAX_DIGITAL_DESC));
}

Original issue reported on code.google.com by petermcl...@gmail.com on 18 Sep 2009 at 4:51

GoogleCodeExporter commented 9 years ago
fixed in 1.3.0

Original comment by peng.y...@gmail.com on 13 Sep 2010 at 11:16