readdle / app-store-receipt-verification Goto Github PK
View Code? Open in Web Editor NEWPure PHP library that allows receipts parsing/validation/verification without API calls to the App Store Server API
License: MIT License
Pure PHP library that allows receipts parsing/validation/verification without API calls to the App Store Server API
License: MIT License
composer require readdle/app-store-receipt-verification
As you can see in this documentation https://developer.apple.com/documentation/appstorereceipts/responsebody/receipt
A receipt can have preorder_date
fields in case of a preorder
For now I'm using the verifyReceipt API call to get the information if the user has preordered my app
When comparing the response with your dev mode, I found that the field 32 contains the preorder_date
VS
Trying to run \Readdle\AppStoreReceiptVerification\AppStoreReceiptVerification::verifyReceipt() on a receipt I have and it dies with this error. Reading up a bit I believe this is tied to not implementing the REAL type as per the 09 here https://www.oss.com/asn1/resources/asn1-made-simple/asn1-quick-reference.html
Any chance this could get fixed/added?
I am able to run AppStoreReceiptVerification::verifyReceipt() on my local development machine (MacOs brew php 8.1.24) but on my production server I get a "Verification failed" exception (Linux centos 9 php 8.1.25) using the exact same $receiptData.
What could be the difference between both envirionments? Are there openssl settings maybe?
$receiptData=...
$appleIncRootCertificate=\Readdle\AppStoreReceiptVerification\Utils::DER2PEM(
file_get_contents('https://www.apple.com/appleca/AppleIncRootCertificate.cer')
);
$response=\Readdle\AppStoreReceiptVerification\AppStoreReceiptVerification::verifyReceipt(
$receiptData,
$appleIncRootCertificate
);
testing a bit further and I found out that $this->verifyRootCertificate($trustedAppleRootCertificate) fails: openssl_x509_verify(..) returns 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.