question

brendan avatar image
brendan asked

error occurred PurchaseInitializationFailure

Devmchoi
started a topic on Sat, 18 July 2015 at 11:25 PM

I tried "PayForPurchaseRequest" with provider ID "IOS" but I got error of "Error code: PurchaseInitializationFailure, Message: Unable to find payment provider IOS."

So How do I make it clear with apple in app purchase?

Thanks.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

swapnilnegi avatar image swapnilnegi commented ·

@Devmchoi Is this issue solved.?

0 Likes 0 ·
brendan avatar image brendan swapnilnegi commented ·

Purchases on iOS devices have to use Apple's marketplace. From that, you get a receipt that you can use with https://api.playfab.com/documentation/client/method/ValidateIOSReceipt. The StartPurchase flow is for non-receipt payment systems, like Facebook, PayPal, Steam, and Xsolla (https://api.playfab.com/docs/tutorials/landing-commerce/non-receipt-payment-processing).

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Mon, 20 July 2015 at 1:16 AM

Hi there,

Bear in mind that both iOS and Android require that you use their marketplaces for real money transactions. For iOS specifically, you would use their marketplace to make the purchase, then use the receipt returned in a call to ValidateIOSReceipt (https://api.playfab.com/Documentation/Client/method/ValidateIOSReceipt). We handle ensuring that the receipt has never been used before (to prevent replay attacks), that it has not been modified (validation), and that it is not an attempt to use a valid receipt for one item to get a different item (substitution). We match up the product_id from the receipt with an ItemId from your title's catalog, and add the appropriate item to the player's inventory as part of the validation operation, so that there's no opportunity for the client to cheat the system into getting something that wasn't paid for.

Brendan


5 Comments
Devmchoi said on Sun, 19 July 2015 at 12:23 AM

So, what kind of provider id string is available?


Brendan Vanous said on Mon, 20 July 2015 at 1:16 AM

Hi there,

Bear in mind that both iOS and Android require that you use their marketplaces for real money transactions. For iOS specifically, you would use their marketplace to make the purchase, then use the receipt returned in a call to ValidateIOSReceipt (https://api.playfab.com/Documentation/Client/method/ValidateIOSReceipt). We handle ensuring that the receipt has never been used before (to prevent replay attacks), that it has not been modified (validation), and that it is not an attempt to use a valid receipt for one item to get a different item (substitution). We match up the product_id from the receipt with an ItemId from your title's catalog, and add the appropriate item to the player's inventory as part of the validation operation, so that there's no opportunity for the client to cheat the system into getting something that wasn't paid for.

Brendan


Devmchoi said on Thu, 03 September 2015 at 5:12 AM

Okay, I moved up stage, more gift here..

I tried to PayForPurchase with code

List<ItemPuchaseRequest> items = new List<ItemPuchaseRequest>();
ItemPuchaseRequest         req    = new ItemPuchaseRequest();
req.ItemId     = itemId;
req.Quantity   = quantity;

req.Annotation = null;
items.Add(req);

PlayFabClientAPI.StartPurchase(new StartPurchaseRequest
{
    CatalogVersion = catalogVersion,
    StoreId        = storeId,
    Items            = items,
}, OnStartPurchase, null);

Then I got "500 internal server error", Do I missed something here? of course I've already called StartPurchase before call PayForPurchase. quntity also 1.


Devmchoi said on Thu, 03 September 2015 at 5:15 AM

And I gave providerId as "Test" because of result of StartPurchase


Brendan Vanous said on Thu, 03 September 2015 at 2:47 PM

So you called StartPurchase and got back the list of payment providers, then got a 500 error when calling PayForPurchase. Looking at the error logs, I see that you attempted to call PayForPurchase using "Steam" as the payment provider, but you don't have any Steam info set in your game configuration. Please go to the Settings->Secret Keys tab of the Game Manager and add your Steam Integration Settings, before attempting to use Steam purchasing. We'll get the error message updated to be more informative. Please ignore the "Test" payment provider - it is solely for our internal testing right now. I'll work with the engineering team to remove it from the returned values.

Brendan

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.