I'm very confused about how to proceed to add in-app purchase code to native C++ app for one-time payment purchase.

technoway 241 Reputation points
2022-10-05T08:15:42.327+00:00

A Microsoft policy states:
"You must use the Microsoft payment request API or a secure third party purchase API for purchases of physical goods or services, and a secure third party purchase API for payments made in connection with real world gambling or charitable contributions."

I have been told I must use the in-app purchase function for a one-time payment for the software I have written.

Note, I was initially didn't realize that an in-app purchase would be used for a one-time payment, so I didn't add any special code to my application.

The product is a native MFC applications written in C++. There is no .NET code in the product. I'm familiar with .NET. I would prefer to use a native solution. (I almost certainly will be submitting some .NET applications to the store later).

I think I probably want to use the newer Windows.Services.Store, since that is not deprecated, even though it limits to newer versions of the Windows Operating system.

I'm not sure how to best write this in-app purchase code, nor where to put this code in my program, how it functions, or whether I should make it a .NET solution and compile using the /clr flag, or make a DLL that calls into .NET libraries, of use a COM call, or wrapper, or some other solution.

I see it needs a Window handle. Do I put it in Mainfrm.cpp? Do I need to supply dialog windows, or are they part of the functionality of the APIs?

I see so much old information, and so many solutions. Since this is a one-time purchase, I want to minimize the code I have to write.

Once the code is written, I don't know how to test it. Do I have to wait until it's on the App Store to test the functionality?

My application is currently under review. Should I not submit it for review until the purchase code has been added? (Translation: Did I make a mistake submitting it for certification?)

I am lost as how to proceed. I'm sure I'll solve this eventually, however, I am under a schedule, and I don't want to misstep.

----------------------------------------

I did find this 8 year old code. I don't know what it does, or if it's relevant. I expect it's probably a deprecated solution.

In-app purchase in a native c++ app
https://social.msdn.microsoft.com/Forums/en-US/7bee4c28-a123-41f3-a37d-48fe3ccc4dab/inapp-purchase-in-a-native-c-app?forum=wpdevelop

----------------------------------------

I'm very familiar with C, C++, .NET, COM, and have written lots of code for all those, including creating my own COM objects. I don't have an issue programming. I just find so many different solutions online, and some are very old, and I don't want to waste time writing code that is incorrect.

I also am confused about what the in-app APIs do.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,525 questions
{count} votes