Turn addTransactionListener into transaction-updated event
This commit is contained in:
parent
ac6f895f64
commit
133bef3deb
5 changed files with 80 additions and 37 deletions
|
@ -62,9 +62,7 @@ void InAppPurchase::BuildPrototype(v8::Isolate* isolate,
|
|||
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
|
||||
.SetMethod("canMakePayments", &in_app_purchase::CanMakePayments)
|
||||
.SetMethod("getReceiptURL", &in_app_purchase::GetReceiptURL)
|
||||
.SetMethod("purchaseProduct", &InAppPurchase::PurchaseProduct)
|
||||
.SetMethod("addTransactionListener",
|
||||
&in_app_purchase::AddTransactionObserver);
|
||||
.SetMethod("purchaseProduct", &InAppPurchase::PurchaseProduct);
|
||||
}
|
||||
|
||||
InAppPurchase::InAppPurchase(v8::Isolate* isolate) {
|
||||
|
@ -83,6 +81,12 @@ void InAppPurchase::PurchaseProduct(const std::string& product_id,
|
|||
in_app_purchase::PurchaseProduct(product_id, quantity, callback);
|
||||
}
|
||||
|
||||
void InAppPurchase::OnTransactionUpdated(
|
||||
const in_app_purchase::Payment& payment,
|
||||
const in_app_purchase::Transaction& transaction) {
|
||||
Emit("transaction-updated", payment, transaction);
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
||||
} // namespace atom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue