-
Notifications
You must be signed in to change notification settings - Fork 11
/
AFSDKXPurchaseDetails.cpp
86 lines (71 loc) · 2.37 KB
/
AFSDKXPurchaseDetails.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//
// AFSDKXPurchaseDetails.cpp
// MyGame
//
// Created by ivan.obodovskyi on 02.10.2024.
//
#include <stdio.h>
#include "AFSDKXPurchaseDetails.h"
AFSDKXPurchaseDetails::AFSDKXPurchaseDetails(const AFXPurchaseType &purchaseType,
const std::string &purchaseToken,
const std::string &productId,
const std::string &price,
const std::string ¤cy,
const std::string &transactionId)
:purchaseType_(purchaseType),
purchaseToken_(purchaseToken),
productId_(productId),
price_(price),
currency_(currency),
transactionId_(transactionId) {
}
std::string AFSDKXPurchaseDetails::getProductId() const {
return productId_;
}
void AFSDKXPurchaseDetails::setProductId(const std::string &productId) {
productId_ = productId;
}
std::string AFSDKXPurchaseDetails::getPrice() const {
return price_;
}
void AFSDKXPurchaseDetails::setPrice(const std::string &price) {
price_ = price;
}
std::string AFSDKXPurchaseDetails::getCurrency() const {
return currency_;
}
void AFSDKXPurchaseDetails::setCurrency(const std::string ¤cy) {
currency_ = currency;
}
std::string AFSDKXPurchaseDetails::getTransactionId() const {
return transactionId_;
}
void AFSDKXPurchaseDetails::setTransactionId(const std::string &transactionId) {
transactionId_ = transactionId;
}
std::string AFSDKXPurchaseDetails::getPurchaseToken() const {
return purchaseToken_;
}
void AFSDKXPurchaseDetails::setPurchaseToken(const std::string &purchaseToken) {
purchaseToken_ = purchaseToken;
}
std::string AFSDKXPurchaseDetails::getPurchaseType() const {
std::string purchaseTypeStr = purchaseTypeToString();
return purchaseTypeStr;
}
void AFSDKXPurchaseDetails::setPurchaseType(AFXPurchaseType &purchaseType) {
purchaseType_ = purchaseType;
}
// Function to get the string value of the enum
std::string AFSDKXPurchaseDetails::purchaseTypeToString() const{
switch (purchaseType_) {
case AFXPurchaseType::SUBSCRIPTION:
return "subscription";
case AFXPurchaseType::ONE_TIME_PURCHASE:
return "one_time_purchase";
case AFXPurchaseType::APPLE:
return "";
default:
return "";
}
}