Skip to content

Commit e4cc698

Browse files
authored
Fix Apple Pay (#7)
* fix null exception in apple pay source response * update the merchant id * update the readme * pump the version with the changelog
1 parent eddfec3 commit e4cc698

File tree

8 files changed

+13
-15
lines changed

8 files changed

+13
-15
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.0.1
2+
3+
- [Apple Pay] Fix handling the Apple Pay response when the `company` and `name` fields aren't returned from the API.
4+
- [Docs] Fix a typo in the installation command.
5+
- [Docs] Improve the application description in pub.dev
6+
17
## 1.0.0
28

39
- Build the Dart Moyasar API wrapper.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ android {
5050
### Installation
5151

5252
```sh
53-
flutter pub get moyasar
53+
flutter pub add moyasar
5454
```
5555

5656
## Usage

example/assets/default_payment_profile_apple_pay.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"provider": "apple_pay",
33
"data": {
4-
"merchantIdentifier": "merchant.nuha.io.second",
4+
"merchantIdentifier": "merchant.mysr.fghurayri",
55
"displayName": "Coffee Shop",
66
"merchantCapabilities": ["3DS", "debit", "credit"],
77
"supportedNetworks": ["amex", "visa", "mada", "masterCard"],

example/ios/Runner/Runner.entitlements

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<dict>
55
<key>com.apple.developer.in-app-payments</key>
66
<array>
7-
<string>merchant.nuha.io.second</string>
7+
<string>merchant.mysr.fghurayri</string>
88
</array>
99
</dict>
1010
</plist>

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ packages:
134134
path: ".."
135135
relative: true
136136
source: path
137-
version: "1.0.0"
137+
version: "1.0.1"
138138
path:
139139
dependency: transitive
140140
description:

lib/src/models/sources/apple_pay/apple_pay_response_source.dart

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import 'package:moyasar/src/models/payment_type.dart';
2-
import 'package:moyasar/src/models/sources/card/card_company.dart';
32
import 'package:moyasar/src/models/sources/payment_response_source.dart';
43

54
/// The response source from Moyasar API for the Apple Pay payment.
65
class ApplePayPaymentResponseSource implements PaymentResponseSource {
76
@override
87
PaymentType type = PaymentType.applepay;
98

10-
final CardCompany company;
11-
final String name;
12-
139
/// The [number] is masked.
1410
/// For example, `"XXXX-XXXX-XXXX-1115"`
1511
final String number; // masked!
@@ -19,18 +15,14 @@ class ApplePayPaymentResponseSource implements PaymentResponseSource {
1915
String? message;
2016

2117
ApplePayPaymentResponseSource({
22-
required this.company,
23-
required this.name,
2418
required this.number,
2519
required this.gatewayId,
2620
this.referenceNumber,
2721
this.message,
2822
});
2923

3024
ApplePayPaymentResponseSource.fromJson(Map<String, dynamic> json)
31-
: company = CardCompany.values.byName(json['company']),
32-
name = json['name'],
33-
number = json['number'],
25+
: number = json['number'],
3426
gatewayId = json['gateway_id'],
3527
referenceNumber = json['reference_number'],
3628
message = json['message'];

lib/src/moyasar.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:moyasar/moyasar.dart';
55

66
import 'package:moyasar/src/models/payment_request.dart';
77

8-
const version = "1.0.0";
8+
const version = "1.0.1";
99

1010
class Moyasar {
1111
static const String apiUrl = 'https://api.moyasar.com/v1/payments';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: moyasar
22
description: The Official Moyasar Flutter SDK.
3-
version: 1.0.0
3+
version: 1.0.1
44
homepage: https://moyasar.com/en/
55
repository: https://github.com/moyasar/moyasar-flutter
66
issue_tracker: https://github.com/moyasar/moyasar-flutter/issues

0 commit comments

Comments
 (0)