Comments (5)
Do you want to retrieve the user's receipt and store in your own system?
from cordova-plugin-purchase.
Yes I need the user's receipt, it is required for our payment provider that needs to store it. So I have to retrieve and send it to our payment provider (chargebee).
from cordova-plugin-purchase.
Hi, if the payment via Apple is done, processed and documented with a receipt, I cannot think of a usecase what the other payment provider would do with Apple's receipt.
Could there be a misunderstanding about the payment providers processes and requirements?
Otherwise, the API of Store object could be helpful to access to the receipts:
https://github.com/j3k0/cordova-plugin-purchase/blob/v13/api/classes/CdvPurchase.Store.md
from cordova-plugin-purchase.
Chargee (our payment provider) is just syncing the data.
Small intro about this; we use chargebee to see if a subscription is active or not, or what plan the user is using. Based on that plan we give the user extra features or not.
Because the app was first only created for web, this approach is working fine. However, we also created a Mobile app, using capacitor, but it is rejected by apple because we don't use In App Purchases.
But by using In App Purchases it creates a second source of truth for our subscriptions. Fortunately Chargebee has a syncing method where it can sync those subscriptions from Apple to Chargebee. So we can still using Chargebee as our source of truth.
However, new subscriptions are not created initially, so we have to push/create a new subscription manually via an Chargebee endpoint and that requires the AppStoreReceipt
# Create an In app subscription for Apple App Store
curl https://{site}.chargebee.com/api/v2/in_app_subscriptions/cb-pjp7hcmrcbfmtjhle3smlwicu4/process_purchase_command \
-u {site_api_key}:\
-d receipt="Apple Based64 Encoded Receipt" \
-d product[id]="app_store_plan_id" \
-d product[price]="3399" \
-d product[price_in_decimal]="33.99" \
-d product[currency_code]="USD"
-d customer[id]="customer-123"
I will have a look at https://github.com/j3k0/cordova-plugin-purchase/blob/v13/api/classes/CdvPurchase.Store.md
Thanks!
from cordova-plugin-purchase.
If I am not wrong, what you could do is:
a) when there is a purchase performed on the mobile app, you could use a listener to listen the receipt updates and push to your backend where you also validate the receipt. Then you make a call to chargebee
b) when there is a purchase performed on the mobile app, you could use a listener to listen the receipt updates and push to chargebee directly. I dont know whether they have receipt validation functionality. Otherwise, you could face issues with fake receipts.
I still have difficulty to understand the receipt lifecycle on the app (when it is issued, what does it contain and how it is validated)
from cordova-plugin-purchase.
Related Issues (20)
- [GOOGLE PLAY] Billing API update my code doesn't work. HOT 2
- is it possible to request a refund from purchaseId? HOT 1
- Getting errors from CDVPurchase.Utils.safeCall HOT 1
- [Android] store.localTransactions doesn't return consumed consumable transactions HOT 1
- Problem running on Android with Capacitor 6.0.0 (startServiceConnection in class PurchasePlugin, deprecated API) HOT 1
- Why does it work on Android but not on iOS? And what's the deal with being asked to purchase again when it's supposed to be a consumable purchase? Android is fine HOT 2
- Google Play Billing Library 4.0.0 is depreciated HOT 1
- Products owned status changes on IOS Ionic Capacitor Live reload HOT 3
- [Android] Cannot Register Existing Products in V13.10.1
- Method startServiceConnection in class PurchasePlugin cannot be applied to given types HOT 3
- Plans for Upgrading to Google Play Billing Library v6 or v7? HOT 9
- When running locally window.cordova is undefined. Plugin cannot lookup platformId. HOT 1
- Wrong currency ($/USD instead of €/EUR) displayed on iOS (not Android) HOT 1
- Approved never fires after initiating the purchase HOT 5
- Update com.google.android.play.billingclient.version HOT 3
- [Android] `orderId` undefined on cancelled Receipt HOT 1
- the Sandbox opens repeatedly upon purchase even though it is displayed as Done. After Done appears, the store Listener is not called.
- Purchase requested by the user new method
- How to run validator every time app is opened
- Unclear how/when to call my own API after user purchases non-renewing subscription
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-purchase.