wendyanas / google-checkout-php-sample-code

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

SendRefundOrder sends malformed XML #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try using GoogleRequest::SendRefundOrder()

What is the expected output? What do you see instead?
I expect it to send a properly formatted XML message, and work. Instead, it
sends out a malformed XML message and doesn't work (it receives a
synchronous error message).

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

Please provide any additional information below.
The culprit is a semi-column used instead of a period in the source:

    function SendRefundOrder($google_order, $amount, $reason,
                              $comment='') {
      $postargs = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
                  <refund-order xmlns=\"".$this->schema_url.
                  "\" google-order-number=\"". $google_order. "\">" .
                  "<reason>". $reason . "</reason>";
      if($amount!=0) {
        $postargs .= "<amount currency=\"" . $this->currency . "\">";
                      htmlentities($amount)."</amount>";
      }
      $postargs .= "<comment>". htmlentities($comment) . "</comment>
                  </refund-order>";
      return $this->SendReq($this->request_url,
                   $this->GetAuthenticationHeaders(), $postargs);
    }

See the last character of the first line in the "if($amount!=0)" block.

Original issue reported on code.google.com by gut...@gmail.com on 13 Feb 2008 at 11:54

GoogleCodeExporter commented 8 years ago
Updated in 1.2.5b

Original comment by peng.y...@gmail.com on 13 Feb 2008 at 6:06