Coder Social home page Coder Social logo

checkout / frames-ios Goto Github PK

View Code? Open in Web Editor NEW
74.0 13.0 41.0 30.14 MB

Frames iOS: making native card payments simple

Home Page: https://www.checkout.com/docs/integrate/sdks/ios-sdk

License: MIT License

Ruby 0.23% Swift 90.24% Objective-C 0.05% SCSS 1.40% JavaScript 7.22% Mustache 0.85%
payment credit-card validation checkout swift ios card-payment fintech mobile-payments tokenisation

frames-ios's Introduction

Checkout.com

Frames iOS

CocoaPods Compatible GitHub release (latest by date) Platform license

Requirements

  • iOS 12.0+
  • Xcode 12.4+
  • Swift 5.3+

 

Documentation

Frames for iOS tokenises consumer data for use within Checkout.com's payment infrastructure. We abstract away the complexity of taking payments, building payment UIs, and handling sensitive data.

More integration information can be found in the Checkout Docs.

You can find the Frames API reference on our Jazzy docs.

Demo projects

Our sample application showcases our prebuilt UIs and how our SDK works. You can run this locally once you clone the repository (whether directly via git or with suggested integration methods).

Our demo apps also test the supported integration methods (SPM, Cocoapods), so if you're having any problems there, they should offer a working example. You will find them in the root of the repository, inside respective folders:

  • iOS Example Frame (Using Cocoapods distribution)
  • iOS Example Frame SPM (SPM distribution)

Once running, you will find the home screen with a number of design options. We have tried to make contrasting payment UIs to give you an idea of what can be achieved. We've also tried to write the code in the simplest way to track and understand how each UI flavour was created. Just start from HomeViewController.swift and follow the button actions in code (@IBAction) for some examples on how we achieve those UIs.  

Changelog

Find our CHANGELOG.md here.

Contributing

Find our guide to start contributing here.

Licence

Frames iOS is released under the MIT licence. See LICENSE for details.

frames-ios's People

Contributors

aashna-narula-cko avatar aleh avatar bartlomiejswierad-vodeno avatar chrisi-webster-cko avatar christianvershkov avatar cko-developer-portal[bot] avatar daven-gomes-cko avatar deepesh-vasthimal-cko avatar ehab-al-cko avatar harry-brown-cko avatar melting-snowman avatar miles-williams-cko avatar moelnaggar14 avatar nicolas-maalouf-cko avatar okhan-okbay-cko avatar patrick-hoban-cko avatar precious-ossai-cko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frames-ios's Issues

Does headless mode have been removed in 4.0 ?

We were using the headless mode in the version 3.0, especially the CardUtil class.
In the readme of the version 4, there is no mention of headless mode anymore, has it been removed ?

Allow customising chevron colour

Is your feature request related to a problem? Please describe.
Currently, there is no way of customizing the chevron colour, so it's difficult to get a dark mode looking right.

Describe the solution you'd like
A separate property added to CheckoutTheme for altering the chevron tint color.

Describe alternatives you've considered
Trying to access the underlying UIButton and changing the tint colour of the image view.

Additional context
The disclosure indicator chevron next to "Billing Details*" is black and cannot be customised:

Simulator Screen Shot - iPhone 11 - 2021-02-18 at 16 04 55

Error decoding

GETTING THIS ERROR WHEN CALLING createCardToken METHOD IN TEST ENVIRONMENT:
dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "No value." UserInfo={NSDebugDescription=No value.})))

CARD NUMBER: 4242-4242-4242-4242
Expiry: 12/23
CVV: 100

**NOTE: ** It is working fine in live environment with real debit card. It was working fine even in test environment when I was installing the SDK from Swift Package Manager, but since I added the SDK using POD I'm getting this decoding error.

pod 'Frames', '3'
xcode: 13.2.1
iOS version: 14.2

Expiry date textfield doesn't append '/' which lead to invalid date format error - Frames 4.0.4, Xcode 14.3

Describe the bug
Expiry date textfield doesn't append '/' while adding the month & year. So instead of MM/YY, the final input text looks like MMYY and there is no way for user to explicitly add '/'. Hence the validation error "Please enter a valid expiry date" can never be resolved.
This blocking behaviour is observed on simulator build with Xcode 14.3

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Add Card' form
  2. Click on 'Expiry date' textfield
  3. Start typing month & year of card expiry
  4. See error - 'Please enter a valid expiry date'

Expected behavior
A slash '/' should be auto appended between month (MM) and year (YY) like MM/YY instead of MMYY

Screenshots
Screenshot 2023-05-17 at 12 38 26

Additional context
Xcode Version - 14.3 (14E222b)
MacOS Version - Ventura 13.0.1
Chip - Apple M1 Pro

The issue is not reproducible on Sample app - iOS Example Frame SPM

Error in the Interface Builder

Describe the bug
Xcode shows errors in file DetailsInputView.swift after opening a storyboard file.
Errors:

  • line 48: 'UIButtonType' has been renamed to 'UIButton.ButtonType'
  • line 49: Cannot force unwrap value of non-optional type 'UILabel'

To Reproduce
Open a storyboard while the framework is imported.

Desktop (please complete the following information):

  • OS: macOS 11.1
  • Xcode 12.3
  • Version: 3.1.1

Frames Cocoapod integration is broken from 4.0.2

Describe the bug
Build with Frames 4.0.2/4.0.3 fail with error:

Multiple commands produce 'FramesCocoapodIssue.app/Assets.car'

To Reproduce
Steps to reproduce the behavior:

  1. Create new Xcode project from scrarch;
  2. Add Podfile with dependency on Frames:
platform :ios, '14.0'

target 'FramesCocoapodIssue' do
  pod 'Frames', '4.0.3'
end
  1. Run pod install
  2. Open workspace and build project

Expected behavior
Build should succeed.

Desktop (please complete the following information):

  • OS: macOS 13.0.1
  • Xcode: 14.2
  • Build for iOS Simulator with iOS 16.2

Additional context
Hi! I created a test project for reproduce this issue - https://github.com/rock88/FramesCocoapodIssue
If use Frames 4.0.1 all works as expected.

Issue appear in this PR: #359
I think preferred use Resources Bundle instead of just copy resources to application bundle. For include only Assets and Localizations you can use:

s.resource_bundles = {
  'Frames' => ['Source/Resources/**/*.{xcassets,strings}']
}

For access to this resources from Frames sources (Both SPM and Cocoapod):

#if COCOAPODS
extension Bundle {
    static let module = Bundle.main.path(forResource: "Frames", ofType: "bundle").flatMap { Bundle(path: $0) } ??
      Bundle(for: BundleToken.self).path(forResource: "Frames", ofType: "bundle").flatMap(Bundle.init) ??
      Bundle(for: BundleToken.self)
}

private final class BundleToken { }
#endif

// part of https://github.com/checkout/frames-ios/blob/main/Source/Extensions/StringExtensions.swift
extension String {
    func localized(comment: String = "") -> String {
        NSLocalizedString(self, bundle: .module, comment: comment)
    }

    func image() -> UIImage {
        UIImage(named: self, in: .module, compatibleWith: nil) ?? UIImage()
    }
}

merchant certificate not found

we are facing merchant_certificate_not_found error in apple pay.

(lldb) po error
▿ TokenRequest
▿ serverError : ServerError
- requestID : "4a04180b--44cc--****e426bd9"
- errorType : "request_invalid"
▿ errorCodes : 1 element
- 0 : "merchant_certificate_not_found"
- code : 3000

(lldb) po error.localizedDescription
"The operation couldn’t be completed. (Checkout.TokenisationError.TokenRequest error 2.)"

PhoneNumberTextField definition conflict

Recently we have found a bug, which is blocking our integration of your iOS sdk

In our project we use third-party dependencies with Objc code. Because of this, Cocoapods generates Objc headers for swift files automatically.
After installing yours sdk, our project does not compile with this error:
'PhoneNumberTextField' has different definitions in different modules; first difference is definition in module 'PhoneNumberKit.Swift' found return type is 'void'

The investigation shows that PhoneNumberTextField is declared in your sdk and PhoneNumberKit, which installed through cocoapods. Similar problems in other pods:
onevcat/Kingfisher#1530
Adyen/adyen-ios#257
xmartlabs/Eureka#2109
and apple developer forum
https://developer.apple.com/forums/thread/658012?page=3

Possible solutions:

  • Do not generate headers for ObjC. SWIFT_INSTALL_OBJC_HEADER = NO
  • Set an explicit prefix for ObjC which will resolve namespacing
  • Add PhoneNumberKit as Cocoapods dependency in Frames.podspec

Because we still use objc third-party dependencies, we can’t solve this problem through SWIFT_INSTALL_OBJC_HEADER, neither the third option may take a while to fix

So we suggest to fix this problem through explicit prefix for ObjC like this

@objc(CKO)
open class PhoneNumberTextField: UITextField, UITextFieldDelegate {

We can’t reproduce this problem in sample project, because our project is not simple enough.
But we can be in touch and test this issue through custom branch via cocoapods

Back Button and Accepted Cards not showing on TestFlight Build

We are facing issue when we install application from TestFlight on card page we are not able to see Back button and accepted cards section whereas if we install same build via Diawi link we are able to see the back button & accepted cards section. Kindly help us understand what could be the issue
image (4)

Release 3.4.0 broken with Carthage

Describe the bug

As of the latest release we are unable to build the SDK with Carthage:

[16:55:37]: ▸ Dependency "frames-ios" has no shared framework schemes for any of the platforms: iOS
[16:55:37]: ▸ If you believe this to be an error, please file an issue with the maintainers at https://github.com/checkout/frames-ios/issues/new

It appears that the workspace has moved from the root directory, which means that Carthage is unable to find it.

To Reproduce
Steps to reproduce the behavior:

  1. Add frames-ios as a carthage dependency
  2. Attempt to build dependencies
  3. See error

Expected behavior
The project should build

How this sdk handle ThreeD secure 2?

Hi, I'm seeing that you are using Web view to deal with 3dsecure but what about threed secure 2 is same like threed secure1 in Web view? and if yes what about other dynamic authentication through biometrics and token-based authentication methods ?

ERROR ITMS-90081 when trying to upload build to Appstore Connect

I added Frames framework (v3.5.3) to my project using Carthage:
Cartfile:
github "checkout/frames-ios"
Carfile.resolved:

github "checkout/frames-ios" "3.5.3"
github "marmelroy/PhoneNumberKit" "3.3.5"

After that, my CI has started failing with an error message: "ERROR ITMS-90081: "This bundle is invalid. Applications built for more than one architecture require an iOS Deployment Target of 3.0 or later."

Do you have any idea why is that happening?

Network error when checkoutAPIClient.createCardToken(...) called and Internet connectivity available

Describe the bug
The Frames SDK is sometimes returning “The operation couldn’t be completed. (Frames.NetworkError error 0.)” when we know that there is Internet connectivity. This is for the checkoutAPIClient.createCardToken(card: cardTokenRequest) method. The error comes from error.localizedDescription when the result is a failure.

One customer reported the error occurred on two separate days over a period of about 15 minutes until he was successful. We don't have many details of their user experience and how he may have varied billing data in each attempt.

To Reproduce
We have not been able to reduce in our development apps. These are reports in live apps. We know that they have Internet access because other endpoints in our API are consistently successfully called immediately prior to this error.

Expected behavior
When the client has an Internet connection: return a successful response with a card token or a more detailed error descriptio.

Smartphone (please complete the following information):

  • Device: iPhone11
  • OS: 15.4.1.
  • Native App using Frames 3.5.3

Additional context
We were told by [email protected] to submit this issue ticket. We cannot log billing details used in the cardTokenRequest event systems for compliancy reasons. We need a list of what circumstances this error can be returned.

html error response

Describe the bug
Xcode 10.3
Using your test cards for dev environment
4242 4242 4242 4242 cvv: 100

Here is what I'm sending:
REST POST https://sandbox.checkout.com/api2/v2/payments {'content-type': 'application/json', 'Authorization': 'sk_test_2e41ac0e-fa36-47e6-bbb8-f9c903d2d5c5'} {'source': {'type': 'token', 'token': 'card_tok_735752A2-41C8-41F3-836A-5D59BA562B77'}, 'amount': '1300', 'currency': 'USD', 'payment_type': 'Regular', 'reference': 'A12807|30619', 'capture': True, 'metadata': {'udf2': '9b92d120695a77345aabb8d5b92b9266'}, 'failure_url': 'https://tr3.admiralmarkets.com/transactions/deposit/error/checkout?order_id=A12807|30619', 'success_url': 'https://tr3.admiralmarkets.com/transactions/deposit/success/checkout?order_id=A12807|30619', 'customer': {'email': '[email protected]'}, '3ds': {'enabled': True}} [PENDING].

And getting huge amount of html code instead (

Expected behavior
At least I would like to get an error message

Smartphone (please complete the following information):

  • Device: any
  • OS: 12.4

CkoPhoneNumber coding key query

Hi.

Just wanted to query something I've noticed in the API contracts for registering a card in the payment flows (POST https://api.checkout.com/tokens).

The CkoAddress type (and other associated types, like CkoCardTokenRequest) is encoded using snake case keys (https://github.com/checkout/frames-ios/blob/master/Source/CkoAddress.swift), as can be seen in the Encodable implementation. addressLine1 becomes address_line1 for example.

However CkoPhoneNumber is not encoded with any custom CodingKeys (https://github.com/checkout/frames-ios/blob/master/Source/CkoPhoneNumber.swift) and will therefore take the standard swift case convention e.g. countryCode remains as countryCode.

Is this a known quirk on the API? Or maybe a bug in this SDK?

Swift 5 conversion error.

I am using latest Xcode version 10.2.1 (10E1001) with my project in Swift 5. While i compile project framework gives compile time error and i can see Swift 5 conversion is available. But when i convert it it gives error.

To Reproduce

  1. Create a project with Xcode 10.2.1 (10E1001).
  2. Add Frames by pods.
  3. Compile project and it will as you for Swift 5 conversion with an error.
  4. Perform conversion, You can see actual problem now.

Desktop :

  • Xcode: 10.2.1 (10E1001)
  • Swift Version 5.

3ds redirection not working

Describe the bug
I am not getting the callbacks in ThreedsWebViewControllerDelegate. All I can see is a white screen and security errors.

To Reproduce
Steps to reproduce the behavior:

  1. create a redirect URL
  2. open the sample ios application
  3. paste the redirect URL in the 3ds field.
  4. tap on the button to navigate to OTP screen.
  5. enter OTP "Checkout1!"
  6. tap on submit button

Expected behavior
should be redirected to the success screen with a callback on ThreedsWebViewControllerDelegate

Screenshots
Screenshot 2023-02-21 at 9 40 27 AM

Desktop (please complete the following information):

  • OS: Ventura
  • Xcode: 14.1

Smartphone (please complete the following information):

  • Device: iPhone 11
  • OS: iOS 16

Additional context
used sample success url: https://httpstat.us/200, https://example.com/success, tried a postman url: https://60f26c46-7b7e-499f-8768-490a31398ba3.mock.pstmn.io/success. Nothing seems to be working.

console log:
frames.txt

Swift Package Manager support

Is your feature request related to a problem? Please describe.

It looks like some initial support for Swift Package Manager was added with a Package.swift, but this hasn't been updated in 3 years. Actually trying to import frames-ios as a SPM dependency results in many errors, and also appears to import Alamofire that doesn't appear to be being used anymore:

Screenshot 2021-01-15 at 15 18 32

Describe the solution you'd like
SPM is arguably the primary mechanism of managing third party dependencies nowadays, as its built directly into Xcode. It would be good to tidy up Package.swift and declare this as a supported installation method.

Delegate method of view controllers not called

Just copy pasted the kick start frames code in iOS GitHub repo. In that I found a bug that cardViewController.delegate = self does not set the delegate, its still nil and because of that delegate methods of my vc are not called from CardViewController.

Localizable strings of the pod conflict with that of the main app when the pod is not used as a dynamic framework

Describe the bug

When the Frames pod is not used as a dynamic framework (that is when use_frameworks! is absent in the app's Podfile or static frameworks are requested viause_frameworks! :linkage => :static), then its resources are not wrapped into a bundle and can override the corresponding resources of the app. Some names are generic enough (checkmark.png) but the clash is particularly easy to run into with Localizable.strings which is the usual name of the strings file in the app. (Actual case in our app.)

To Reproduce

  1. Install pods for "iOS Example Frame" example (commit 71b39a9, cocoapods 1.11.2 let say) and open its workspace in Xcode (I used 12.5, but should not matter.) Set up provisioning, so it can run on the device, don't do any other configuration.
  2. Add Localizable.strings into the project, click "Localize..." button, and make it available for at least English.
  3. Add a single line there: "Payment" = "Payment EN";
  4. Find showAlert method in MainViewController.swift and replace the reference to "Payment" string there with NSLocalizedString("Payment", comment: "").
  5. Run the app and trigger this alert, for example, by tapping "Start 3DS" button.
  6. Observe the title of the alert translated, i.e. being "Payment EN" now.
  7. Open the app bundle (e.g. Project navigator > Products > iOS Example Frame.app > Show in Finder, then Show Package Contents on it) and observe that en.lproj/Localizable.strings contain the binary representation of the .strings file we've just added and there is no Localizable.strings in the root of the bundle.
  8. Now open the Podfile and comment out use_frameworks!, so the pod is used as a static library and resources are copied as is into the app's bundle.
  9. Install pods and run the app again.
  10. Trigger the alert again.
  11. Observe that the title is now simply "Payment", i.e. the translation did not work now.
  12. Open the app bundle again and observe that both Localizable.strings and en.lproj/Localizable.strings contain the strings of the pod, not the strings of the app, i.e. that the app's resource has been completely overridden.

Note that this also happens when the pod is used as a static framework, e.g. by specifying use_frameworks! :linkage => :static in the Podfile in step 8.

Expected behavior

It is expected that the resources of the pod never conflict with the resources in the main app. For example, they can be kept in a resource bundle created manually or via resource_bundles directive of .podspec.

Wrong snippet in usage section

var cardViewController: CardViewController

is computed, so assign delegate, bar button, and push use different instances of CardViewController.
Consider to change it into lazy

Expiry date textfield doesn't append '/' which lead to invalid date format error - Frames 4.0.4, Xcode 14.3

Describe the bug
Expiry date textfield doesn't append '/' while adding the month & year. So instead of MM/YY, the final input text looks like MMYY and there is no way for user to explicitly add '/'. Hence the validation error "Please enter a valid expiry date" can never be resolved.
This blocking behaviour is observed on simulator build with Xcode 14.3

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Add Card' form
  2. Click on 'Expiry date' textfield
  3. Start typing month & year of card expiry
  4. See error - 'Please enter a valid expiry date'

Expected behavior
A slash '/' should be auto appended between month (MM) and year (YY) like MM/YY instead of MMYY

Screenshots
Screenshot 2023-05-17 at 12 38 26

Additional context
Xcode Version - 14.3 (14E222b)
MacOS Version - Ventura 13.0.1
Chip - Apple M1 Pro

The issue is not reproducible on Sample app - iOS Example Frame SPM

Support for app extension

Problem
Currently, we are working to pay using Rich notification, for that, we need Frames SDK in the extension, but we are getting 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.

FileName = UIResponderExtensions.swift

Solution
The solution is to add a condition for App Extension like SVProgressHUD/SVProgressHUD#390
CocoaPods/CocoaPods#5373 (comment)

CheckoutAPIClient never throws an error if an unexpected error occurs

Describe the bug
If you are using CheckoutAPIClient for both methods

  • createCardToken(card:_, successHandler:_, errorHandler:_) - Line 98, Line 105
  • createApplePayToken(paymentData:_, successHandler: _, errorHandler:_) - Line 134, Line 142
    will never throw an unexpected error if occurs.

To Reproduce
Steps to reproduce the behaviour:

  1. Have invalid expired credentials to the sandbox
  2. Create CheckoutAPIClient
  3. Request createCardToken or createApplePayToken
  4. Expectations are not handled

Expected behaviour
In both cases Frames should throw an error which will allow to handle it on the application side.

Cannot input the + symbol in the phone number field when inputting billing details

Describe the bug
When using the billingDetailsPhone state as required, I cannot input the + symbol in the phone number field.

To Reproduce
Steps to reproduce the behavior:

  1. Initialise the view with cardHolderNameState: .required, billingDetailsState: .required
  2. Enter all required details
  3. Go to billing details view
  4. Enter all required fields, and try to enter phone number as +442312312321
  5. Observe the + doesn't get populated and an error shows

Expected behavior
In #5 from the above, it will allow entering + symbol

Screenshots
IMG_A82953FC59A7-1

Smartphone (please complete the following information):

  • Device: iPhone 7
  • OS: iOS 13.3

Users can submit the Pay button twice before 3DS view pops up

Describe the bug
In our usage once submitted and waiting for the 3DS screen to pop up, there is a few seconds (especially on slower phones) and users can resubmit the Pay button.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the payment details page and enter your card details
  2. Click on the Pay button
  3. Button shows a loading animation
  4. Right before the 3DS screen pops up, the Pay button is tappable again and can cause double payments if submitted

Expected behavior
In Android SDK we have an onSubmit event that we use to show a progress indicator while the payment is in progress. It will block user interactions. In iOS there is no such event.

3ds implementation for custom UI Flow

Hi,

I am trying to integrate the iOS sdk with the custom UI as shown in the iOS Example Custom. I am looking to add the 3Ds implementation but could not find any documentation to implement it for iOS.

We have successfully implemented for the android-sdk as it's clearly documented in the git repo.
/////////////// Android Snippet ////////////////

private final PaymentForm.On3DSFinished m3DSecureListener = new PaymentForm.On3DSFinished() {
    @Override
    public void onSuccess(String token) {
        displayMessage("Result", "Authentication success: " + token);
    }

    @Override
    public void onError(String errorMessage) {
        displayMessage("Result", "Authentication failure: " + errorMessage);
    }
};

/////////////// End //////////////////////
Note : Looking for something similar for iOS.
Kindly let me know if there is any way to add the 3Ds for the iOS.
I have found the ThreedsWebViewController but on the callback methods we are not able to receive any sid_token as it is received in the android-sdk version as mentioned above in snippet.

It would be really helpful if i could get e sample to integrate.
Kindly advise me to proceed further.

"CardView" nib but the view outlet was not set

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "CardView" nib but the view outlet was not set.'

App is getting crash.

Issues with iOS Example Custom

Describe the bug
I cloned the repository for iOS Example Custom and run pod install.
After opening the workspace with XCode, I changed the public key and started the project on the iPhone SE Emulator, I enter the test card '4242 4242 4242 4242' with '10/26' as exp date and '100' as CVV, and I tap the button, this error apear:
Frames.NetworkError.objectDeallocatedUnexpectedly.

Expected behavior
I receive a card token.

Smartphone (please complete the following information):

  • Device: iPhone SE Emulator
  • OS: iOS 14
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

M1 support

Describe the bug
When build project with M1 architecture we receive this error:
Could not find module 'Frames' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator, at: /Users/…./Library/Developer/Xcode/DerivedData/X/Build/Products/X-iphonesimulator/Frames.swiftmodule

To Reproduce
Steps to reproduce the behavior:

  1. Build a project that use Frames SDK via SPM with m1 architecture
  2. try to run on simulator

Expected behavior
Build success

Question
Did you make the try with m1 archi ?

Can't obtain 3D Secure success/failure url

In short: we have a web and mobile application, both using Checkout Hub with data, 3DS works fine for web.
I'm trying to use ThreedsWebViewController to implement 3D Secure feature on iOS, but its webView redirects to random url.

  1. Create token with

CheckoutAPIClient(publicKey: publicKey, environment: .sandbox)

  1. Send token to back-end, back-end responds with url
  2. Create and show

ThreedsWebViewController(successUrl: "HTTPS://ourapp.com/PaymentSuccess", failUrl: "HTTPS://ourapp.com/PaymentFailure")

  1. Enter code into opened webView window and tap "Continue"
  2. Looking for redirect url in

func webView(_ webView: WKWebView,
didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!)
print(webView.url!)

Expected value: HTTPS://ourapp.com/PaymentSuccess
Actual value: https://3ds2-sandbox.ckotech.co/interceptor/3ds_dl5v2ubsgv4udi2m53i6ze6ki4/device-information

Review possibility to use simpler APIs

Is your feature request related to a problem? Please describe.
Remove the need for Bundle to be provided when using Swift Packages

Describe the solution you'd like
Use @available to provide an implementation that doesn't require a class to be provided and remove syntax sugar.

Example
Have something similar to

    @available(_PackageDescription, introduced: 1)
    func localized(comment: String = "") -> String {
        ""
    }

Use this method for any package based use, removing sugar code and having simpler syntax at call site.

"key".localized(forClass: CheckoutTheme.self)
// Should become
"key".localized()

 

 

Did not scope enough the feasibility, but may look at injecting the Bundle on the remaining classes, instead of injecting a class type. Then we can have the bundle referenced as a single instance across the module and make code easier to navigate

"key".localized(forClass: SomeClassFromModule.self)

// Should become

// declared internal at module level. This way there is only 1 source of truth for the bundle
let MODULE_BUNDLE = Bundle(for: SomeClassFromModule.self) 

// Use site
"key".localized(bundle: MODULE_BUNDLE)

Apps submitted with 3.1.0 are rejected from the AppStore

Describe the bug
It appears that in 3.1.0 there is a new shell script included as part of the copy phase - update.sh (https://github.com/checkout/frames-ios/blob/master/Source/PhoneNumberKit/Resources/update.sh). It looks like this was pulled in when upgrading PhoneNumberKit. When validating our app, we are receiving the following error:

Invalid Signature. Code object is not signed at all. The file at path [OurApp.app/Frameworks/FramesIos.framework/update.sh] is not properly signed. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target. For more information, please consult https://developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html (1091)

Doing some digging on StackOverflow, it seems that .sh files must be signed (or removed, if they're unnecessary): https://stackoverflow.com/questions/29788601/error-itms-90035-xcode.

Reverting back to 3.0.5 removes this error.

To Reproduce
Steps to reproduce the behavior:

  1. Build an app with FramesIos.framework included
  2. Submit for review, or validate (I'm using altool here)
  3. See error

Expected behavior
The app should pass AppStore validation.

Smartphone (please complete the following information):

  • Device: iPhone 11 Pro
  • OS: iOS 14
  • Version [e.g. 22]

Errors when using 3.4.1

Describe the bug

Hi,

We use frames-ios using Carthage, and last night I merged the upgrade to 3.4.1 for our CI system to pick up. This had required us to change references to Frames from FramesIos in source, and I had linked the new dependencies registered in the Cartfile in the host application (as we do with other Carthage dependencies).

Everything worked as expected till our nightly AppStore Validate job ran, and we received the following from Apple:

[00:53:06]: CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'com.roymarmelstein.PhoneNumberKit' under the iOS application 'OurApp.app'. (1091)
[00:53:06]: CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'org.alamofire.Alamofire' under the iOS application 'OurApp.app'. (1091)
[00:53:06]: Invalid Bundle. The bundle at 'OurApp.app/Frameworks/Frames.framework' contains disallowed nested bundles. (1091)
[00:53:06]: Invalid Bundle. The bundle at 'OurApp.app/Frameworks/Frames.framework' contains disallowed file 'Frameworks'. (1091)

So I'm guessing both of these dependencies are actually embedded in Frames, rather than simply being linked. I attempted to unlink these from the main binary, but now we're seeing issues running tests:

Could not find module 'Alamofire' for target 'x86_64-apple-ios-simulator'; found: arm64, armv7-apple-ios, arm64-apple-ios, arm, armv7

Repeat for every source file in that target.

My first thought would be to only link Alamofire and NumberKit in Frames rather than embedding them - leaving the host application to supply the frameworks, as this is standard practice.

To Reproduce
Steps to reproduce the behavior:

  1. Link Frames
  2. Follow steps described above
  3. Receive either an error from Apple or an error trying to test.

Expected behavior
The framework should work as expected

Billing addressLines missing in CkoCardTokenResponse

Describe the bug
I've just gotten round to upgrading us from 3.3.0 to 3.4.2, and just caught a potential problem in that the token response no longer seems to contain the billing addressLines.

We're definitely setting these on the checkout controller in the same way as on 3.3.0 (the only source changes are FramesIos -> Frames in the codebase), and switching back to 3.3.0 works as expected.

To Reproduce
Steps to reproduce the behavior:

  1. Set a billing address with addressViewController.setFields(address:phone) (verify addressLine1 / 2 are set)
  2. Go through checkout journey
  3. Receive callback to func onTapDone(controller: CardViewController, cardToken: CkoCardTokenResponse?, status: CheckoutTokenStatus)
  4. Inspect cardToken and see addressLines are nil.

Expected behavior
Address lines should be present

Apple Pay Error "20030", "Format error"

"Format error" event not using capabilityEMV
when I try to pay using apple its shows the error "Format error".

SDK version
Frames (3.3.0)

Screenshots
Screenshot 2022-05-23 at 11 42 39 AM

Code
`hi
func btnApplePayTapped(_ currency : String = "SAR",_ countryCode : String = "SR",money : Double,subtotal : Double? = nil,deliveryCharge : Double? = nil,VC : UIViewController, completion : ((String,Data)->())?){

    let paymentNetwork = [PKPaymentNetwork.amex , .discover, .visa, .masterCard, .mada]
    
    if PKPaymentAuthorizationViewController.canMakePayments(usingNetworks: paymentNetwork){
        self.paymentRequest.currencyCode            = currency.uppercased()
        self.paymentRequest.countryCode             = countryCode.uppercased()
        self.paymentRequest.merchantIdentifier      = "merchant.checkoutProductionNew.test"
        self.paymentRequest.supportedNetworks       = paymentNetwork
        self.paymentRequest.merchantCapabilities    = [.capability3DS]
        self.paymentRequest.requiredShippingContactFields = [.emailAddress,.name,.phoneNumber,.postalAddress]
        self.paymentRequest.paymentSummaryItems = []
        //add subtotal
        if let subtotal = subtotal{
            self.paymentRequest.paymentSummaryItems.append(PKPaymentSummaryItem(label: "subtotal", amount: NSDecimalNumber(floatLiteral: subtotal), type: .final))
        }
        //add delivery charge
        if let deliveryCharge = deliveryCharge{
            self.paymentRequest.paymentSummaryItems.append(PKPaymentSummaryItem(label: "delivery charge", amount: NSDecimalNumber(floatLiteral: deliveryCharge), type: .final))
        }
        //add final
        self.paymentRequest.paymentSummaryItems.append(PKPaymentSummaryItem(label: "Test Inc.", amount: NSDecimalNumber(floatLiteral: money), type: .final))
        
        
        if let applePayVC = PKPaymentAuthorizationViewController(paymentRequest: self.paymentRequest){
            applePayVC.delegate = self
            VC.present(applePayVC, animated: true, completion: nil)
        }else{
            GFunctions.shared.showSnackBar("Error to open pay page")
        }
        
        self.complitionDelegate = { (applePayTransectionID, tokenData) in
            completion?(applePayTransectionID,tokenData)
        }
        
    }else{
        PKPassLibrary().openPaymentSetup()
        GFunctions.shared.showSnackBar("Please set-up card for Apple Pay")
    }
}`

Module

[!] The [Target] target has transitive dependencies that include statically linked binaries: (/Pods/CheckoutEventLoggerKit/CheckoutEventLoggerKit.xcframework)

pod 'Frames', '3.5.2'
xcode 13.2.1
iOS minimum target v11.0

PhoneNumberKit dependency update

Greetings!

We need to update PhoneNumberKit.

In the current version 3.3.3, PhoneNumberKit uses the deprecated isoCountryCode method. The comment states that the method may return '--' instead of the region code, and unfortunately, we have started to encounter such cases. PhoneNumberKit fixed this issue in version 3.4.3.

However, the current version of Frames strictly specifies version 3.3.3 in podspec, which prevents us from updating.

The solution I propose is:

  • update the minor version of PhoneNumberKit
  • specify the dependency version in the podspec as '~> 3.4.3', witch will allow patch versions with bug fixes to be raised without any problems.

Xcode 12

Xcode 12: 'PhoneNumberKit' has different definitions in different modules; first difference is definition in module 'PhoneNumberKit.Swift' found method with no designater initializer

i am using PhoneNumberKit
[https://github.com/marmelroy/PhoneNumberKit]

ThreedsWebViewControllerDelegate not called

ThreedsWebViewControllerDelegate not called

Few weeks before it works. But now it doesn't.
Could you help me please to figure out the problem here?

class MainVC: UIViewController, ThreedsWebViewControllerDelegate {

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    
    let response = PayInvoiceResponse(
        approved: true,
        redirectLink: "auth url",
        successUrl: "success url",
        failureUrl: "fail url")
    showCheckout3dSecure(
        payResponse: response,
        webDelegate: self,
        successUrl: response.successUrl,
        failURL: response.failureUrl
    )
}

func threeDSWebViewControllerAuthenticationDidSucceed(
    _ threeDSWebViewController: ThreedsWebViewController,
    token: String?
) {
   print("success")
}

func threeDSWebViewControllerAuthenticationDidFail(_ threeDSWebViewController: ThreedsWebViewController) {
    print("fail")
}

}

extension UIViewController {

func showCheckout3dSecure(
    payResponse: PayInvoiceResponse,
    webDelegate: ThreedsWebViewControllerDelegate?,
    successUrl: String,
    failURL: String
) {
    guard payResponse.approved, let url = payResponse.url else {
        return
    }
    let threeDSWebViewController = ThreedsWebViewController(
        successUrl: URL(string: successUrl)!,
        failUrl: URL(string: failURL)!
    )
    threeDSWebViewController.authUrl = url
    threeDSWebViewController.delegate = webDelegate
    present(threeDSWebViewController, animated: true)
}

To Reproduce
Copy and paste code (please use your own urls)

Expected behavior
func threeDSWebViewControllerAuthenticationDidSucceed(:_) and func threeDSWebViewControllerAuthenticationDidFail(:_) can be called

Desktop (please complete the following information):

  • OS: Monterey
  • Xcode: 13.3.1

Smartphone (please complete the following information):

  • Device: iPhone 13 Pro Max
  • OS: 15.4.1

Problem with customisation.

Hello sir/mam,

I create my own text filed but the problem is I can't access icon and method. I share screenshot so you got better.

I want UI like this. You have 4 screen that I check in frames Demo but it is not possible to create like this.i create UI like this and I used payment methods for payment. everything working fine. but now issue is that I can't format textfield and I can't access payment type icon.

Simulator Screenshot - iPhone 15 Pro - 2023-12-18 at 01 10 59

according to my research

I try this code in my Viewcontroller but it can't access. it is not public protocol. From below method I got text and icon that I debug in sdk code.
Screenshot 2023-12-18 at 1 13 56 AM

Screenshot 2023-12-18 at 1 16 40 AM

I want this method public how can I do? can you do that for me..this is our client requirement so we create UI like this.

Please help me .
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.