carviaso / google-checkout-dotnet-sample-code

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

ChargeAndShipOrderRequest charges the wrong amount #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have using the .NET GCheckout DLL, version 2.5.0.7.

Here is the problem.  A user purchases an item from my web site for $30.  I 
receive the new-order-notification, and authorized-amount-notification 
perfectly.  No problems here.

Now, I decide to charge the user only $27.  However, what happens is the user 
is charged $30.  Also, in the merchant area, it says "You initiated a charge of 
$30.00 to the customer's credit card."  This is incorrect, as you can see below 
I initiated the charge for $27. The below code returns true. Here is my code in 
C#:

    ChargeAndShipOrderRequest c = new ChargeAndShipOrderRequest(googleOrderNumber);
    c.Amount = 27.00M;
    GCheckoutResponse g = c.Send();
    if (g.IsGood)
    {
        return true;
    }
    else
    {
        string errors = g.ErrorMessage;
        return false;
    }

Original issue reported on code.google.com by m...@pollbuzzer.com on 2 Aug 2012 at 6:46

GoogleCodeExporter commented 9 years ago
That looks right to me. It may be an issue with google checkout not supporting 
an amount less than the original charged amount.

Have you looked up the information in the documentation or posted to the forum?

Original comment by joseph.f...@gmail.com on 3 Aug 2012 at 1:46

GoogleCodeExporter commented 9 years ago
Issue with the API itself and not the code itself. Closing issue.

Original comment by joseph.f...@gmail.com on 3 Aug 2012 at 1:47

GoogleCodeExporter commented 9 years ago
It says the following in the documentation:

•Invalid Argument Errors

◦The requested charge amount is greater than the remaining chargeable amount. 
(You are trying to charge the customer for more than the total order amount.)
◦The requested charge amount is zero or negative.

There is nothing mentioned regarding authorizing and then charging a LESSER 
amount.  If I can't charge less than or more than the authorized amount, then I 
would ask why are you able to specify an amount at all in the charge & ship 
command? 

According to the Google Checkout support email person, the following XML was 
sent to them.  This seems to indicate there is a bug with the .NET GCheckout 
DLL when it generates the XML.  It is supposed to set the unit price to $27, 
not the MERCHANT_DATA_HIDDEN field:

 <items>
      <item>
        <item-name>My cool item</item-name>
        <item-description>My item description</item-description>
        <unit-price currency="USD">30.0</unit-price>
        <quantity>1</quantity>
        <merchant-private-item-data>

          <MERCHANT_DATA_HIDDEN>27</MERCHANT_DATA_HIDDEN>

        </merchant-private-item-data>
      </item>
    </items>

Original comment by m...@pollbuzzer.com on 3 Aug 2012 at 3:45

GoogleCodeExporter commented 9 years ago
Also where can I download the 2.5.0.7 .NET GCheckout DLL source?  I can only 
find the source for 2.5.0.5a.  Thanks very much.

Cheers
Matt

Original comment by m...@pollbuzzer.com on 3 Aug 2012 at 3:49

GoogleCodeExporter commented 9 years ago
The source is available here

http://code.google.com/p/google-checkout-dotnet-sample-code/source/checkout 

it required Hg

http://mercurial.selenic.com/ 

Original comment by joseph.f...@gmail.com on 3 Aug 2012 at 3:21

GoogleCodeExporter commented 9 years ago
Found a bug where the currency is not set

      if (Amount != -1 && _currency != null) {
        retVal.amount = new AutoGen.Money();
        retVal.amount.currency = _currency;
        retVal.amount.Value = Amount;
      }

Original comment by joseph.f...@gmail.com on 3 Aug 2012 at 5:29

GoogleCodeExporter commented 9 years ago
This issue was closed by revision c9462f5c4fa7.

Original comment by joseph.f...@gmail.com on 4 Aug 2012 at 4:11