bchavez / Coinbase.Commerce

:moneybag: A .NET/C# implementation of the Coinbase Commerce API.
https://commerce.coinbase.com/docs/
Other
48 stars 9 forks source link

FlurlHttpException: Call failed with status code 400 (Bad Request): POST https://api.commerce.coinbase.com/charges #4

Closed Odigietony closed 5 years ago

Odigietony commented 5 years ago

Hello, I keep getting the

FlurlHttpException: Call failed with status code 400 (Bad Request): POST https://api.commerce.coinbase.com/charges

on this line of code

var response = await commerceApi.CreateChargeAsync(charge); please help!!

bchavez commented 5 years ago

Hi @Odigietony,

Thank you for the report.

I ran the following integration test here and it completed successfully. I wasn't able to reproduce the 400 Bad Request. So, I'm not exactly sure why you're getting a mysterious 400 Bad Request.

I need more information if you'd like me to continue helping you debug the issue.

If you can, please provide:

Let me know.

Thanks,
Brian

:walking_man: :walking_woman: Missing Persons - Walking in L.A.

Odigietony commented 5 years ago

Hey! I fixed it. Given that I want to input amount from my app then send that amount to the api I had set the PricingType = PricingType.NoPrice, LocalPrice = new Money { Amount = model.Price, Currency = plan.Currency }, Instead of

PricingType = PricingType.FixedPrice, LocalPrice = new Money { Amount = model.Price, Currency = plan.Currency },

Thank You. you can close this now.

bchavez commented 5 years ago

Wonderful! That's great! Glad you were able to fix the problem! Don't hesitate to ask more questions if you need help! :+1:

-Brian

:briefcase: :necktie: "Taking care of business every day... Taking care of business every way..."