Skip to content

Commit 0c5a5cc

Browse files
authored
Merge pull request #17 from MadBrains/minor_edits
[2.1.3] Checking applicationData for empty. Optional merchantId.
2 parents a15bc81 + 586767f commit 0c5a5cc

File tree

7 files changed

+16
-7
lines changed

7 files changed

+16
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.1.3
2+
3+
* [iOS] checking `applicationData` for empty
4+
* [Android] optional `merchantId`
5+
16
## 2.1.2
27

38
* [Android] add `merchantId`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Easy integration with Google Pay and Apple Pay for your flutter app.
1717
Add this to your package's pubspec.yaml file:
1818
```yaml
1919
dependencies:
20-
mad_pay: 2.1.2
20+
mad_pay: 2.1.3
2121
```
2222
2323
<details><summary><b>For Android</b></summary>

android/src/main/kotlin/ru/madbrains/mad_pay/RawMethods.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class RawMethods {
121121
currencyCode: String, countryCode: String, emailRequired: Boolean): JSONObject {
122122
val merchantInfo = when {
123123
google.merchantName.isNotEmpty() -> JSONObject()
124-
.put("merchantId", google.merchantId)
124+
.putOpt("merchantId", google.merchantId)
125125
.putOpt("merchantName", google.merchantName)
126126
else -> null
127127
}

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ packages:
7373
path: ".."
7474
relative: true
7575
source: path
76-
version: "2.1.2"
76+
version: "2.1.3"
7777
matcher:
7878
dependency: transitive
7979
description:

ios/Classes/SwiftMadPayPlugin.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ public class SwiftMadPayPlugin: NSObject, FlutterPlugin {
101101
paymentRequest.shippingContact = PaymentNetworkHelper.getContact(arguments.apple.shippingContact)
102102
paymentRequest.shippingMethods = PaymentNetworkHelper.getShippingMethods(arguments.apple.shippingMethods)
103103
paymentRequest.shippingType = PaymentNetworkHelper.getShippingType(arguments.apple.shippingType)
104-
paymentRequest.applicationData = arguments.apple.applicationData
104+
105+
if !arguments.apple.applicationData.isEmpty {
106+
paymentRequest.applicationData = arguments.apple.applicationData
107+
}
108+
105109
if #available(iOS 11.0, *) {
106110
if !arguments.apple.requiredBillingContactFields.isEmpty {
107111
paymentRequest.requiredBillingContactFields = PaymentNetworkHelper.getContactFields(arguments.apple.requiredBillingContactFields)

lib/src/models/google_parameters.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class GoogleParameters {
88
GoogleParameters({
99
required this.gatewayName,
1010
required this.gatewayMerchantId,
11-
required this.merchantId,
11+
this.merchantId,
1212
this.merchantName,
1313
this.cardParameters,
1414
this.transactionInfo,
@@ -31,7 +31,7 @@ class GoogleParameters {
3131
/// Required when PaymentsClient is initialized with an environment property of `PRODUCTION`.
3232
///
3333
/// In environment `TEST`, use the value `TEST`.
34-
final String merchantId;
34+
final String? merchantId;
3535

3636
/// Merchant name is rendered in the payment sheet.
3737
/// In TEST environment, or if a merchant isn't recognized,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: mad_pay
22
description: Mad Pay will help you make payments through Apple Pay and Google Pay
3-
version: 2.1.2
3+
version: 2.1.3
44
repository: https://github.com/MadBrains/Mad-Pay-Flutter
55
issue_tracker: https://github.com/MadBrains/Mad-Pay-Flutter/issues
66
homepage: https://madbrains.ru/

0 commit comments

Comments
 (0)