Skip to content

Commit

Permalink
Merge pull request #243 from razorpay/dashboard-monitoring
Browse files Browse the repository at this point in the history
Dashboard monitoring
  • Loading branch information
ramprasadAnand committed Apr 5, 2022
2 parents 39d62a6 + 8bc4777 commit cc35b5e
Show file tree
Hide file tree
Showing 21 changed files with 278 additions and 228 deletions.
32 changes: 32 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "razorpay-flutter",
"request": "launch",
"type": "dart"
},
{
"name": "razorpay-flutter (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "example",
"cwd": "example",
"request": "launch",
"type": "dart"
},
{
"name": "example (profile mode)",
"cwd": "example",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dart.flutterSdkPath": "/Users/ramprasad.a/Developer/flutter"
}
26 changes: 23 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,55 @@
## 1.3.0

- Standardised the events
- Minor bug fixes

## 1.2.9

- Android Native Fixes and Performance Improvements.

## 1.2.7

- Updated package to support for NULL safety.

## 1.2.6

- Updated package to support for NULL safety.

## 1.2.3
- Updated Android API key version.

- Updated Android API key version.

## 1.2.2

- Updated Podspec to use `razorpay-pod ~> 1.1.5`

## 1.2.1

- Android bug fixes.

## 1.2.0

- Android implementation fixes added.

## 1.1.4

- Android SDK changes updated

## 1.1.3
- Updated podspec for without the version so it will always point to the latest version.

- Updated podspec for without the version so it will always point to the latest version.
- Updated changes around Module stability related to iOS and Swift.

## 1.1.2

- Updated Podspec to use `razorpay-pod ~> 1.1.4`

## 1.1.1

- Updated podspec and build.gradle to match plugin versions

## 1.1.0

- Removed alpha status

## 1.1.0-alpha
Expand All @@ -39,4 +59,4 @@

## 1.0.0-alpha

* Initial Release
- Initial Release
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Flutter plugin for Razorpay SDK.

