Reputation: 2638
Hi i am creating a windows phone 7.1 application, which requires in app purchases
As WP7 does not have a specific in app purchase SDK like iphone does, can we use paypal
for in app purchases,
I am new to windows phone 7 and paypal API
like open a mobile paypal site in browsercontrol
when i click on payment button and get the payment done by the user and if the payment success return success message or if fail return failure message.
i do not think Movend
is a best option, as we have to maintain products database in their website also which i don't want.
Upvotes: 4
Views: 2600
Reputation: 2638
Here is answer for my question
Paypal does not have specific sdk for WP7, so i tried to solve above the problem in following way
BrowserControl_Navigated
for that controlstring.Format("http://localhost:62744/PaymentGateway/ExpressCheckout.aspx?ItemName={0}&Number={1}&Desc={2}&ItemPrice={3}&ItemUrl={4}", ItemName, ItemNumber, ItemDescription, ItemPrice, ItemUrl).Replace(" ", "+");
BrowserControl.Navigate(new Uri(url));
BrowserControl_Navigated
event add conditions to check the paypal success and failure urlsif the condition success navigate to success page in WP7
if (BrowserControl.Source.ToString().Contains( "http://localhost:62744/PaymentGateway/Success.html"))
NavigationService.Navigate(new Uri("/Success.xaml", UriKind.Relative));
Above code will redirect the page to PayPal mobile page, it's not good as iOS login page in look and feel. We can get PayPal iOS page with a small trick in windows phone 7
By changing the headers(user-agent of client) of the browser will give us the PayPal iPhone page
Like below
string header = "User-Agent:Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7";
string url = string.Format("http://10.11.32.211:88/PaymentGateway/ExpressCheckout.aspx?ItemName={0}&Number={1}&Desc={2}&ItemPrice={3}&ItemUrl={4}", ItemName, ItemNumber, ItemDescription, ItemPrice, ItemUrl).Replace(" ", "+");
BrowserControl.IsScriptEnabled = true;
BrowserControl.Navigate(new Uri(url),null, header);
Upvotes: 4
Reputation: 11
We implemented IAP in our game in March. We had to trick PayPal into thinking we were an iPhone by modifying the host headers on the initial browser request, in order to get PayPal to recognize the IE9 on the WP as a mobile browser. It was very painful. I don't know if they have fixed that yet.
Also, PayPal uses watermarked text boxes, which IE9 does not support, so we needed to include help text on the checkout to show what the unlabeled textboxes were for (for checkout with CC, instead of a PayPal account.
It was a very painful process, but it is working now. Go download QONQR from the app store and take a look the end result. Send email to our support address if you want more details on implementation. Happy to help if you need it.
Upvotes: 1
Reputation: 65556
It's perfectly acceptable to use PayPal to take payment in your app but be aware of the Marketplace Application Policy 2.1:
Your application must be fully functional when acquired from Windows Phone Marketplace (except for additional data as permitted below). Unless you have a pre-existing billing relationship with the user, your application may not require the user to provide payment information, within the application experience, to activate, unlock, or extend usage of the application.
Upvotes: 2