Skip to content

Commit

Permalink
TransactionPoster: added transaction ID and Date to log
Browse files Browse the repository at this point in the history
Looking into #3020, it would have been helpful to see these.
  • Loading branch information
NachoSoto committed Aug 16, 2023
1 parent 93883e7 commit 72b5f45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Sources/Logging/Strings/PurchaseStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ enum PurchaseStrings {
case begin_refund_customer_info_error(entitlementID: String?)
case missing_cached_customer_info
case sk2_transactions_update_received_transaction(productID: String)
case transaction_poster_handling_transaction(productID: String, offeringID: String?)
case transaction_poster_handling_transaction(transactionID: String,
productID: String,
transactionDate: Date,
offeringID: String?)
case caching_presented_offering_identifier(offeringID: String, productID: String)
case payment_queue_wrapper_delegate_call_sk1_enabled
case restorepurchases_called_with_allow_sharing_appstore_account_false
Expand Down Expand Up @@ -298,8 +301,9 @@ extension PurchaseStrings: LogMessage {
case let .sk2_transactions_update_received_transaction(productID):
return "StoreKit.Transaction.updates: received transaction for product '\(productID)'"

case let .transaction_poster_handling_transaction(productID, offeringID):
let prefix = "TransactionPoster: handling transaction for product '\(productID)'"
case let .transaction_poster_handling_transaction(transactionID, productID, date, offeringID):
let prefix = "TransactionPoster: handling transaction '\(transactionID)' " +
"for product '\(productID)' (date: \(date))"

if let offeringIdentifier = offeringID {
return prefix + " in Offering '\(offeringIdentifier)'"
Expand Down
2 changes: 2 additions & 0 deletions Sources/Purchasing/Purchases/TransactionPoster.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ final class TransactionPoster: TransactionPosterType {
data: PurchasedTransactionData,
completion: @escaping CustomerAPI.CustomerInfoResponseHandler) {
Logger.debug(Strings.purchase.transaction_poster_handling_transaction(
transactionID: transaction.transactionIdentifier,
productID: transaction.productIdentifier,
transactionDate: transaction.purchaseDate,
offeringID: data.presentedOfferingID
))

Expand Down

0 comments on commit 72b5f45

Please sign in to comment.