#isaac.mk-Json
1 messages · Page 1 of 1 (latest)
Stripe API to deserialize a json? If you use official Stripe SDK you wouldn't need to do that
When I use this, why it remind me Cannot access com.google.gson.Gson
Is that Java?
yes ,it is java
Do you use Stripe Java SDK?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
</dependency>
yes I use it.
Look at the response, it's an object already
{
"object": "list",
"url": "/v1/balance_transactions",
"has_more": false,
"data": [
{
"id": "txn_1J0LdfEmaib10qkRWsvIwTGj",
"object": "balance_transaction",
"amount": 107269819,
"available_on": 1623801600,
"created": 1623222947,
"currency": "jpy",
"description": null,
"exchange_rate": 1.0727,
"fee": 3861713,
"fee_details": [
{
"amount": 3861713,
"application": null,
"currency": "jpy",
"description": "Stripe processing fees",
"type": "stripe_fee"
}
],
"net": 103408106,
"reporting_category": "charge",
"source": "ch_1J0LdfEmaib10qkRbiut5HJQ",
"status": "available",
"type": "charge"
},
{...},
{...}
]
}
But when I use RPC, I can't deserialize the BalanceTransaction since it has a null value in the source
RPC? Can you elaborate on that?
Remote Procedure Call Protocol
To clarify, Stripe SDK send REST API under the hood, which is json. RPC is a different protocol and it has nothing to do with REST API
Yes I know the acronym
OK thank you . I think my problem has solved
Hope that helps? Are you using https://github.com/OpenFeign/feign ?
That's not necessary if you are using Stripe Java SDK
yes I use feign
but
it gives me an error
feign.codec.DecodeException: Error while extracting response for type [java.util.List<com.stripe.model.BalanceTransaction>] and content type [application/json]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: null; nested exception is com.fasterxml.jackson.databind.JsonMappingException: N/A at [Source: (PushbackInputStream); line: 1, column: 526] (through reference chain: java.util.ArrayList[0]->com.stripe.model.BalanceTransaction["sourceObject"])