flutter_paypal_payment
이 패키지는 모바일 앱에 PayPal 결제를 통합하는 것을 간소화합니다. 주요 기능으로는 앱 내에서 원활한 PayPal 통합이 포함됩니다
tharwatsamy/flutter_paypal_payment_checkout open-source repository details.
^5.3.3{"sdk":"flutter"}^6.1.5^2.0.0{"sdk":"flutter"}^1.25.7아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
The Flutter PayPal Payment Package provides an easy-to-integrate solution for enabling PayPal payments in your Flutter mobile application. This package allows for a seamless checkout experience with both sandbox and production environments.
To install the Flutter PayPal Payment Package, follow these steps
Add the package to your project's dependencies in the pubspec.yaml file:
dependencies:
flutter_paypal_payment: ^1.0.7
Run the following command to fetch the package:
flutter pub get
Import the package into your Dart file:
import 'package:flutter_paypal_payment/flutter_paypal_payment.dart';
Navigate to the PayPal checkout view with the desired configuration:
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => PaypalCheckoutView(
sandboxMode: true,
clientId: "",
secretKey: "",
transactions: const [
{
"amount": {
"total": '70',
"currency": "USD",
"details": {
"subtotal": '70',
"shipping": '0',
"shipping_discount": 0
}
},
"description": "The payment transaction description.",
// "payment_options": {
// "allowed_payment_method":
// "INSTANT_FUNDING_SOURCE"
// },
"item_list": {
"items": [
{
"name": "Apple",
"quantity": 4,
"price": '5',
"currency": "USD"
},
{
"name": "Pineapple",
"quantity": 5,
"price": '10',
"currency": "USD"
}
],
// shipping address is not required though
// "shipping_address": {
// "recipient_name": "tharwat",
// "line1": "Alexandria",
// "line2": "",
// "city": "Alexandria",
// "country_code": "EG",
// "postal_code": "21505",
// "phone": "+00000000",
// "state": "Alexandria"
// },
}
}
],
note: "Contact us for any questions on your order.",
onSuccess: (Map params) async {
print("onSuccess: $params");
},
onError: (error) {
print("onError: $error");
Navigator.pop(context);
},
onCancel: () {
print('cancelled:');
},
),
));
If you would like to support me, please consider making a donation through one of the following links:
Thank you for your support!