iZettle / sdk-ios

Add card payments from Zettle to your own app
https://developer.zettle.com/docs/ios-sdk
Other
83 stars 38 forks source link

payment via Card reader chip & card reader swipe not fetching information from izettle SDK #39

Closed babs20013 closed 8 years ago

babs20013 commented 8 years ago

I am integrating izettle SDK in one of POS Apps which and the payment gateway integration is the most important part of the iOS Application. I was able to use the SDK well enough to fetch from izettle SDK & store in our remote server database while making manual payment entry via card which i have tested using demo account of iZettle.

I have considered all variables we are getting from izettle sdk while payment Card reader chip payment/manual entry & card reader swipe payments.

I am successfully fetching the information and saving in our database the values by using the method :

presentFromViewController:(UIViewController *)viewController

      completion:(iZettleSDKOperationCompletion)completion;

and using the @property from izettle sdk well and its working for manual payment which I have tested using demo account.

(property provided by izettle sdk in iZettleSDKPaymentInfo provide by izettle sdk)

But, the only issue we are facing is when we are using Card reader chip payment & card reader swipe payments, its not fetching the information and saving the details in our DB which is working fine for manual entry payment (tested successfully using izettle demo account for manual entry payment) while this is the only method provided by izettle to charge amount.

mansbernhardt commented 8 years ago

Hi,

You should use the same (and only) chargeAmount method for all card payments. It would be great if you could provide us with some more information such as:

1) How far in the payment UI flow does Vladimir get? Does it reach the payment successful screen or does the iZettle UI indicate/report an error? 2) Do you know if the chargeAmount completion block is returning a payment info or an error? 3) Which card reader model are you using?

"and using the @property from izettle sdk well" Not sure which property you are referring to here?

/Måns

babs20013 commented 8 years ago

Hi,

I asked Vladimir about your questions. Vladimir lives in Mexico & has access to the card reader kit from izettle while I live in India & I do not have access to this kit here, so cannot simulate card reader kit on my side.

About this question :

  1. "Do you know if the chargeAmount completion block is returning a payment info or an error?"

-- Can i get the card reader kit here in India to simulate it on my side to check the issue? About your other questions 1 & 3 :

I do not receive any error from the app I am able to complete the sale, in fact I am using the Mexican izettle account (vahomor@gmail.com) and the money charged is there. There is no information about the model in the reader so I am attaching some photos.

Regarding (@property I m using, I am considering all cases in code img_20160127_072844827 img_20160127_072913554 img_20160127_072932211

and using the @property from izettle sdk well and its working for manual payment which I have tested using demo account. property provided by izettle sdk in iZettleSDKPaymentInfo provide by izettle sdk :

@property (nonatomic, readonly) NSDictionary _dictionary; // Dictionary representation of the payment information @property (nonatomic, readonly) NSString referenceNumber; // iZettles reference to the payment @property (nonatomic, readonly) NSString entryMode; // EMV, MAGSTRIPE, MANUALENTRY @property (nonatomic, readonly) NSString authorizationCode; @property (nonatomic, readonly) NSString obfuscatedPan; // *\ ** ** 1111 @property (nonatomic, readonly) NSString panHash; // Hash sum of the plain pan @property (nonatomic, readonly) NSString cardBrand; @property (nonatomic, readonly) NSString AID; @property (nonatomic, readonly) NSString TSI; @property (nonatomic, readonly) NSString *TVR;)

But, the only issue we are facing is when we are using Card reader chip payment & card reader swipe payments, its not fetching the information and saving the details in our DB which is working fine for manual entry payment (tested successfully using izettle demo account for manual entry payment) while this is the only method provided by izettle to charge amount)

Do please let me know your thoughts.

mansbernhardt commented 8 years ago

A difference you will see for a chip payment vs a manual payment is that some more fields such as AID, TSI and TVR will contain values (non-nil), and perhaps your app does not handle that?

iZettlePaymentInfo

Object that contains information about a payment and the card used.

* These fields are only for EMV (non refund) payments

Example of a card reader chip payment:

entryMode = EMV
obfuscatedPan = "**** **** **** 0640"
panHash = 0092C7D95900033B84CE08B43F7E973485FB7081
cardBrand = MASTERCARD
AID = A0000000041010
TSI = 4000
TVR = 8000000000
applicationName = MasterCard
authorizationCode = 007602

Example of a card reader swipe payment:

entryMode = MAGSTRIPE
obfuscatedPan = "**** **** **** 2481"
panHash = 99426D012C6740D9AEC8E26580E8640A196E3C27
cardBrand = MASTERCARD
authorizationCode = 004601

Example of a manual entry payment:

entryMode = MANUAL_ENTRY
obfuscatedPan = "**** **** **** 1111"
panHash = 3E00BFA91E68894D5B6911A93C0F8C185708877B
cardBrand = VISA
authorizationCode = 031503
babs20013 commented 8 years ago

But as i said in beginning that i have considered all cases including AID, TSI and TVR but why then its working only for manual entries ?

I am fetching all variables & saving in our database. See below variables I am using :

         iZettleP *izet = [[iZettleP alloc]init];

         izet.referenceNumber=paymentInfo.referenceNumber;
         izet.entryMode=paymentInfo.entryMode;
         izet.authorizationCode=paymentInfo.authorizationCode;
         izet.obfuscatedPan=paymentInfo.obfuscatedPan;
         izet.panHash=paymentInfo.panHash;
         izet.cardBrand=paymentInfo.cardBrand;
         izet.AID=paymentInfo.AID;
         izet.TSI=paymentInfo.TSI;
         izet.TVR=paymentInfo.TVR;
         izet.applicationName=paymentInfo.applicationName;
         izet.numberOfInstallments=_cobrarPlazo.daysLater;
         izet.installmentAmount=_cobrarPlazo.remainsPayable;

Please do suggest.

Cheers!

babs20013 commented 8 years ago

resolved.