paymill / paymill-ios Goto Github PK
View Code? Open in Web Editor NEWPAYMILL Mobile SDK for iOS and MacOS
License: Other
PAYMILL Mobile SDK for iOS and MacOS
License: Other
Because enum PMErrorType
is defined in a very oldschool way, it's not being correctly exposed to Swift and can't be used in a switch
statement.
The correct way to define PMErrorType
would be to use NS_ENUM
macro like this:
typedef NS_ENUM(NSInteger, PMErrorType)
{
UNKNOWN = 0, /*Initial value*/
WRONG_PARMETERS = 1, /*You have supplied wrong parameters. You use message for details.*/
HTTP_CONNECTION = 2, /*There was an error while connecting to the PayMill Service.*/
API = 3, /*The PAYMILL API returned an unexpected result.*/
SAFESTORE = 4, /*The PAYMILL safe store returned an error. Check the PMSafeStoreErrorCodeKey in the user info dictionary for the specific error. */
BRIDGE = 5, /*The PAYMILL JS-Bridge returned an a payment method related error code. Check the PMBridgeErrorCodeKey in the user info dictionary for the specific error. */
NOT_INIT = 6, /*You did not initialize the SDK.*/
INTERNAL = 7, /*This should never happen. If you encounter it, please send email [email protected] .*/
};
More info on NS_ENUM
macro and Swift/ObjC interoperability: https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithCAPIs.html
Hey,
I'm integrating PayMill payments in my app, so I downloaded 2.1.0 version, and I've added
PayMillSDK.framework to my project.
But now, when I'm trying to compile app for x86 architecture it returns an error:
ld: warning: ignoring file PayMill/PayMillSDK.framework/PayMillSDK,
missing required architecture i386 in file PayMillSDK.framework/PayMillSDK (1 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_PMFactory", referenced from:
objc-class-ref in MSPCreditCardPayment.o
"_OBJC_CLASS_$_PMManager", referenced from:
objc-class-ref in MSPCreditCardPayment.o
ld: symbol(s) not found for architecture i386
Are there some flags, that I have to set? Or additional files to import?
Cheers,
M.
Currently all possible credit card types are enabled with the default Setting. Instead, only the card types supported by PAYMILL should be enabled by default.
Running pod install
consecutive will result into the following error message
Errno::ENOENT - No such file or directory @ rb_file_s_stat - ../Pods/PayMillSDK/samples/vouchermill/PayMillSDK/PayMillSDK.framework/Resources
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/fileutils.rb:904:in `stat'
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/fileutils.rb:904:in `symbolic_modes_to_i'
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/fileutils.rb:951:in `fu_mode'
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/fileutils.rb:1025:in `block (2 levels) in chmod_R'
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/fileutils.rb:1477:in `preorder_traverse'
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/fileutils.rb:1023:in `block in chmod_R'
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/fileutils.rb:1022:in `each'
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/fileutils.rb:1022:in `chmod_R'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:117:in `block in prepare'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/lib/cocoapods/user_interface.rb:140:in `message'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:116:in `prepare'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:103:in `install!'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/lib/cocoapods/command/project.rb:156:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/lib/cocoapods/command.rb:48:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/bin/pod:44:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
If we look into PayMillSDK.framework we can see that there is a symbolic link from Resources to Versions/Current/Resources
PayMillSDK.framework git:(master) ls -la
total 24
drwxr-xr-x 6 ch staff 204 May 18 15:54 .
drwxr-xr-x 3 ch staff 102 May 18 15:54 ..
lrwxr-xr-x 1 ch staff 24 May 18 15:54 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 ch staff 27 May 18 15:54 PayMillSDK -> Versions/Current/PayMillSDK
lrwxr-xr-x 1 ch staff 26 May 18 15:54 Resources -> Versions/Current/Resources
drwxr-xr-x 4 ch staff 136 May 18 15:54 Versions
Further down the rabbit hole we can see that Versions/Current/Resources can't be found because Version/Current only contains Headers and the PayMillSDK
PayMillSDK.framework git:(master) ls -la Versions/Current/
total 8464
drwxr-xr-x 4 ch staff 136 May 18 15:54 .
drwxr-xr-x 4 ch staff 136 May 18 15:54 ..
drwxr-xr-x 13 ch staff 442 May 18 15:54 Headers
-rw-r--r-- 1 ch staff 4330856 May 18 15:54 PayMillSDK
When preauthorization attempt is made in the VoucherMill application, application crashes with attached stack. Application is tested with test public key on the iOS 8.3 simulator with Xcode 6.3.
Edit: Issue is present on iOS 8.1 too, but preauthorization works as intended on the iOS 7.1 simulator.
Recreate issue:
2015-06-08 18:07:59.406 VoucherMill[1335:68242] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<PMPreauthorization 0x7fd6536dbcd0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key description.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001121cbc65 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000111e64bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001121cb8a9 -[NSException raise] + 9
3 Foundation 0x00000001117b8b53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 VoucherMill 0x000000010fee8e34 +[PMAttributeSetter assingValue:forAttributeName:andAttributeClass:onObject:] + 420
5 VoucherMill 0x000000010feee230 -[PMKeyValueObjectMapping parseValue:forObject:inAttribute:] + 352
6 VoucherMill 0x000000010feed731 -[PMKeyValueObjectMapping setValuesOnObject:withDictionary:] + 881
7 VoucherMill 0x000000010feed377 -[PMKeyValueObjectMapping parseDictionary:] + 247
8 VoucherMill 0x000000010feebb03 -[PMGenericConverter transformValue:forDynamicAttribute:] + 499
9 VoucherMill 0x000000010feee1a6 -[PMKeyValueObjectMapping parseValue:forObject:inAttribute:] + 214
10 VoucherMill 0x000000010feed731 -[PMKeyValueObjectMapping setValuesOnObject:withDictionary:] + 881
11 VoucherMill 0x000000010feed377 -[PMKeyValueObjectMapping parseDictionary:] + 247
12 VoucherMill 0x000000010feebb03 -[PMGenericConverter transformValue:forDynamicAttribute:] + 499
13 VoucherMill 0x000000010feee1a6 -[PMKeyValueObjectMapping parseValue:forObject:inAttribute:] + 214
14 VoucherMill 0x000000010feed731 -[PMKeyValueObjectMapping setValuesOnObject:withDictionary:] + 881
15 VoucherMill 0x000000010feed377 -[PMKeyValueObjectMapping parseDictionary:] + 247
16 VoucherMill 0x000000010fee7ac5 +[PMJSONParser parseJSONResponse:onClass:error:] + 2565
17 VoucherMill 0x000000010fee4ab0 -[PMGenericResponseDelegate parseResponse:forClass:error:] + 112
18 VoucherMill 0x000000010fee69e7 -[PMTransactionResponseDelegate parseResponse:forClass:error:] + 167
19 VoucherMill 0x000000010fee5232 -[PMGenericResponseDelegate connectionDidFinishLoading:] + 1154
20 CFNetwork 0x0000000112e380bc __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 69
21 CFNetwork 0x0000000112e38060 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 199
22 CFNetwork 0x0000000112e381c7 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 48
23 CFNetwork 0x0000000112d07757 ___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 107
24 CFNetwork 0x0000000112dd4de1 ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 273
25 CFNetwork 0x0000000112cf2a26 _ZN19RunloopBlockContext13_invoke_blockEPKvPv + 72
26 CoreFoundation 0x00000001120d2354 CFArrayApplyFunction + 68
27 CFNetwork 0x0000000112cf28e7 _ZN19RunloopBlockContext7performEv + 133
28 CFNetwork 0x0000000112cf2726 _ZN17MultiplexerSource7performEv + 256
29 CFNetwork 0x0000000112cf253c _ZN17MultiplexerSource8_performEPv + 72
30 CoreFoundation 0x00000001120ff431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
31 CoreFoundation 0x00000001120f52fd __CFRunLoopDoSources0 + 269
32 CoreFoundation 0x00000001120f4934 __CFRunLoopRun + 868
33 CoreFoundation 0x00000001120f4366 CFRunLoopRunSpecific + 470
34 GraphicsServices 0x0000000114376a3e GSEventRunModal + 161
35 UIKit 0x00000001104b0900 UIApplicationMain + 1282
36 VoucherMill 0x000000010fea0b7f main + 111
37 libdyld.dylib 0x0000000113506145 start + 1
38 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
When I try to archive a project with bitcode enabled that is using Paymill SDK, installed form Cocoapods, I get the following error
ld: bitcode bundle could not be generated because '/Users/zellbakalli/Desktop/iOS Projects/Transinoo/Pods/PayMillSDK/samples/vouchermill/PayMillSDK/PayMillSDK.framework/PayMillSDK(PMDirectDebit.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hello,
I have installed the PaymillSDK with
pod 'PayMillSDK', :git=>'https://github.com/paymill/paymill-ios.git', :branch=>'master'
And for some reason, when trying to archive the PaymillSDK generates this:
Showing All Issues
ld: warning: ignoring file ~/project/Pods/PayMillSDK/samples/vouchermill/PayMillSDK/PayMillSDK.framework/PayMillSDK, file was built for archive which is not the architecture being linked (arm64): ~/project/Pods/PayMillSDK/samples/vouchermill/PayMillSDK/PayMillSDK.framework/PayMillSDK
Resulting in this:
Showing All Issues
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Since you break the compatibility with v1.1.0, please use v2.0.0 according to semantic versioning
Do you have plans to release it in a short term?
Thanks in advance!
Hello Paymill,
I've been trying to get the simple example to work in my project and it keeps throwing errors. I've copied the Payment Screens folder into the project, made sure it's in the Compile Sources, installed the SDK with Cocoapods and i still get these errors for PMSettings not being recognized.
Any help would be appreciated.
Hi,
We are trying to build a dynamic framework using swift, which uses paymill as payment gateway.
We tried to integrate paymill ios sdk into our project using cocoapods, everything went fine.
But when I tried to import
in the umbrella header file, the compiler is complaining about
"Include of non-modular header inside framework module 'FOO' "
How do I fix that ?
Please help.
PMErrorType is currently not documented.
Hello,
I tried to use regular method of adding the library to the project but got this:
[!] Unable to satisfy the following requirements:
PayMillSDK (~> 2.2.0)
required by Podfile
If I try to use the suggested way:
pod 'PayMillSDK', :git=>'https://github.com/paymill/paymill-ios.git', :branch=>'master', :tag=>'2.2.0'
The library does not get installed correctly. What is being installed in version 2.1.1 and the folder contains 2 files, Licence.md and README.md
I see this in install logs:
Cocoapods version 0.34.4
Installing PayMillSDK 2.1.1 (was 2.0.3)
Hi there,
When will your code and design be updated to iOS 10 ???
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.