我正在尝试将 PayPal API JSON 响应映射到 Java Bean。我使用了一个名为http://www.jsonschema2pojo.org/的工具来创建对象。
它是否根据以下 JSON 正确完成?它创建了 5 个不同的对象。
- DoReferenceTransactionResponseDetails.java
- FeeAmount.java
- GrossAmount.java
- 支付信息.java
- TaxAmount.java
我想我需要将它们包含在一个名为RefTransactionResponse 之类的基础对象中,其中包括Timestamp、ack等?唯一的其他方法是使用内部类吗?
{ "doReferenceTransactionResponseDetails":{
"billingAgreementID":"B-92T23517L08326025",
"paymentInfo":{
"transactionID":"4U482182NY9710827",
"transactionType":"MERCHTPMT",
"paymentType":"INSTANT",
"paymentDate":"2013-09-05T14:36:35Z",
"grossAmount":{
"currencyID":"USD",
"value":"14.99"
},
"feeAmount":{
"currencyID":"USD",
"value":"0.73"
},
"taxAmount":{
"currencyID":"USD",
"value":"0.00"
},
"paymentStatus":"COMPLETED",
"pendingReason":"NONE",
"reasonCode":"NONE",
"protectionEligibility":"Ineligible",
"protectionEligibilityType":"None"
}
},
"timestamp":"2013-09-05T14:36:36Z",
"ack":"SUCCESS",
"correlationID":"11b0602aa6328",
"errors":[
],
"version":"106.0",
"build":"7560199"
}