Coder Social home page Coder Social logo

Comments (5)

SalilLuley avatar SalilLuley commented on June 25, 2024 1

Initialising cardViewController as lazy var did the trick. Thank you for the help.

from frames-ios.

daven-gomes-cko avatar daven-gomes-cko commented on June 25, 2024

I've just tried to run the code and it appears to work as expected, calling the delegate method as expected after entering some test card details and tapping the Pay button. Do you mean this isn't working for you when you run the sample code? Or it isn't working in your project?

If you could please post some sample code it might help see where the issue is.

from frames-ios.

dhavalgajjar-greenapex avatar dhavalgajjar-greenapex commented on June 25, 2024

I am facing the same issue.
I just copy and pasted in my project by referring GitHub home page's document.
Using pod 'Frames', '~> 3.0'.
Delegate is nil even after assigning view controller and not getting a call back.

Step 1:
private let checkoutAPIClient = CheckoutAPIClient(publicKey: "public_key",
environment: .sandbox)

Step 2 :
private var cardViewController: CardViewController {
let checkoutAPIClient = CheckoutAPIClient(publicKey: "publc_key",
environment: .sandbox)
return CardViewController(checkoutApiClient: checkoutAPIClient, cardHolderNameState: .hidden, billingDetailsState: .hidden)
}

Step 3:
ViewdidLoad :

cardViewController.delegate = self
cardViewController.rightBarButtonItem = UIBarButtonItem(title: "Pay", style: .done, target: nil, action: nil)
cardViewController.availableSchemes = [.visa, .mastercard , .americanExpress , .discover , .unionPay, .maestro]

Step 4 :
self.navigationController?.pushViewController(cardViewController, animated: true)

Step 5: Handling delegate methods

extension Viewcontroller : CardViewControllerDelegate {
func onSubmit(controller: CardViewController) {
print("Submited")
}

func onTapDone(controller: CardViewController, cardToken: CkoCardTokenResponse?, status: CheckoutTokenStatus) {
print("onTapDone")
}
}

from frames-ios.

daven-gomes-cko avatar daven-gomes-cko commented on June 25, 2024

@dhavalgajjar-greenapex Could you try change your cardViewController to lazy var? From your code, it appears every time you call cardViewController, you are creating a new instance rather than retaining one.

from frames-ios.

daven-gomes-cko avatar daven-gomes-cko commented on June 25, 2024

Closing this issue for now, if you still experience this problem or the above solution does not work, feel free to re-open it.

from frames-ios.

Related Issues (20)

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.