PayPal Payment
Estimated reading: 2 minutes
Welcome to PayPal! In this guide, you will learn how to sign up for a PayPal account and obtain API keys necessary for integrating PayPal into your website or application.
Before proceeding further checkout Paypal Supported Currencies
Sign Up for PayPal
If you have an existing PayPal business account, Log in to the account.
Otherwise, Sign up and create a new business account.
- Choose Account - Choose your account typeImportant
You’ll need a PayPal Business account to do the following -
- Go live with integrations.
- Test integrations outside the US.
- Provide Your Details Fill out the registration form with your email address, preferred password, and other required information. Make sure to provide accurate details. and completed the Sign Up Process.
Obtain API Keys
There are two "modes" of operation for your PayPal account:
- Live Mode: Real money, real transactions, real effects.
- Sandbox Mode: Testing environment with simulated transactions.
PayPal integrations use a client ID and client secret.
Client ID : Identifies an app. You only need a client ID to get a PayPal payment button and standard credit and debit card fields.
Client secret : Authenticates a client ID.Keep this secret safe.
Follow these steps to obtain your API keys:
Get Client ID and Client Secret
Follow the steps below :
Open your PayPal Business Dashboard
Click on Testing Tools and Select SandBox Account
- Create Sandbox Account
Click on Apps & Credentials
Click on Create App:
Provide App Details:
- In the form that just came up, input the application details
- Choose your sandbox account
- click on Create App.
Copy Credentials:
- Now the Credentials are generated. Copy the Client ID and Client Secret.
Add Generated Keys into config.dart
Now you've successfully generated keys please update values into "config.dart".
- Navigate to lib → config.dart.
- Add values for constants shown below.
/// PAYPAl
const String payPalSupportedCurrency = 'USD';
const paypal_secret_key = '';
const paypal_client_id = '';
Congratulations! Your PayPal configuration is done.
Test PayPal Payment
Test cards can be used for simulating different scenarios during your development and testing phases. Remember, these cards are for testing purposes only and should not be used for real transactions.
You can create your own Test Card using link below -
Remove PayPal Payment
We are recommended you to follow only second Step if you don’t know about dependency and code
If you want to remove PayPal payment gateway option then follow below Steps:
Step 1- Go to pubspec.yaml and remove the lines mentioned below from the file
flutter_paypal_checkout: git: url: https://github.com/Raj-GMITS/flutter_paypal_checkout.git ref: main
If you have remove dependency from pubspec.yaml then hit the pub get command. now, remove the code related to flutter_paystack.