Multi-Purchase
Mô tả: Khi bấm vào để mua, hệ thống tự động chọn mua IAP hoặc mua Dzovi.
Loại | Tên tham số | Loại | Mô tả |
---|---|---|---|
Đầu vào | sku | string | Stock Keeping Unit của vật phẩm này. Ví dụ: "skutest_20k_vnd" |
itemID | string | ID của vật phẩm trong game. Ví dụ: "sword01" | |
roleID | string | UserID trong game. Ví dụ: "User123456" | |
gameTransaction | string | Mã đặt hàng, giao dịch từ game. Ví dụ: "10938093890130192830" |
-
Sau khi nhận PurchaseType từ máy chủ, SDK Client sẽ tự động gọi phương thức thanh toán.
-
Gọi DZOSDKCoreKit với tiến trình MultiPayment:
[[DZOSDKCoreKit sharedInstance] MultiPayment:_sku ItemID:_itemID GameTransaction:_gameTransaction RoleID:_roleID handler:^(SDKResult_MultiPayment *result, NSError *error) {
if (error == nil) {
NSLog(@"MultiPayment result: [%@], [%@]", result.status, result.message);
// Thành công
if ([result.status isEqual:@0]) {
NSLog(@"MultiPayment result: [%@] [%@] [%@] [%@] [%@] [%@] [%@]", result.status, result.message, result.transactionID, result.money, result.balance, result.sku, result.gameTransaction);
} else {
NSLog(@"MultiPayment error: [%@] [%@]",result.status, result.message);
}
} else {
NSLog(@"MultiPayment error: %@", error);
}
}];