Jump to content

Search the Community

Showing results for tags 'purchase'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. hello everyone a few days ago i did tried to implement a one time purchase (make a paid android app ) there is no error showing except the message that i will show you next thing i did consider: Make sure the product ID in your code matches the ID of the product you created in the Google Play Console. Make sure that the product is published and active in the Google Play Console. Make sure that the account you are using to test the app is not the same account you used to create the product in the Google Play Console. i don't know what I'm missing i keep thinking that the new library is the problem (because its come with new change to how to implement purchase) i did publish the app in Internal testing. i did multiply approach and multiply attempt to fix this with no luck yet with the help of chat gpt . ps : following this topic. D11,unsupported version of Play billing - Cross-platform - Delphi-PRAXiS [en] (delphipraxis.net) my code: uses FMX.InAppPurchase; types procedure InAppPurchaseSetupComplete(Sender: TObject); procedure InAppPurchaseProductsRequestResponse(Sender: TObject; const Products: TIAPProductList; const InvalidProductIDs: TStrings); procedure InAppPurchasePurchaseCompleted(Sender: TObject; const ProductID: string; NewTransaction: Boolean); private function Purchase(const ProductId: string): Boolean; const NoAdsId = 'barcoderpro'; var FProductIsValid: Boolean; fisPurchased :Boolean; procedure TFormMain.FormCreate(Sender: TObject); {$IFDEF ANDROID} InAppPurchase1.ApplicationLicenseKey := 'key part 1'+ 'key part 2'; InAppPurchase1.ProductIDs.Add(NoAdsId); InAppPurchase1.OnSetupComplete := InAppPurchaseSetupComplete; InAppPurchase1.OnProductsRequestResponse := InAppPurchaseProductsRequestResponse; InAppPurchase1.OnPurchaseCompleted := InAppPurchasePurchaseCompleted; {$ENDIF} end; procedure TFormMain.InAppPurchaseSetupComplete(Sender: TObject); begin FIsPurchased := False; try InAppPurchase1.QueryProducts; except on E: Exception do ShowMessage(e.Message); end; end; procedure TFormMain.InAppPurchaseProductsRequestResponse(Sender: TObject; const Products: TIAPProductList; const InvalidProductIDs: TStrings); var Product: TProduct; begin FIsPurchased := False; for Product in Products do begin if NoAdsId = Product.ProductID then begin FProductIsValid := True; if InAppPurchase1.IsProductPurchased(NoAdsId) then begin FIsPurchased := True; // PURCHASED! ShowMessage('La version professionnelle est déjà activée'); end; end; end; end; procedure TFormMain.InAppPurchasePurchaseCompleted(Sender: TObject; const ProductID: string; NewTransaction: Boolean); begin if NewTransaction then begin ShowMessage('La version professionnelle activée'); FIsPurchased := True; end else ShowMessage('L''achat a été annulé'); end; function TFormMain.Purchase(const ProductId: string): Boolean; begin Result := False; {$IFDEF ANDROID} if InAppPurchase1.IsSetupComplete and InAppPurchase1.CanMakeInAppPurchases then begin InAppPurchase1.PurchaseProduct(ProductId); Result := True; end else ShowMessage('L''achat n''est pas possible pour le moment. Essayez plus tard.'); {$ENDIF} end; procedure TFormMain.btn7Click(Sender: TObject); begin // User is not registered yet or trial period has expired, proceed with purchase if Purchase(NoAdsId) then begin // Purchase successful //active the app pro // no trial period end; //////or if FIsPurchased then begin ShowMessage('La version professionnelle est déjà activée'); end else begin // User is not registered yet or trial period has expired, proceed with purchase if Purchase(NoAdsId) then begin // Purchase successful ShowMessage('La version professionnelle est activée.....'); end; end; Screenrecorder-2023-05-17-07-50-25-454.mp4
×