https://github.com/kuloud/paypal_checkout_sdk
https://github.com/kuloud/paypal_checkout_sdk
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/kuloud/paypal_checkout_sdk
- Owner: kuloud
- License: mit
- Created: 2023-08-05T15:49:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-06T05:57:32.000Z (almost 3 years ago)
- Last Synced: 2025-03-18T18:53:08.158Z (over 1 year ago)
- Language: Dart
- Size: 60.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🎥 Flutter PayPal Checkout
## âš¡ Best and easy way to INTEGRATE PayPal checkout in Flutter application âš¡
Main features of `paypal_checkout_sdk` :
1. `Simple and easy to Connect Flutter with PayPal`
2. `Plug and Play🚀`
3. `Event Handlers🚀`
4. `Easy to follow guide`
## 🎖 Installing
```yaml
dependencies:
paypal_checkout_sdk: ^
```
### Android
in `app\build.gradle`
```
defaultConfig {
minSdkVersion 17
compileSdkVersion 33
}
```
### iOS
No extra setup is needed
## Usage
## âš¡ Setup:
```
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) =>
PaypalCheckout(
sandboxMode: true,
clientId: "CLIENT_ID",
secretKey: "SECRET_KEY",
returnURL: "RETURN_URL",
cancelURL: "CANCEL_URL",
transactions: const [
{
"amount": {
"total": '70',
"currency": "USD",
"details": {
"subtotal": '70',
"shipping": '0',
"shipping_discount": 0
}
},
"description": "The payment transaction description.",
"item_list": {
"items": [
{
"name": "Apple",
"quantity": 4,
"price": '5',
"currency": "USD"
},
{
"name": "Pineapple",
"quantity": 5,
"price": '10',
"currency": "USD"
}
],
// shipping address is Optional
"shipping_address": {
"recipient_name": "Raman Singh",
"line1": "Delhi",
"line2": "",
"city": "Delhi",
"country_code": "IN",
"postal_code": "11001",
"phone": "+00000000",
"state": "Texas"
},
}
}
],
note: "PAYMENT_NOTE",
onSuccess: (Map params) async {
print("onSuccess: $params");
},
onError: (error) {
print("onError: $error");
Navigator.pop(context);
},
onCancel: () {
print('cancelled:');
},
),
));
```
## âš¡ Events
```
onSuccess: (Map params) async {
print("onSuccess: $params");
},
onError: (error) {
print("onError: $error");
}
onCancel: () {
print('cancelled:');
}
```
## âš¡ Constructors Parameters
| Parameter | Type | Optional | Description |
|---|---|---|---
| `sandboxMode` | bool | YES | To use PayPal in Sandbox Mode. `Default value = false` |
| `clientId` | String | NO | Pass the PayPal Client Id. |
| `secretKey` | String | NO | Pass the PayPal Secret Key. |
| `returnURL` | String | NO | Return URL on Payment Success. |
| `cancelURL` | String | NO | Cancel URL on Payment Failed. |
| `transactions` | List\ | NO | Transaction parameters for making payment |
| `note` | String | YES | PayPal payment note if any. |
| `onSuccess` | Function(Dynamic) | YES | Event will be called on Successful payment. |
| `onError` | Function(Dynamic) | YES | Event will be called on Error/Failed payment. |
| `onCancel` | Function(Dynamic) | YES | Event will be called on Cancelled payment. |
-----------------------------------------------------------------------------
## Copyright & License
Code and documentation Copyright 2023 [kuloud](https://www.github.com/kuloud). Code released under the [MIT License](./LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/).