Skip to content

Commit

Permalink
Add zero contacts and isDigital to flutter
Browse files Browse the repository at this point in the history
Add trace to response
  • Loading branch information
KhaledAlramam committed Jun 8, 2023
1 parent 22044ab commit f45f6e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/PaymentSdkConfigurationDetails.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class PaymentSdkConfigurationDetails {
PaymentSdkTransactionType? transactionType;
IOSThemeConfigurations? iOSThemeConfigurations;
List<PaymentSdkAPms>? alternativePaymentMethods;
bool? isDigitalProduct = false;
bool? enableZeroContacts = false;
PaymentSdkConfigurationDetails(
{this.profileId,
this.serverKey,
Expand Down Expand Up @@ -68,7 +70,9 @@ class PaymentSdkConfigurationDetails {
this.transactionClass,
this.transactionType,
this.alternativePaymentMethods,
this.linkBillingNameWithCardHolderName});
this.linkBillingNameWithCardHolderName,
this.enableZeroContacts,
this.isDigitalProduct});

String getApmsConcatenated(List<PaymentSdkAPms>? list) {
if (list == null || list.isEmpty) return "";
Expand Down Expand Up @@ -115,7 +119,9 @@ extension PaymentSdkConfigurationDetailsExtension
pt_transaction_class: this.transactionClass?.name,
pt_transaction_type: this.transactionType?.name,
pt_apms: getApmsConcatenated(this.alternativePaymentMethods),
pt_link_billing_name: this.linkBillingNameWithCardHolderName
pt_link_billing_name: this.linkBillingNameWithCardHolderName,
pt_enable_zero_contacts: this.enableZeroContacts,
pt_is_digital_product: this.isDigitalProduct
};
}
}
5 changes: 4 additions & 1 deletion lib/PaymentSdkTokeniseType.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ enum PaymentSdkTokeniseType {
NONE,
USER_OPTIONAL,
USER_MANDATORY,
MERCHANT_MANDATORY
MERCHANT_MANDATORY,
USER_OPTIONAL_DEFAULT_ON
}

extension PaymentSdkTokeniseTypeExtension on PaymentSdkTokeniseType {
Expand All @@ -16,6 +17,8 @@ extension PaymentSdkTokeniseTypeExtension on PaymentSdkTokeniseType {
return "userMandatory";
case PaymentSdkTokeniseType.MERCHANT_MANDATORY:
return "merchantMandatory";
case PaymentSdkTokeniseType.USER_OPTIONAL_DEFAULT_ON:
return "userOptionalDefaultOn";
default:
return "none";
}
Expand Down
3 changes: 3 additions & 0 deletions lib/flutter_paytabs_bridge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ const String pt_ios_logo = "pt_ios_logo";
//PaymentSDKSavedCardInfo
const String pt_masked_card = "pt_masked_card";
const String pt_card_type = "pt_card_type";
// Billing new logic
const String pt_enable_zero_contacts = "pt_enable_zero_contacts";
const String pt_is_digital_product = "pt_is_digital_product";

class FlutterPaytabsBridge {
static Future<dynamic> startCardPayment(
Expand Down

0 comments on commit f45f6e8

Please sign in to comment.