Updates
parent
2a22edfdd0
commit
efced34ffa
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"provider": "apple_pay",
|
||||||
|
"data": {
|
||||||
|
"merchantIdentifier": "merchant.com.hmgwebservices",
|
||||||
|
"displayName": "Sulaiman Al Habib",
|
||||||
|
"merchantCapabilities": [
|
||||||
|
"3DS",
|
||||||
|
"debit",
|
||||||
|
"credit"
|
||||||
|
],
|
||||||
|
"supportedNetworks": [
|
||||||
|
"amex",
|
||||||
|
"visa",
|
||||||
|
"discover",
|
||||||
|
"masterCard"
|
||||||
|
],
|
||||||
|
"countryCode": "SA",
|
||||||
|
"currencyCode": "SAR",
|
||||||
|
"requiredBillingContactFields": null,
|
||||||
|
"requiredShippingContactFields": null
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"provider": "apple_pay",
|
||||||
|
"data": {
|
||||||
|
"merchantIdentifier": "merchant.com.hmgwebservices",
|
||||||
|
"displayName": "Sulaiman Al Habib",
|
||||||
|
"merchantCapabilities": [
|
||||||
|
"3DS",
|
||||||
|
"debit",
|
||||||
|
"credit"
|
||||||
|
],
|
||||||
|
"supportedNetworks": [
|
||||||
|
"amex",
|
||||||
|
"visa",
|
||||||
|
"discover",
|
||||||
|
"masterCard"
|
||||||
|
],
|
||||||
|
"countryCode": "SA",
|
||||||
|
"currencyCode": "SAR",
|
||||||
|
"requiredBillingContactFields": null,
|
||||||
|
"requiredShippingContactFields": null
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,135 @@
|
|||||||
|
class ApplePayRequest {
|
||||||
|
String currency;
|
||||||
|
String language;
|
||||||
|
String customername;
|
||||||
|
dynamic customerEmail;
|
||||||
|
String orderdescription;
|
||||||
|
String liveServiceid;
|
||||||
|
String longitude;
|
||||||
|
String latitude;
|
||||||
|
String devicetoken;
|
||||||
|
String clientrequestid;
|
||||||
|
String projectid;
|
||||||
|
String serviceid;
|
||||||
|
String patientid;
|
||||||
|
String amount;
|
||||||
|
String appleData;
|
||||||
|
String appleSignature;
|
||||||
|
AppleHeader appleHeader;
|
||||||
|
ApplePaymentMethod applePaymentMethod;
|
||||||
|
|
||||||
|
ApplePayRequest(
|
||||||
|
{this.currency,
|
||||||
|
this.language,
|
||||||
|
this.customername,
|
||||||
|
this.customerEmail,
|
||||||
|
this.orderdescription,
|
||||||
|
this.liveServiceid,
|
||||||
|
this.longitude,
|
||||||
|
this.latitude,
|
||||||
|
this.devicetoken,
|
||||||
|
this.clientrequestid,
|
||||||
|
this.projectid,
|
||||||
|
this.serviceid,
|
||||||
|
this.patientid,
|
||||||
|
this.amount,
|
||||||
|
this.appleData,
|
||||||
|
this.appleSignature,
|
||||||
|
this.appleHeader,
|
||||||
|
this.applePaymentMethod});
|
||||||
|
|
||||||
|
ApplePayRequest.fromJson(Map<String, dynamic> json) {
|
||||||
|
currency = json['currency'];
|
||||||
|
language = json['language'];
|
||||||
|
customername = json['customername'];
|
||||||
|
customerEmail = json['customer_email'];
|
||||||
|
orderdescription = json['orderdescription'];
|
||||||
|
liveServiceid = json['live_serviceid'];
|
||||||
|
longitude = json['longitude'];
|
||||||
|
latitude = json['latitude'];
|
||||||
|
devicetoken = json['devicetoken'];
|
||||||
|
clientrequestid = json['clientrequestid'];
|
||||||
|
projectid = json['projectid'];
|
||||||
|
serviceid = json['serviceid'];
|
||||||
|
patientid = json['patientid'];
|
||||||
|
amount = json['Amount'];
|
||||||
|
appleData = json['apple_data'];
|
||||||
|
appleSignature = json['apple_signature'];
|
||||||
|
appleHeader = json['apple_header'] != null ? new AppleHeader.fromJson(json['apple_header']) : null;
|
||||||
|
applePaymentMethod = json['apple_paymentMethod'] != null ? new ApplePaymentMethod.fromJson(json['apple_paymentMethod']) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['currency'] = this.currency;
|
||||||
|
data['language'] = this.language;
|
||||||
|
data['customername'] = this.customername;
|
||||||
|
data['customer_email'] = this.customerEmail;
|
||||||
|
data['orderdescription'] = this.orderdescription;
|
||||||
|
data['live_serviceid'] = this.liveServiceid;
|
||||||
|
data['longitude'] = this.longitude;
|
||||||
|
data['latitude'] = this.latitude;
|
||||||
|
data['devicetoken'] = this.devicetoken;
|
||||||
|
data['clientrequestid'] = this.clientrequestid;
|
||||||
|
data['projectid'] = this.projectid;
|
||||||
|
data['serviceid'] = this.serviceid;
|
||||||
|
data['patientid'] = this.patientid;
|
||||||
|
data['Amount'] = this.amount;
|
||||||
|
data['apple_data'] = this.appleData;
|
||||||
|
data['apple_signature'] = this.appleSignature;
|
||||||
|
if (this.appleHeader != null) {
|
||||||
|
data['apple_header'] = this.appleHeader.toJson();
|
||||||
|
}
|
||||||
|
if (this.applePaymentMethod != null) {
|
||||||
|
data['apple_paymentMethod'] = this.applePaymentMethod.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AppleHeader {
|
||||||
|
String appleApplicationData;
|
||||||
|
String appleEphemeralPublicKey;
|
||||||
|
String applePublicKeyHash;
|
||||||
|
String appleTransactionId;
|
||||||
|
|
||||||
|
AppleHeader({this.appleApplicationData, this.appleEphemeralPublicKey, this.applePublicKeyHash, this.appleTransactionId});
|
||||||
|
|
||||||
|
AppleHeader.fromJson(Map<String, dynamic> json) {
|
||||||
|
appleApplicationData = json['apple_applicationData'];
|
||||||
|
appleEphemeralPublicKey = json['apple_ephemeralPublicKey'];
|
||||||
|
applePublicKeyHash = json['apple_publicKeyHash'];
|
||||||
|
appleTransactionId = json['apple_transactionId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['apple_applicationData'] = this.appleApplicationData;
|
||||||
|
data['apple_ephemeralPublicKey'] = this.appleEphemeralPublicKey;
|
||||||
|
data['apple_publicKeyHash'] = this.applePublicKeyHash;
|
||||||
|
data['apple_transactionId'] = this.appleTransactionId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ApplePaymentMethod {
|
||||||
|
String appleDisplayName;
|
||||||
|
String appleNetwork;
|
||||||
|
String appleType;
|
||||||
|
|
||||||
|
ApplePaymentMethod({this.appleDisplayName, this.appleNetwork, this.appleType});
|
||||||
|
|
||||||
|
ApplePaymentMethod.fromJson(Map<String, dynamic> json) {
|
||||||
|
appleDisplayName = json['apple_displayName'];
|
||||||
|
appleNetwork = json['apple_network'];
|
||||||
|
appleType = json['apple_type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['apple_displayName'] = this.appleDisplayName;
|
||||||
|
data['apple_network'] = this.appleNetwork;
|
||||||
|
data['apple_type'] = this.appleType;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,112 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
class ApplePayResponse {
|
||||||
|
PaymentMethod paymentMethod;
|
||||||
|
dynamic billingContact;
|
||||||
|
dynamic shippingMethod;
|
||||||
|
dynamic shippingContact;
|
||||||
|
Token token;
|
||||||
|
|
||||||
|
ApplePayResponse(
|
||||||
|
{this.paymentMethod,
|
||||||
|
this.billingContact,
|
||||||
|
this.shippingMethod,
|
||||||
|
this.shippingContact,
|
||||||
|
this.token});
|
||||||
|
|
||||||
|
ApplePayResponse.fromJson(Map<String, dynamic> jsonValue) {
|
||||||
|
paymentMethod = jsonValue['paymentMethod'] != null
|
||||||
|
? new PaymentMethod.fromJson(jsonValue['paymentMethod'])
|
||||||
|
: null;
|
||||||
|
// billingContact = json['billingContact'] != null ? json['billingContact'] : "";
|
||||||
|
// shippingMethod = json['shippingMethod'] != null ? json['shippingMethod'] : "";
|
||||||
|
// shippingContact = json['shippingContact'] != null ? json['shippingContact'] : "";
|
||||||
|
token = jsonValue['token'] != null ? new Token.fromJson(json.decode(jsonValue['token'])) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.paymentMethod != null) {
|
||||||
|
data['paymentMethod'] = this.paymentMethod.toJson();
|
||||||
|
}
|
||||||
|
data['billingContact'] = this.billingContact;
|
||||||
|
data['shippingMethod'] = this.shippingMethod;
|
||||||
|
data['shippingContact'] = this.shippingContact;
|
||||||
|
if (this.token != null) {
|
||||||
|
data['token'] = this.token.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PaymentMethod {
|
||||||
|
dynamic network;
|
||||||
|
dynamic displayName;
|
||||||
|
dynamic type;
|
||||||
|
|
||||||
|
PaymentMethod({this.network, this.displayName, this.type});
|
||||||
|
|
||||||
|
PaymentMethod.fromJson(Map<String, dynamic> json) {
|
||||||
|
network = json['network'];
|
||||||
|
displayName = json['displayName'];
|
||||||
|
type = json['type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['network'] = this.network;
|
||||||
|
data['displayName'] = this.displayName;
|
||||||
|
data['type'] = this.type;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Token {
|
||||||
|
String version;
|
||||||
|
String data;
|
||||||
|
String signature;
|
||||||
|
Header header;
|
||||||
|
|
||||||
|
Token({this.version, this.data, this.signature, this.header});
|
||||||
|
|
||||||
|
Token.fromJson(Map<String, dynamic> json) {
|
||||||
|
version = json['version'];
|
||||||
|
data = json['data'];
|
||||||
|
signature = json['signature'];
|
||||||
|
header =
|
||||||
|
json['header'] != null ? new Header.fromJson(json['header']) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['version'] = this.version;
|
||||||
|
data['data'] = this.data;
|
||||||
|
data['signature'] = this.signature;
|
||||||
|
if (this.header != null) {
|
||||||
|
data['header'] = this.header.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Header {
|
||||||
|
String ephemeralPublicKey;
|
||||||
|
String publicKeyHash;
|
||||||
|
String transactionId;
|
||||||
|
|
||||||
|
Header({this.ephemeralPublicKey, this.publicKeyHash, this.transactionId});
|
||||||
|
|
||||||
|
Header.fromJson(Map<String, dynamic> json) {
|
||||||
|
ephemeralPublicKey = json['ephemeralPublicKey'];
|
||||||
|
publicKeyHash = json['publicKeyHash'];
|
||||||
|
transactionId = json['transactionId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ephemeralPublicKey'] = this.ephemeralPublicKey;
|
||||||
|
data['publicKeyHash'] = this.publicKeyHash;
|
||||||
|
data['transactionId'] = this.transactionId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue