Compare commits
3 Commits
refactor/e
...
master
Author | SHA1 | Date | |
---|---|---|---|
788e7b1f96 | |||
322e48e8a7 | |||
596e210c8a |
@ -261,7 +261,6 @@ static void CopyTransaction(SKPaymentTransaction* transaction, IAPTransaction* o
|
|||||||
|
|
||||||
out->ident = strdup([transaction.payment.productIdentifier UTF8String]);
|
out->ident = strdup([transaction.payment.productIdentifier UTF8String]);
|
||||||
|
|
||||||
|
|
||||||
if (transaction.transactionDate)
|
if (transaction.transactionDate)
|
||||||
out->date = strdup([[dateFormatter stringFromDate: transaction.transactionDate] UTF8String]);
|
out->date = strdup([[dateFormatter stringFromDate: transaction.transactionDate] UTF8String]);
|
||||||
out->state = transaction.transactionState;
|
out->state = transaction.transactionState;
|
||||||
@ -274,9 +273,15 @@ static void CopyTransaction(SKPaymentTransaction* transaction, IAPTransaction* o
|
|||||||
if (transaction.transactionState == SKPaymentTransactionStatePurchased) {
|
if (transaction.transactionState == SKPaymentTransactionStatePurchased) {
|
||||||
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
|
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
|
||||||
NSData *receiptData = [NSData dataWithContentsOfURL:receiptURL];
|
NSData *receiptData = [NSData dataWithContentsOfURL:receiptURL];
|
||||||
out->receipt_length = receiptData.length;
|
|
||||||
|
NSString *receiptString = [receiptData base64EncodedStringWithOptions:0];
|
||||||
|
out->receipt_length = receiptString.length;
|
||||||
out->receipt = (const char*)malloc(out->receipt_length);
|
out->receipt = (const char*)malloc(out->receipt_length);
|
||||||
memcpy((void*)out->receipt, receiptData.bytes, out->receipt_length);
|
memcpy((void*)out->receipt, [receiptString UTF8String], out->receipt_length);
|
||||||
|
|
||||||
|
// out->receipt_length = receiptData.length;
|
||||||
|
// out->receipt = (const char*)malloc(out->receipt_length);
|
||||||
|
// memcpy((void*)out->receipt, receiptData.bytes, out->receipt_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transaction.transactionState == SKPaymentTransactionStateRestored && transaction.originalTransaction) {
|
if (transaction.transactionState == SKPaymentTransactionStateRestored && transaction.originalTransaction) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user