[![pub package](https://img.shields.io/pub/v/razorpay_flutter.svg)](https://pub.dartlang.org/packages/razorpay_flutter)

* [Getting Started](#getting-started)
* [Prerequisites](#prerequisites)
* [Installation](#installation)
* [Usage](#usage)
* [Troubleshooting](#troubleshooting)
* [API](#api)
* [Example App](https://github.com/razorpay/razorpay-flutter/tree/master/example)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Troubleshooting](#troubleshooting)
- [API](#api)
- [Example App](https://github.com/razorpay/razorpay-flutter/tree/master/example)

## Getting Started

Expand All @@ -26,9 +26,8 @@ To know more about Razorpay payment flow and steps involved, read up here: [http

## Prerequisites

- Learn about the <a href="https://razorpay.com/docs/payment-gateway/payment-flow/" target="_blank">Razorpay Payment Flow</a>.
- Sign up for a <a href="https://dashboard.razorpay.com/#/access/signin">Razorpay Account</a> and generate the <a href="https://razorpay.com/docs/payment-gateway/dashboard-guide/settings/#api-keys/" target="_blank">API Keys</a> from the Razorpay Dashboard. Using the Test keys helps simulate a sandbox environment. No actual monetary transaction happens when using the Test keys. Use Live keys once you have thoroughly tested the application and are ready to go live.

- Learn about the <a href="https://razorpay.com/docs/payment-gateway/payment-flow/" target="_blank">Razorpay Payment Flow</a>.
- Sign up for a <a href="https://dashboard.razorpay.com/#/access/signin">Razorpay Account</a> and generate the <a href="https://razorpay.com/docs/payment-gateway/dashboard-guide/settings/#api-keys/" target="_blank">API Keys</a> from the Razorpay Dashboard. Using the Test keys helps simulate a sandbox environment. No actual monetary transaction happens when using the Test keys. Use Live keys once you have thoroughly tested the application and are ready to go live.

## Installation

Expand All @@ -37,13 +36,15 @@ This plugin is available on Pub: [https://pub.dev/packages/razorpay_flutter](htt
Add this to `dependencies` in your app's `pubspec.yaml`

```yaml
razorpay_flutter: ^1.2.3
razorpay_flutter: ^1.3.0
```

**Note for Android**: Make sure that the minimum API level for your app is 19 or higher.

### Proguard rules

If you are using proguard for your builds, you need to add following lines to proguard files

```
-keepattributes *Annotation*
-dontwarn com.razorpay.**
Expand All @@ -64,7 +65,7 @@ Run `flutter packages get` in the root directory of your app.

Sample code to integrate can be found in [example/lib/main.dart](example/lib/main.dart).

#### Import package
#### Import package

```dart
import 'package:razorpay_flutter/razorpay_flutter.dart';
Expand Down Expand Up @@ -142,6 +143,7 @@ _razorpay.open(options);
### Enabling Bitcode

Open `ios/Podfile` and find this section:

```ruby
post_install do |installer|
installer.pods_project.targets.each do |target|
Expand All @@ -151,6 +153,7 @@ post_install do |installer|
end
end
```

Set `config.build_settings['ENABLE_BITCODE'] = 'YES'`.

### Setting Swift version
Expand All @@ -172,11 +175,14 @@ This is due to your minimum deployment target being less than iOS 10.0. To chang
```ruby
# platform :ios, '9.0'
```
and change it to

and change it to

```ruby
platform :ios, '10.0'
```
and run `pod install` again in the `ios` directory.

and run `pod install` again in the `ios` directory.

### iOS build fails with `'razorpay_flutter/razorpay_flutter-Swift.h' file not found`

Expand All @@ -191,6 +197,7 @@ This is due to your Android minimum SDK version being less than 19. To change th
We export a class `Razorpay` from `package:razorpay_flutter/razorpay_flutter.dart`. Check if your code is redeclaring the `Razorpay` class.

### Type 'xxxx' is not a subtype of type 'xxxx' of 'response' in `Razorpay.on.<anonymous closure>`

```
[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: type 'PaymentFailureResponse' is not a subtype of type 'PaymentSuccessResponse' of 'response'
#0 Razorpay.on.<anonymous closure> (package:razorpay_flutter/razorpay_flutter.dart:87:14)
Expand All @@ -209,9 +216,9 @@ Check the signatures of the callbacks for payment events. They should match the

#### open(map<String, dynamic> options)

Open Razorpay Checkout.
Open Razorpay Checkout.

The `options` map has `key` as a required property. All other properties are optional.
The `options` map has `key` as a required property. All other properties are optional.
For a complete list of options, please see [the Checkout documentation](https://razorpay.com/docs/payment-gateway/integrations-guide/checkout/standard/#checkout-form).

#### on(String eventName, Function listener)
Expand Down Expand Up @@ -269,7 +276,6 @@ The event names have also been exposed as Strings by the `Razorpay` class.

### ExternalWalletResponse

| Field Name | Type | Description |
| ----------- | ------- | ----------------------------------------- |
| walletName | String | The name of the external wallet selected. |

| Field Name | Type | Description |
| ---------- | ------ | ----------------------------------------- |
| walletName | String | The name of the external wallet selected. |
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ android {
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api 'com.razorpay:checkout:1.6.15'
api 'com.razorpay:checkout:1.6.19'
}
}
11 changes: 1 addition & 10 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.razorpay.razorpay_flutter">
<application>
<activity
android:exported="false"
android:name="com.razorpay.CheckoutActivity"
android:label="Razorpay Checkout" >
</activity>
<receiver android:name="com.razorpay.RzpTokenReceiver" android:exported="false">
<intent-filter>
<action android:name="rzp.device_token.share" />
</intent-filter>
</receiver>

</application>
</manifest>
2 changes: 1 addition & 1 deletion example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/sumedhtambat/StudioProjects/flutter-projects/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.0.6/","dependencies":[]},{"name":"razorpay_flutter","path":"/Users/sumedhtambat/StudioProjects/flutter-projects/razorpay-flutter/","dependencies":[]}],"android":[{"name":"fluttertoast","path":"/Users/sumedhtambat/StudioProjects/flutter-projects/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.0.6/","dependencies":[]},{"name":"razorpay_flutter","path":"/Users/sumedhtambat/StudioProjects/flutter-projects/razorpay-flutter/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[{"name":"fluttertoast","path":"/Users/sumedhtambat/StudioProjects/flutter-projects/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.0.6/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"razorpay_flutter","dependencies":[]}],"date_created":"2021-08-09 11:19:56.193825","version":"2.0.6"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/ramprasad.a/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.0.7/","dependencies":[]},{"name":"razorpay_flutter","path":"/Users/ramprasad.a/Documents/RamprasadA/project/razorpay-flutter/","dependencies":["fluttertoast"]}],"android":[{"name":"fluttertoast","path":"/Users/ramprasad.a/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.0.7/","dependencies":[]},{"name":"razorpay_flutter","path":"/Users/ramprasad.a/Documents/RamprasadA/project/razorpay-flutter/","dependencies":["fluttertoast"]}],"macos":[],"linux":[],"windows":[],"web":[{"name":"fluttertoast","path":"/Users/ramprasad.a/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.0.7/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"razorpay_flutter","dependencies":["fluttertoast"]}],"date_created":"2022-04-05 19:16:10.060795","version":"2.8.1"}
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
18 changes: 18 additions & 0 deletions example/ios/Flutter/Flutter.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# NOTE: This podspec is NOT to be published. It is only used as a local source!
# This is a generated file; do not edit or check into version control.
#

Pod::Spec.new do |s|
s.name = 'Flutter'
s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.'
s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '9.0'
# Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
end
13 changes: 7 additions & 6 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/sumedhtambat/StudioProjects/flutter-projects/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/sumedhtambat/StudioProjects/flutter-projects/razorpay-flutter/example"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_ROOT=/Users/ramprasad.a/Developer/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/ramprasad.a/Documents/RamprasadA/project/razorpay-flutter/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=/Users/ramprasad.a/Documents/RamprasadA/project/razorpay-flutter/example/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.2.6"
export "FLUTTER_BUILD_NUMBER=1.2.6"
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
export "PACKAGE_CONFIG=/Users/ramprasad.a/Documents/RamprasadA/project/razorpay-flutter/example/.dart_tool/package_config.json"
69 changes: 21 additions & 48 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand All @@ -10,62 +10,35 @@ project 'Runner', {
'Release' => :release,
}

def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

target 'Runner' do
use_frameworks!
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
flutter_ios_podfile_setup

# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
end
}
target 'Runner' do
use_frameworks!
use_modular_headers!

# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'YES'
end
flutter_additional_ios_build_settings(target)
end
# installer.pods_project.build_configurations.each do |config|
# config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
# end
end

0 comments on commit cc35b5e

Please sign in to comment.