mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Payment should be part of Transaction
This follows The SKPayment API, and makes our JS wrappers easier to implement.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -32,7 +32,6 @@ class InAppPurchase: public mate::EventEmitter<InAppPurchase>,
|
||||
|
||||
// TransactionObserver:
|
||||
void OnTransactionUpdated(
|
||||
const in_app_purchase::Payment& payment,
|
||||
const in_app_purchase::Transaction& transaction) override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user