Payment should be part of Transaction

This follows The SKPayment API, and makes our JS wrappers easier to
implement.
This commit is contained in:
Cheng Zhao 2018-01-10 17:06:27 +09:00
parent 635b753ecd
commit 2dd545ebda
5 changed files with 13 additions and 23 deletions

View file

@ -40,6 +40,7 @@ struct Converter<in_app_purchase::Transaction> {
dict.Set("transactionState", val.transactionState);
dict.Set("errorCode", val.errorCode);
dict.Set("errorMessage", val.errorMessage);
dict.Set("payment", val.payment);
return dict.GetHandle();
}
};
@ -82,9 +83,8 @@ void InAppPurchase::PurchaseProduct(const std::string& product_id,
}
void InAppPurchase::OnTransactionUpdated(
const in_app_purchase::Payment& payment,
const in_app_purchase::Transaction& transaction) {
Emit("transaction-updated", payment, transaction);
Emit("transaction-updated", transaction);
}
} // namespace api