Last active
November 19, 2017 07:08
-
-
Save MTattin/9337ad0e1a70af34bf09b794b9e73f99 to your computer and use it in GitHub Desktop.
アプリ内課金でCodableを利用する ref: https://qiita.com/MTattin/items/3d5507efc39e73cd57f1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// ReceiptDetail | |
/// | |
struct ReceiptDetail: Codable { | |
let receipt_type: String | |
let adam_id: Int | |
let app_item_id: Int | |
let bundle_id: String | |
let application_version: String | |
let download_id: Int | |
let version_external_identifier: Int | |
let receipt_creation_date: String | |
let receipt_creation_date_ms: String | |
let receipt_creation_date_pst: String | |
let request_date: String | |
let request_date_ms: String | |
let request_date_pst: String | |
let original_purchase_date: String | |
let original_purchase_date_ms: String | |
let original_purchase_date_pst: String | |
let original_application_version: String | |
let in_app: [ReceiptInfo] | |
} | |
/// | |
/// ReceiptInfo | |
/// | |
struct ReceiptInfo: Codable { | |
let quantity: String | |
let product_id: String | |
let transaction_id: String | |
let original_transaction_id: String | |
let purchase_date: String | |
let purchase_date_ms: String | |
let purchase_date_pst: String | |
let original_purchase_date: String | |
let original_purchase_date_ms: String | |
let original_purchase_date_pst: String | |
let expires_date: String | |
let expires_date_ms: String | |
let expires_date_pst: String | |
let web_order_line_item_id: String | |
let is_trial_period: String | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// ReceiptInfo - Auto-renewable subscriptions | |
/// | |
struct ReceiptInfo: Codable { | |
let quantity: String | |
let product_id: String | |
let transaction_id: String | |
let original_transaction_id: String | |
let purchase_date: String | |
let purchase_date_ms: String | |
let purchase_date_pst: String | |
let original_purchase_date: String | |
let original_purchase_date_ms: String | |
let original_purchase_date_pst: String | |
let expires_date: String | |
let expires_date_ms: String | |
let expires_date_pst: String | |
let web_order_line_item_id: String | |
let is_trial_period: String | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// ReceiptInfo - Non-Consumable | |
/// | |
struct ReceiptInfo: Codable { | |
let quantity: String | |
let product_id: String | |
let transaction_id: String | |
let original_transaction_id: String | |
let purchase_date: String | |
let purchase_date_ms: String | |
let purchase_date_pst: String | |
let original_purchase_date: String | |
let original_purchase_date_ms: String | |
let original_purchase_date_pst: String | |
let is_trial_period: String | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let expires_date: String | |
let expires_date_ms: String | |
let expires_date_pst: String | |
let web_order_line_item_id: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// ReceiptInfo | |
/// | |
struct ReceiptInfo: Codable { | |
let quantity: String | |
let product_id: String | |
let transaction_id: String | |
let original_transaction_id: String | |
let purchase_date: String | |
let purchase_date_ms: String | |
let purchase_date_pst: String | |
let original_purchase_date: String | |
let original_purchase_date_ms: String | |
let original_purchase_date_pst: String | |
var expires_date: String? /// Non-Consumable には存在しない | |
var expires_date_ms: String? /// Non-Consumable には存在しない | |
var expires_date_pst: String? /// Non-Consumable には存在しない | |
var web_order_line_item_id: String? /// Non-Consumable には存在しない | |
let is_trial_period: String | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
latest_receipt_info | |
latest_receipt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Receipt: Codable { | |
let status: Int | |
let environment: String | |
let receipt: ReceiptDetail | |
var latest_receipt_info: [ReceiptInfo]? | |
var latest_receipt: String? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment