kmitgroup / google-checkout-php-sample-code

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

In googlemerchantcalculations.php, <gift-result> is being sent instead of <gift-certificate-result> #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use responsehandlerdemo.php
2. Replace coupons with gift certificates
3. Try to use a gift certificate with google checkout.

What is the expected output? What do you see instead?
Google checkout expects <gift-certificate-result>,
googlemerchantcalculations.php sends <gift-result>

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

Original issue reported on code.google.com by kwie...@gmail.com on 2 Oct 2007 at 9:30

GoogleCodeExporter commented 9 years ago
hey, good catch!

next version will have that fixed! thx

ropu

Original comment by rovagn...@gmail.com on 3 Oct 2007 at 6:44

GoogleCodeExporter commented 9 years ago
patch:

line 77 
replace:
          foreach($result->giftcert_arr as $curr_gift) {
            $xml_data->Push('gift-result');  
            $xml_data->Element('valid', $curr_gift->gift_valid);
            $xml_data->Element('code', $curr_gift->gift_code);
            $xml_data->Element('calculated-amount', $curr_gift->gift_amount, 
                array('currency'=> $this->currency));
            $xml_data->Element('message', $curr_gift->gift_message);
            $xml_data->Pop('gift-result');  
          }

with:

          foreach($result->giftcert_arr as $curr_gift) {
            $xml_data->Push('gift-certificate-result');  
            $xml_data->Element('valid', $curr_gift->gift_valid);
            $xml_data->Element('code', $curr_gift->gift_code);
            $xml_data->Element('calculated-amount', $curr_gift->gift_amount, 
                array('currency'=> $this->currency));
            $xml_data->Element('message', $curr_gift->gift_message);
            $xml_data->Pop('gift-certificate-result');  
          }

Original comment by rovagn...@gmail.com on 3 Oct 2007 at 6:46

GoogleCodeExporter commented 9 years ago
This issue is still present in the latest version of the zip.

Original comment by rod...@gmail.com on 20 May 2008 at 1:32