Pass multiple transactions at the same time
This follows the design of SKPayment API.
This commit is contained in:
parent
2dd545ebda
commit
e77ddd3221
6 changed files with 35 additions and 33 deletions
|
@ -82,9 +82,9 @@ void InAppPurchase::PurchaseProduct(const std::string& product_id,
|
|||
in_app_purchase::PurchaseProduct(product_id, quantity, callback);
|
||||
}
|
||||
|
||||
void InAppPurchase::OnTransactionUpdated(
|
||||
const in_app_purchase::Transaction& transaction) {
|
||||
Emit("transaction-updated", transaction);
|
||||
void InAppPurchase::OnTransactionsUpdated(
|
||||
const std::vector<in_app_purchase::Transaction>& transactions) {
|
||||
Emit("transactions-updated", transactions);
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#define ATOM_BROWSER_API_ATOM_API_IN_APP_PURCHASE_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "atom/browser/api/event_emitter.h"
|
||||
#include "atom/browser/mac/in_app_purchase.h"
|
||||
|
@ -31,8 +32,8 @@ class InAppPurchase: public mate::EventEmitter<InAppPurchase>,
|
|||
void PurchaseProduct(const std::string& product_id, mate::Arguments* args);
|
||||
|
||||
// TransactionObserver:
|
||||
void OnTransactionUpdated(
|
||||
const in_app_purchase::Transaction& transaction) override;
|
||||
void OnTransactionsUpdated(
|
||||
const std::vector<in_app_purchase::Transaction>& transactions) override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(InAppPurchase);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue