Skip to content

Commit

Permalink
Release 2.0.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldlineConnect committed Nov 12, 2024
1 parent 614b174 commit 0ffc4ba
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target 'WorldlineConnectExample' do
# use_frameworks!

# Pods for WorldlineConnectExample
pod 'WorldlineConnectSDK', '~> 6.1'
pod 'WorldlineConnectSDK', '~> 7.0'
pod 'SVProgressHUD'

end
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PODS:
- SVProgressHUD (2.2.5)
- WorldlineConnectSDK (6.1.0)
- WorldlineConnectSDK (7.0.0)

DEPENDENCIES:
- SVProgressHUD
- WorldlineConnectSDK (6.1.0)
- WorldlineConnectSDK (7.0.0)

SPEC REPOS:
trunk:
Expand Down
2 changes: 1 addition & 1 deletion WorldlineConnectExample/WCAppConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
#define kWCCurrency @"kWCCurrency"
#define kWCBoletoBancarioId @"1503"
#define kWCBancontactId @"3012"
#define kWCApplicationIdentifier @"iOS Example Application/v2.0.2"
#define kWCApplicationIdentifier @"iOS Example Application/v2.0.3"
#endif
21 changes: 18 additions & 3 deletions WorldlineConnectExample/WCStartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ @interface WCStartViewController () <UIPickerViewDelegate, UIPickerViewDataSourc
@property (strong, nonatomic) WCTextField *currencyCodeTextField;
@property (strong, nonatomic) WCLabel *isRecurringLabel;
@property (strong, nonatomic) WCSwitch *isRecurringSwitch;
@property (strong, nonatomic) WCLabel *isInInstallmentsLabel;
@property (strong, nonatomic) WCSwitch *isInInstallmentsSwitch;
@property (strong, nonatomic) UIButton *payButton;
@property (strong, nonatomic) WCLabel *groupMethodsLabel;
@property (strong, nonatomic) UISwitch *groupMethodsSwitch;
Expand Down Expand Up @@ -222,6 +224,14 @@ - (void)viewDidLoad
[self.containerView addSubview:self.isRecurringLabel];
[self.containerView addSubview:self.isRecurringSwitch];

self.isInInstallmentsLabel = [self.viewFactory labelWithType:WCLabelType];
self.isInInstallmentsLabel.text = NSLocalizedStringFromTable(@"PaymentInInstallments", kWCAppLocalizable, @"Payment is in installments");
self.isInInstallmentsLabel.translatesAutoresizingMaskIntoConstraints = NO;
self.isInInstallmentsSwitch = [self.viewFactory switchWithType:WCSwitchType];
self.isInInstallmentsSwitch.translatesAutoresizingMaskIntoConstraints = NO;
[self.containerView addSubview:self.isInInstallmentsLabel];
[self.containerView addSubview:self.isInInstallmentsSwitch];

self.groupMethodsLabel = [self.viewFactory labelWithType:WCLabelType];
self.groupMethodsLabel.text = NSLocalizedStringWithDefaultValue(@"GroupMethods", kWCAppLocalizable, [NSBundle bundleWithPath:kWCSDKBundlePath], @"Group payment products", @"");
//groupMethodsLabel.text = NSLocalizedStringFromTable(@"GroupMethods", kWCAppLocalizable, @"Display payment methods as group");
Expand All @@ -237,7 +247,7 @@ - (void)viewDidLoad
[self.payButton addTarget:self action:@selector(buyButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
[self.containerView addSubview:self.payButton];

NSDictionary *views = NSDictionaryOfVariableBindings(_explanation, _clientSessionIdLabel, _clientSessionIdTextField, _customerIdLabel, _customerIdTextField, _baseURLLabel, _baseURLTextField, _assetsBaseURLLabel, _assetsBaseURLTextField, _jsonButton, _merchantIdLabel, _merchantIdTextField, _amountLabel, _amountTextField, _countryCodeLabel, _countryCodeTextField, _currencyCodeLabel, _currencyCodeTextField, _isRecurringLabel, _isRecurringSwitch, _payButton, _groupMethodsLabel, _groupMethodsSwitch, _parsableFieldsContainer, _containerView, _scrollView, superContainerView);
NSDictionary *views = NSDictionaryOfVariableBindings(_explanation, _clientSessionIdLabel, _clientSessionIdTextField, _customerIdLabel, _customerIdTextField, _baseURLLabel, _baseURLTextField, _assetsBaseURLLabel, _assetsBaseURLTextField, _jsonButton, _merchantIdLabel, _merchantIdTextField, _amountLabel, _amountTextField, _countryCodeLabel, _countryCodeTextField, _currencyCodeLabel, _currencyCodeTextField, _isRecurringLabel, _isRecurringSwitch, _isInInstallmentsLabel, _isInInstallmentsSwitch, _payButton, _groupMethodsLabel, _groupMethodsSwitch, _parsableFieldsContainer, _containerView, _scrollView, superContainerView);
NSDictionary *metrics = @{@"fieldSeparator": @"24", @"groupSeparator": @"72"};

// ParsableFieldsContainer Constraints
Expand All @@ -264,9 +274,10 @@ - (void)viewDidLoad
[self.containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_currencyCodeLabel]-|" options:0 metrics:nil views:views]];
[self.containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_currencyCodeTextField]-|" options:0 metrics:nil views:views]];
[self.containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_isRecurringLabel]-[_isRecurringSwitch]-|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:views]];
[self.containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_isInInstallmentsLabel]-[_isInInstallmentsSwitch]-|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:views]];
[self.containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_groupMethodsLabel]-[_groupMethodsSwitch]-|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:views]];
[self.containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|-[_payButton]-|" options:0 metrics:nil views:views]];
[self.containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[_explanation]-(fieldSeparator)-[_parsableFieldsContainer]-(fieldSeparator)-[_merchantIdLabel]-[_merchantIdTextField]-(groupSeparator)-[_amountLabel]-[_amountTextField]-(fieldSeparator)-[_countryCodeLabel]-[_countryCodeTextField]-(fieldSeparator)-[_currencyCodeLabel]-[_currencyCodeTextField]-(fieldSeparator)-[_isRecurringSwitch]-(fieldSeparator)-[_groupMethodsSwitch]-(fieldSeparator)-[_payButton]-|" options:0 metrics:metrics views:views]];
[self.containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[_explanation]-(fieldSeparator)-[_parsableFieldsContainer]-(fieldSeparator)-[_merchantIdLabel]-[_merchantIdTextField]-(groupSeparator)-[_amountLabel]-[_amountTextField]-(fieldSeparator)-[_countryCodeLabel]-[_countryCodeTextField]-(fieldSeparator)-[_currencyCodeLabel]-[_currencyCodeTextField]-(fieldSeparator)-[_isRecurringSwitch]-(fieldSeparator)-[_isInInstallmentsSwitch]-(fieldSeparator)-[_groupMethodsSwitch]-(fieldSeparator)-[_payButton]-|" options:0 metrics:metrics views:views]];

[self.view addConstraints:@[[NSLayoutConstraint constraintWithItem:superContainerView attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeading multiplier:1 constant:0], [NSLayoutConstraint constraintWithItem:superContainerView attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTrailing multiplier:1 constant:0]]];
[self.scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[superContainerView]|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:views]];
Expand Down Expand Up @@ -428,6 +439,10 @@ - (void)buyButtonTapped:(UIButton *)sender
#endif

BOOL isRecurring = self.isRecurringSwitch.on;

// Use this property to indicate whether the payment will be paid in instalments.
// This will be taken into account when determining the availability of credit cards when making an IIN details call.
BOOL isInInstallments = self.isInInstallmentsSwitch.on;

// ***************************************************************************
//
Expand All @@ -441,7 +456,7 @@ - (void)buyButtonTapped:(UIButton *)sender
//
// ***************************************************************************
WCPaymentAmountOfMoney *amountOfMoney = [[WCPaymentAmountOfMoney alloc] initWithTotalAmount:self.amountValue currencyCode:currencyCode];
self.context = [[WCPaymentContext alloc] initWithAmountOfMoney:amountOfMoney isRecurring:isRecurring countryCode:countryCode];
self.context = [[WCPaymentContext alloc] initWithAmountOfMoney:amountOfMoney isRecurring:isRecurring countryCode:countryCode isInstallments:isInInstallments];

[self.session paymentItemsForContext:self.context groupPaymentProducts:self.groupMethodsSwitch.isOn success:^(WCPaymentItems *paymentItems) {
[SVProgressHUD dismiss];
Expand Down
Binary file modified WorldlineConnectExample/en.lproj/WCAppLocalizable.strings
Binary file not shown.

0 comments on commit 0ffc4ba

Please sign in to comment.