Visa Developer Community

Regular Visitor

How to integrate Visa Checkout in Swift

Hello guys.

 

I have some problems with VCO SDK... I cant integrate with my project.... 

 

And We dont have any information about this... Just objC

 

Thank you guys

16 REPLIES 16
Regular Visitor

Re: How to integrate Visa Checkout in Swift

Hi, I'm joining to this request...

Helper

Re: How to integrate Visa Checkout in Swift

Hi 

 

What specfiic problems do you have?  I have a project writtien in Swfit which integrates with VCO if you are interested.  

Regular Visitor

Re: How to integrate Visa Checkout in Swift

hello woody,

I have integrated the sdk but and have implemented the VisaLibraryDelegate with all its methods, but when I create a VisaExpressCheckoutView through the application code starts me makes me the button but suddenly breaks, I get this error

This item is ALREADY SAVED, can not duplicate it
This item is ALREADY SAVED, can not duplicate it
This item is ALREADY SAVED, can not duplicate it
An error occurred with code: -25,300
An error occurred with code: -25,300
An error occurred with code: -25,300
An error occurred with code: -25,300
An error occurred with code: -25,300
An error occurred with code: -25,300
An error occurred with code: -25,300
Aug 11 16:01:58 testapp [336] <Warning>: Failed to enable location services
Aug 11 16:01:58 testapp [336] <Notice>: starting profile request using - With 3.2-99 options: 1fcfe
11/08/2016 16: 02: 39,986 testapp [336: 56388] - [_ NSInlineData _fastCharacterContents]: unrecognized selector sent to instance 0x146b8580
This item is ALREADY SAVED, can not duplicate it
08/11/2016 16: 02: 45.106 testapp [336: 56388] *** Terminating app due to uncaught exception 'NSInvalidArgumentException' reason '- [_ NSInlineData _fastCharacterContents]: unrecognized selector sent to instance 0x146b8580'
*** First throw call stack:
(0x25adf98b 0x2527ae17 0x25ae5325 0x25ae2f51 0x25a0e2f8 0x25a12b15 0x1a1ff5f 0x1a2b0ed 0x1a123d5 0x26309485 0x25811724 0x258137cf 0x2581385b)
libc ++ abi.dylib: With terminating uncaught exception of type NSException

when I try to use a VisaCheckoutButton gives me this error

This item is ALREADY SAVED, can not duplicate it.

and the same error when I try VisaCheckout (). invokeVisaCheckout

 

thanks for your help...

 

Helper

Re: How to integrate Visa Checkout in Swift

Hi...

It seems that the error is actually this line:  

 

 [_ NSInlineData _fastCharacterContents]: unrecognized selector sent to instance 0x146b8580  

 

This error is related to mixing type (NSData, NSURL, ...) with NSString.  Without looking at the sample code, I will not be able to pinpoint to the exact place.  

 

All other listings are warning messages from running the VisaCheckout.  I will have to find out on why they are appearing.  

 

Thanks.

Regular Visitor

Re: How to integrate Visa Checkout in Swift

Thanks woody yet this error only for putting this

VisaCheckout (). InvokeVisaCheckout ({errors in
                 if (error! = nil) {
                    print (errors)
                 }
                 }, WithOptions: nil, withDelegate: self)

you know something that many do not know from here and there is so little information on the Internet ... because you do not do a simple example project on swift to compare ... I would appreciate you all who visited this question and those who visit.

Regular Visitor

Re: How to integrate Visa Checkout in Swift

Hey Woody....

 

When i click on the VCO button, its loaded but doesn't open on view.... In the log shows that open, but the view doesn't show the sdk

 

Captura de Tela 2016-08-11 às 23.59.10.png 

 

 

VCO opens in the background...

 IMG_7104.jpg

Helper

Re: How to integrate Visa Checkout in Swift

Hi guys, 

 

Below is a code snippet of a Swift project which I wrote to test out VCO.  See whether you can reference it.  I am able to run without error.

 

Please note that you will have to enter your merchant APIKey in the line: (under ViewController.swift)

// ADD MERCHANT API HERE AND REMOVE #

        #merchantInfo.merchantAPIKey = "<Use Merchant API>"

and remove "#".

 

If you need the entire project, I can zip it up but will have to send to you privately as it's about 9M.

 

 

Thanks.

Regular Visitor

Re: How to integrate Visa Checkout in Swift

Hey Woody,

 

I did it the same integration.... It's works when VCO is called in the first ViewController... When the VCO is called in the second ViewController, for example, it's didn't work ... like my last message....

Helper

Re: How to integrate Visa Checkout in Swift

Hi Guisa, 

 

If you don't mind sharing your code snippet, I can try to run it and find out the reason.

 

Thanks.