This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Helpers; | |
| use App\Models\Order; | |
| use GuzzleHttp\Client; | |
| use GuzzleHttp\Exception\RequestException; | |
| use Illuminate\Support\Facades\Http; | |
| use Illuminate\Support\Facades\Log; | |
| use Illuminate\Support\Str; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import crypto from 'crypto'; | |
| // Generate a symmetric key for AES encryption | |
| const generateSecretKey = () => { | |
| return crypto.randomBytes(32); // 256-bit key | |
| } | |
| const generateKeyPair = () => { | |
| const { publicKey, privateKey } = crypto.generateKeyPairSync('rsa', { | |
| modulusLength: 2048, // Key size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Helpers; | |
| use Firebase\JWT\JWT; | |
| use Firebase\JWT\Key; | |
| use Firebase\JWT\SignatureInvalidException; | |
| use GuzzleHttp\Client; | |
| class AppleServerNotification { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Helpers; | |
| use Illuminate\Support\Facades\Log; | |
| class GooglePlaySubscription { | |
| private $_serviceAccountPath = ''; | |
| private $_packageName = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Helpers; | |
| use Carbon\Carbon; | |
| use Exception; | |
| use Illuminate\Support\Facades\Log; | |
| use Jose\Component\Core\JWK; | |
| use Jose\Component\Encryption\Serializer\JWESerializerManager; | |
| use Jose\Component\Signature\Algorithm\PS256; |