flutter_pay_buttons 0.0.2
flutter_pay_buttons: ^0.0.2 copied to clipboard
A Flutter plugin to add Apple Pay support or Google Pay support via the pay package, with a custom widgets.
Flutter Pay Buttons Flutter Plugin #
A Flutter plugin that adds Flutter Pay Buttons support using the pay package under the hood. This plugin provides a customizable Flutter Pay Buttons and simplifies the integration process.
Features #
- Custom Apple Pay button with styling options
- Uses the reliable
paypackage for handling payment requests - Easy to integrate in your existing Flutter app
Getting Started #
Before you begin, ensure the following:
- You're developing on a macOS system (Apple Pay is only available on iOS/macOS).
- Your app has the necessary entitlements and configuration for Apple Pay.
- You’ve set up Apple or Google Merchant ID's and certificates in your Apple or Google Developer account.
Installation #
Add the dependency in your pubspec.yaml:
dependencies:
flutter_pay_buttons:
git:
url: https://github.com/M-Tayyab-Mustafa/flutter_pay_buttons
Payment Data Cryptography #
Google Pay encrypts payment information before it leaves the user’s device using industry-standard public key cryptography. When your app receives the payment response, it contains:
- Encrypted Payment Data — Sensitive card/payment details
- Signature — For verifying data integrity
- Intermediate Signing Key — Used to validate the signature
How Google Pay Encryption Works #
- Device Encryption — Google Pay encrypts the payment data using your payment processor’s public key.
- Data Transport — The encrypted blob is returned to your app through the Google Pay API.
- Signature Verification — Your server verifies the signature using the intermediate signing key provided in the response.
- Decryption — Your server decrypts the payment data using your private key.
- Processing — The decrypted details are sent to your payment processor for authorization.
Important #
- Never decrypt payment data in the client app.
- Always verify the signature before decryption.
- Keep private keys secure and only on your backend server.
📚 References: