Answer the question
In order to leave comments, you need to log in
How to get Reciept to verify the payment on the server in iOS 7?
Good evening.
You need to get a Reciept to verify the payment was made on the server in iOS 7.
The documentation says that now you need to use appStoreReceiptURL for this.
Here is how I get it:
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for (SKPaymentTransaction *transaction in transactions)
{
switch(transaction.transactionState) {
case SKPaymentTransactionStatePurchased:
{
....
NSURL *recieptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSData *recieptData = [NSData dataWithContentsOfURL:recieptURL];
NSString *base64Receipt = [self base64forData:recieptData];
}
break;
...
}
}
}
{
"receipt": {
"original_purchase_date_pst": "2012-04-30 08:05:55 America/Los_Angeles",
"original_transaction_id": "1000000046178817",
"original_purchase_date_ms": "1335798355868",
"transaction_id": "10617080047",
"quantity": "1",
"product_id": "br.com.jera.Example",
"bvrs": "20120427",
"purchase_date_ms": "1335798355868",
"purchase_date": "2012-04-30 15: 05:55 Etc/GMT",
"original_purchase_date": "2012-04-30 15:05:55 Etc/GMT",
"purchase_date_pst": "2012-04-30 08:05:55 America/Los_Angeles",
"bid": "br.com.jera.Example",
"item_id": "521129812"
},
"status": 0
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question