Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by jacobdhart · Jul 03, 2018 at 04:22 PM · In-Game Economy

Non-receipt payment flow causes most browsers to eat the Facebook Payments pop-up

The non-receipt flow for Facebook Payments, as described by the tutorial, is StartPayment->FB.ui()->PayForPurchase->ConfirmPurchase. The FB.ui() call is supposed to show a pop-up window that allows the user to confirm the purchase.

Our game triggers this flow when the user clicks a purchase button. However, because FB.ui() can be called only after StartPayment has completed, Chrome prevents the Facebook Payments dialog from ever appearing. (For a pop-up window to be shown, it must happen from inside an onClick handler.)

What is the best way to remedy this issue? I don't believe that FB.ui() can be called first, and I would prefer not to do something hacky like calling StartPayment before the user even clicks the purchase button.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Jul 04, 2018 at 01:03 AM

The Facebook payment dialog is normally a rendered overlay within the game (using an iframe is the default behavior). What's the context in which you're required to have it be a separate popup window?

Comment

People who like this

0 Show 3 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jacobdhart · Jul 05, 2018 at 01:31 AM 0
Share

An iframe is no longer the default behavior, and manually specifying display: "iframe" causes an AppInvalidItemParam error. It appears that Facebook made this change to prevent clickjacking.

avatar image jacobdhart jacobdhart · Jul 04, 2018 at 09:59 PM 0
Share

For reference, this is the object I'm passing into FB.ui():

{
          method: "pay",
          action: "purchaseitem",
          product: productURL,
          request_id: i_startResult.OrderId,

// Causes the callback to be called with an AppInvalidItemParam error
/* display: "iframe" */ }
avatar image Brendan ♦♦ jacobdhart · Jul 05, 2018 at 03:09 AM 0
Share

That makes this difficult. It's not possible for you to call FB.ui first, as you must have the Order ID you get from StartPurchase. What you may want to do is call StartPurchase when they add things to the "cart", so that you already have the Order ID when they click the purchase button in the game.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Reward Players with Decrease Recharge Time,Change virtual currency recharge time per user 1 Answer

    What is the difference between consumable and durable? 1 Answer

    How can I add translations to a shop item? 1 Answer

    How can i make a catalog item to stack when player buy that but active it when player want ? 1 Answer

    ios receipt validation returns 1098 error 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges