Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-5615

StoreKit - cancelled event called when user doesn't have a credit card and goes to add it.

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Needs more info
    • Affects Version/s: None
    • Component/s: Appcelerator Modules
    • Labels:
    • Environment:

      SDK: 7.0.1.GA
      Ti.Storekit version: 4.3.0
      Iphone

      • It's only possible to reproduce on production, since it's not possible to add a credit card on sandbox environment.

      Description

      When the user doesn't have credit card on apple acount, when he click's on purchase inside the app, he is redirected to appstore to add a new card. At this moment, Storekit module fire's TRANSACTION_STATE_FAILED event with cancelled 'true'. When the user finish the credit card addition and confirm the purchase, purchased event is fired, but my app is not listenning to this event anymore, because the purchased was 'cancelled'.

      Storekit.addEventListener('transactionState', function(evt) {
          hideLoading();
          switch (evt.state) {
              case Storekit.TRANSACTION_STATE_FAILED:
              		//second, when the user goes to add a credit card, TRANSACTION_STATE_FAILED with cancelled 'true' is called.
                  break;
              case Storekit.TRANSACTION_STATE_PURCHASED:
      						//third, when the user ends the credit card addition and confirms the purchase, TRANSACTION_STATE_PURCHASED is fired.
                  break;
              case Storekit.TRANSACTION_STATE_PURCHASING:
                	//first, TRANSACTION_STATE_PURCHASING is fired.
                  break;
      		case Storekit.TRANSACTION_STATE_DEFERRED:
                  break;
          }
      });
      

      To reproduce this issue, use the example of storekit module:
      https://github.com/appcelerator-modules/ti.storekit/blob/master/ios/example/app.js

      But it's only possible to reproduce on production, since it's not possible to add a credit card on sandbox environment.

      Sometimes when the user goes to add a new credit card, the app is restarted. In this case, TRANSACTION_STATE_PURCHASED is never called, but the purchase is completed.

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain
              Reporter:
              hrfn Hugo Ramos Freire Neto
            • Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code