8 Replies
      Latest reply on Jan 24, 2018 10:55 PM by lyzg
      Sasha111ua Level 1 Level 1 (0 points)


        If user has no credit card linked to his appstore account.

        Inside of application we receive purchase statuses as:


        1. Purchasing

        2. Failed

        3. User input credit card information and confirm purchase

        4. Purchasing

        5. Purchased


        In this case statuses 1, 2 and 4,5 reated to two different transactions as i see.

        The problem is we are using applicationUsername field and in this case during second transaction we are loosing information from applicationUsername field bcuz this transation was initiated by apple server.


        Question: is my purchase statuses flow correct? if yes, any advice how to not to loose info from applicationUsername field.


        Thanks, Alex

        • Re: SKPayment.applicationUsername is null
          rich Apple Staff Apple Staff (265 points)

          Just to verify, it appears that you are describing the StoreKit flow scenario, where the addPayment method results in both a failed, then a successful transaction result because of the interruption in the payment process to handle the credit card update / confirm purchase process. As this situation is not one that is reproducible in the sandbox, an application can only demonstrate this case in the production environment. If you are finding that the SKPayment.applicationUsername field is not being maintained at the transaction.payment when the updatedTransactions delegate method is called for the successful transaction, this would seem to be a bug report.


          Does your application currently log the applicationUsername field? It would be helpful to include the console log for your app taken when this issue occurs. One way to replicate the StoreKit flow scenario is to install the app, then delete the credit card info associated with the user account. Then run the app and attempt the in app purchase. You can submit the bug report using the Apple Developer Bug Report web page - http://bugreport.apple.com. After submitting the bug report, please send the bug report number to my personal account as listed in my signature, and I'll make sure to forward it to the StoreKit engineers for their review.


          rich kubota - rkubota@apple.com

          developer technical support CoreOS/Hardware/MFI

          • Re: SKPayment.applicationUsername is null
            PBK Level 7 Level 7 (3,235 points)

            As I said in response to your other post, applicationUsername is something you provide to Apple for their use.  They do not provide it back to you in the receipt.  It would be a great feature - even better if they provided a hash of the applicationUsername (device specific) with some sort of shared secret that only the app and Apple knew; then a receipt could actually be used to securely verify the purchase.