mercado_pago_integration
適用於安卓和 iOS 的 MercadoPago 移動結帳整合。安裝簡單,整合輕鬆,支援安卓,支援 iOS。
Flutter 插件,用於在 Android 和 iOS 上支援 MercadoPago 移動結帳
^1.2.0^0.17.0^0.9.2^1.2.3{"sdk":"flutter"}{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
Screenshot iOS
To use this plugin, add mercado_pago_integration as a dependency in your pubspec.yaml file.
Only 4 steps needed to create a basic checkout using mercado_pago_integration:
import 'package:mercado_pago_integration/mercado_pago_integration.dart';
PublicKey and AccessTokenIn order to start a new mobile checkout, you need to have a Public_Key & AccessToken
See the example below, if you want more information, here is the official documentation.
final Map<String, Object> preferenceMap = {
'items': [
{
'title': 'Test Product',
'description': 'Description',
'quantity': 3,
'currency_id': 'ARS',
'unit_price': 1500,
}
],
'payer': {'name': 'Buyer G.', 'email': 'test@gmail.com'},
};
(await MercadoPagoIntegration.startCheckout(
publicKey: "PUBLIC_KEY",
preference: preference,
accessToken: "ACCESS_TOKEN",
)
).fold(
(Failure failure) => debugPrint('Failure => ${failure.message}'),
(Payment payment) => debugPrint('Payment => ${payment.id}')
);
Podfileplatform :ios, '10.0'
AppDelegate.swiftimport UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
var navigationController: UINavigationController?;
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let flutterViewController: FlutterViewController = window?.rootViewController as! FlutterViewController
GeneratedPluginRegistrant.register(with: self)
self.navigationController = UINavigationController(rootViewController: flutterViewController)
self.navigationController?.isNavigationBarHidden = true
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = self.navigationController
self.window?.makeKeyAndVisible()
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
class CustomFlutterViewController:FlutterViewController {
override open func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.isNavigationBarHidden = true
}
override open func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.isNavigationBarHidden = false
}
}
Main.storyboard using CustomFlutterViewController instead of FlutterViewController customClass="CustomFlutterViewController" customModule="Runner" customModuleProvider="target"
class {
Payment({
this.collectorId,
this.couponAmount,
this.currencyId,
this.dateCreated,
this.paymentId,
this.operationType,
this.paymentMethodId,
this.paymentTypeId,
this.status,
this.statusDetail,
this.transactionAmount,
this.transactionAmountRefunded,
this.dateApproved,
});
}
To Be Defined
This project includes an example project using Mercado Pago Integration, checkout example folder. In case you need support contact the Caramel Point Developers Site.
Caramel Point
MIT License
Copyright (c) CaramelPoint Inc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.