Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wcoder/trustly-payments-xamarin
An unofficial port of Trustly to Xamarin.Android and Xamarin.iOS
https://github.com/wcoder/trustly-payments-xamarin
android ios payment-integration trustly xamarin xamarin-android xamarin-ios
Last synced: 28 days ago
JSON representation
An unofficial port of Trustly to Xamarin.Android and Xamarin.iOS
- Host: GitHub
- URL: https://github.com/wcoder/trustly-payments-xamarin
- Owner: wcoder
- License: mit
- Created: 2020-02-24T20:53:54.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-25T07:43:09.000Z (almost 5 years ago)
- Last Synced: 2024-12-09T12:49:10.801Z (about 1 month ago)
- Topics: android, ios, payment-integration, trustly, xamarin, xamarin-android, xamarin-ios
- Language: C#
- Homepage: https://trustly.com/en/developer/api/#/iosandroid
- Size: 34.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trustly for Xamarin
Trustly payments for Xamarin.Android and Xamarin.iOS
[Full documentation](https://trustly.com/en/developer/api/#/iosandroid)
## iOS
Setup WKWebView:
```cs
public override void ViewDidLoad()
{
base.ViewDidLoad();
var userContentController = new WKUserContentController();
var configuration = new WKWebViewConfiguration();configuration.UserContentController = userContentController;
// Use configuration when creating WKWebView and attach it to your view
_webView = new WKWebView(webViewContainer.Bounds, configuration);
webViewContainer.AddSubview(_webView);// Add TrustlyWKScriptMessageHandler
userContentController.AddScriptMessageHandler(
new TrustlyWKScriptOpenURLScheme(_webView),
TrustlyWKScriptOpenURLScheme.NAME);
}
```Also you can see [native README](native/trustly-framework-ios)
## Android
### Step 1
Setup WebView:
```cs
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.activity_main);// Get WebView & WebSettings
var myWebView = FindViewById(Resource.Id.webview);
myWebView.SetWebViewClient(new WebViewClient());
var webSettings = myWebView.Settings;// Enable javascript and DOM Storage
webSettings.JavaScriptEnabled = true;
webSettings.DomStorageEnabled = true;// Add TrustlyJavascriptInterface
myWebView.AddJavascriptInterface(
new TrustlyJavascriptInterface(this),
TrustlyJavascriptInterface.NAME);
}
```### Step 2
Add to the Android project reference to the `Mono.Android.Export.dll` (**Android Project > References > Add reference... > All > Select Mono.Android.Export > OK**)
Also you can see [native README](native/trustly-library-android)