Comments (20)
You need to add something like this:
aRequest.retail = [[TransRetailInfoType alloc] init];
aRequest.retail.marketType = @"2"; // "Retail"
aRequest.retail.deviceType = @"7"; // "Wireless POS"
from inperson-sdk-ios.
Thank you for your response. Adding your code did not change anything as same error still pops up. Then I noticed in your code that 'aRequest' is allocated as type TransRetailInfoType. I was using AnetEMVTransactionRequest *aRequest = [[AnetEMVTransactionRequest alloc] init];
Allocating aRequest object of type 'TransRetailInfoType' did not work as it could not find other methods from 'AnetEMVTransactionRequest' class such as lineItems and emvTransactionType. So can you please give me a complete solution for this?
from inperson-sdk-ios.
func transactionObject() -> AnetEMVTransactionRequest {
let aRequest = AnetEMVTransactionRequest()
aRequest.emvTransactionType = .goods;
let amountAndProducts = self.totalAmountAndProduct()
aRequest.lineItems = amountAndProducts.products
aRequest.anetApiRequest.merchantAuthentication.sessionToken = self.sessionToken
aRequest.anetApiRequest.merchantAuthentication.mobileDeviceId = "454545454545454545454"
aRequest.amount = "\(amountAndProducts.totalAmount)"
let order = OrderType()
order.invoiceNumber = randoMax10DigitString()
order.orderDescription = "Order from Sample Application"
aRequest.order = order
aRequest.retail = TransRetailInfoType()
aRequest.retail.marketType = "2"
aRequest.retail.deviceType = "7"
}
from inperson-sdk-ios.
LineItemType *anItem = [LineItemType lineItem];
anItem.itemID = @"0";
anItem.itemPrice = self.tfTotalAmount.text;
anItem.itemName = @"AuthDemo";
anItem.itemTaxable = NO;
anItem.itemQuantity = @"1";
anItem.itemDescription = @"goods";
AnetEMVTransactionRequest *aRequest = [[AnetEMVTransactionRequest alloc] init];
//aRequest.lineItems = (NSMutableArray *)anItem;
aRequest.lineItems = [NSMutableArray arrayWithObject:anItem];
aRequest.emvTransactionType = EMVTransactionType_Goods;
aRequest.anetApiRequest.merchantAuthentication.sessionToken = self.strSessionToken;
aRequest.anetApiRequest.merchantAuthentication.mobileDeviceId = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
aRequest.amount = self.tfTotalAmount.text;
OrderType *orderTest = [[OrderType alloc] init];
orderTest.invoiceNumber = [NSString stringWithFormat:@"%ld", random()];
orderTest.orderDescription = @"Order from Sample Application";
aRequest.order = orderTest;
aRequest.retail = [[TransRetailInfoType alloc] init];
aRequest.retail.marketType = @"2"; // "Retail"
aRequest.retail.deviceType = @"7"; // "Wireless POS"
Processing debit card with above code gives me "Transaction was unsuccessful" alert with this log in xcode: "AUTHORISATION SUCCESSFUL BUT CARD DECLINED OR TERMINATED THE TRANSACTION". Am I doing anything wrong here?
from inperson-sdk-ios.
Could you try with some other card?
from inperson-sdk-ios.
I've already tried with 4-5 cards including debit and credit cards. Even the demo project I downloaded showing same alert "transaction unsuccessful". But amount is deducted
from inperson-sdk-ios.
Only authorization was successful, transaction did not go thruogh. Amount will be reversed automatically. Which is your processor?
from inperson-sdk-ios.
A9X. I do not think device processor as an issue. I'm trying this on iPad pro 9.7-Inch. I also tried on an old iPad as well. If transaction didn't occur, I'm wondering how the amount was deducted from my account. I'm getting logged in with merchant account credentials by setting live environment. Can you please recheck my code I mentioned in my last post and let me know if I did anything wrong?
from inperson-sdk-ios.
Who is your merchant account processor? Like FDC or TSYS? Transaction occured but only authorization was successful, card declined thr transaction hence settlement did not even start. Whatever you see in your account will be in pending state and removed once transaction is automatically reversed.
from inperson-sdk-ios.
Okay below is my processor configuration setting.
Processor Configuration
Processor: First Data Nashville
from inperson-sdk-ios.
So all the transactions come under 'unsettled transaction' with trans status: Authorized/Pending Capture(Transactions with this status have been authorized by the processor but will not be sent for settlement until a capture is performed). How do I need to perform capture?
Can anyone help me with this?
from inperson-sdk-ios.
CreditCardType *creditCardType = [CreditCardType creditCardType];
creditCardType.cardNumber = @"41111111111111111"";
creditCardType.cardCode = @"100";
creditCardType.expirationDate = @"01/20";
PaymentType *paymentType = [PaymentType paymentType];
paymentType.creditCard = creditCardType;
ExtendedAmountType *extendedAmountTypeTax = [ExtendedAmountType extendedAmountType];
extendedAmountTypeTax.amount = @"0";
extendedAmountTypeTax.name = @"Tax";
ExtendedAmountType *extendedAmountTypeShipping = [ExtendedAmountType extendedAmountType];
extendedAmountTypeShipping.amount = @"0";
extendedAmountTypeShipping.name = @"Shipping";
LineItemType *lineItem = [LineItemType lineItem];
lineItem.itemName = @"AuthCaptureProduct";
lineItem.itemDescription = @"AuthCaptureProductDescription";
lineItem.itemQuantity = @"1";
lineItem.itemPrice = @"0.01";
lineItem.itemID = @"1";
TransactionRequestType *requestType = [TransactionRequestType transactionRequest];
requestType.lineItems = [NSMutableArray arrayWithObject:lineItem];
requestType.amount = lineItem.itemPrice;
requestType.payment = paymentType;
requestType.tax = extendedAmountTypeTax;
requestType.shipping = extendedAmountTypeShipping;
CreateTransactionRequest *request = [CreateTransactionRequest createTransactionRequest];
request.transactionRequest = requestType;
request.transactionType = AUTH_CAPTURE;
request.anetApiRequest.merchantAuthentication.mobileDeviceId = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
request.anetApiRequest.merchantAuthentication.sessionToken = self.strSessionToken;
AuthNet *an = [AuthNet getInstance];
[an setDelegate:self];
[an purchaseWithRequest:request];
Above code works perfectly. But only problem is how do I get credit card information from user? User is supposed to swipe credit card to make payment but I'm not able to find any callback delegate when card is swiped. The document itself is so messy.
from inperson-sdk-ios.
You are trying to implement two different flow at the same time.
-
EMV flow: Where in Framework talks with the reader and does the full transaction, your application won't get any callback. Your application will be notified about the Status of the transaction(Success/Failure) or if user cancels the transaction in completion blocks.
-
Request which works for you is Non-EMV transaction flow, where in your application accepts the card information from the user and sends it to the framework by populating CreditCardType and CreateTransactionRequest objects.
Below is your EMV request, which looks ok
LineItemType *anItem = [LineItemType lineItem];
anItem.itemID = @"0";
anItem.itemPrice = self.tfTotalAmount.text;
anItem.itemName = @"AuthDemo";
anItem.itemTaxable = NO;
anItem.itemQuantity = @"1";
anItem.itemDescription = @"goods";
AnetEMVTransactionRequest *aRequest = [[AnetEMVTransactionRequest alloc] init];
//aRequest.lineItems = (NSMutableArray *)anItem;
aRequest.lineItems = [NSMutableArray arrayWithObject:anItem];
aRequest.emvTransactionType = EMVTransactionType_Goods;
aRequest.anetApiRequest.merchantAuthentication.sessionToken = self.strSessionToken;
aRequest.anetApiRequest.merchantAuthentication.mobileDeviceId = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
aRequest.amount = self.tfTotalAmount.text;
OrderType *orderTest = [[OrderType alloc] init];
orderTest.invoiceNumber = [NSString stringWithFormat:@"%ld", random()];
orderTest.orderDescription = @"Order from Sample Application";
aRequest.order = orderTest;
aRequest.retail = [[TransRetailInfoType alloc] init];
aRequest.retail.marketType = @"2"; // "Retail"
aRequest.retail.deviceType = @"7"; // "Wireless POS"
How many readers you own?
from inperson-sdk-ios.
I have only one reader: Anywherecommerce. With the EMV flow, I get "Unsuccessful Transaction alert" like I said before. And transaction status in my merchant account shows as "Authorized/Pending Capture". So with this flow, do I need to capture the transaction separately?
from inperson-sdk-ios.
@hiren43 No, you don't need to capture the transaction separately.
Below is the EMV transaction flow:
Once online Authorization is done, online authorization response is sent to the chip in the card which decides to approve/decline the transaction. Once card approves the transaction, framework will capture the transaction automatically, you don't need to do anything.
Possible reason for unsuccessful transaction in your case:
- The account you use, doesn't have permission to capture/void the transaction.
- Reader is missing the set of keys, due to which card declines the transaction.
Let me share the steps to check if your account have permission to capture/void the transaction in my next reply.
from inperson-sdk-ios.
Can you please share steps to find the permission to capture transaction in merchant account? Or whatever reason might be causing this error. This is what I do in my EMV flow
-
Setting up AuthNet with ENV_LIVE environment
-
Performing login with 'MobileDeviceLoginRequest' using merchant account and password
-
Getting session token from login success and transferring to payment screen.
-
Setting up AnetEMVManager object using 'initWithCurrecyCode: terminalID: skipSignature: showReceipt:'
-
Executing code mentioned in above post when Pay button is tapped
Am I doing anything wrong here?
from inperson-sdk-ios.
Yes, above steps are correct.
- Your Account Owner needs to log into the account.
- Once logged in click on Account
- Then Click on User Administration
- Click on the User’s Name
- Click Edit Permissions
- Check this box
Update unsettled transactions
Void transactions, submit previously authorized transactions for capture, approve or decline FDS transactions - Enter the Secret Answer and hit submit
from inperson-sdk-ios.
As of now I do not have permission to change user's role. I will check that out soon. I have one query regarding code.
Do I need to keep this "aRequest.retail = [[TransRetailInfoType alloc] init];" line in my code? Keeping this line shows me alert "Unsuccessful Transaction". If I comment out this line, I'm shown a receipt mentioning status "EMV data is not supported with this market type". I guess I need to keep this line. After getting role to update unsettled transactions, I will be shown this receipt on payment success.
Following is the log when "Unsuccessful Transaction" alert pops. It mentions here "This account has not been given the permission(s) required for this request"
2017-11-08 12:38:26.858 AuthnetDemo[3448:1171953] Error = (null)
2017-11-08 12:38:27.369 AuthnetDemo[3448:1171953] AUTHORISATION SUCCESSFUL BUT CARD DECLINED OR TERMINATED THE TRANSACTION
2017-11-08 12:38:27.378 AuthnetDemo[3448:1171953] ENV value in defaults (null)
2017-11-08 12:38:27.378 AuthnetDemo[3448:1171953] URL: https://api.authorize.net/xml/v1/request.api
2017-11-08 12:38:27.383 AuthnetDemo[3448:1171953] Reachability Flag Status: -R ------- networkStatusForFlags
2017-11-08 12:38:27.385 AuthnetDemo[3448:1171953] CreateTransactionRequest: <transactionRequest><transactionType>voidTransaction</transactionType><amount>0.01</amount><solution><id>A1000025</id></solution><terminalNumber>6958543</terminalNumber><refTransId>60763918409</refTransId><order></order><lineItems></lineItems><customer></customer><billTo></billTo><shipTo></shipTo><retail><marketType>2</marketType><deviceType>7</deviceType></retail><transactionSettings></transactionSettings><userFields></userFields></transactionRequest>
2017-11-08 12:38:30.642 AuthnetDemo[3448:1171953] CreateTransactionResponse <?xml version="1.0" encoding="utf-8"?><createTransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error</resultCode><message><code>E00027</code><text>The transaction was unsuccessful.</text></message></messages><sessionToken>f_gjTCH6NSQOO3tjYps1a7IkmJwCq$Hp2TmFN1PZECHcGqfGpNsMTK0Y8RgUl$z7z7k0R3zlIq9Tq_i2xmgDjXBgbLb45$0zSaowwECTo$0xS0C4eyg1fm$xQbH6Z$4yTK6xZ2FDKd5vPCj1V_U0rQAA</sessionToken><transactionResponse><responseCode>3</responseCode><authCode /><avsResultCode>P</avsResultCode><cvvResultCode /><transId>0</transId><refTransID>60763918409</refTransID><transHash>58D4B1DD58012A0B4034DB59CE140410</transHash><testRequest>0</testRequest><accountNumber /><accountType>Visa</accountType><errors><error><errorCode>123</errorCode><errorText>This account has not been given the permission(s) required for this request.</errorText></error></errors><transHashSha2 /></transactionResponse></createTransactionResponse>
namespace warning : xmlns: URI AnetApi/xml/v1/schema/AnetApiSchema.xsd is not absolute
ttp://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"
from inperson-sdk-ios.
You need that line and object to be set. Once you have permission issue resolved that will be successful transactions.aRequest.retail = [[TransRetailInfoType alloc] init];
aRequest.retail.marketType = @"2"; // "Retail"
aRequest.retail.deviceType = @"7"; // "Wireless POS"
from inperson-sdk-ios.
It was indeed permission related issue. Logging in as a transaction manager solved my issue. Thank you.
from inperson-sdk-ios.
Related Issues (20)
- SDK not working in swift 4.1
- Demo app is crashed when we have installed using exported app through Xcode.
- We are getting this sequence of code while selecting EMV Transaction option for payment in the demo app.
- I am getting error 'EMV data is not supported with this market type' while using the ‘startQuickChipWithTransactionRequest' method for doing transaction. I have used Iive mode for testing.
- Obj-C example of startQuickChipWithTransactionRequest HOT 1
- Transaction failed. Audio failed to start and may be activated by another application. HOT 1
- Invalid Input Error code 18
- Duplicate symbol __Z13iOSDeviceNamev for architecture armv7 in libAnetEMVLibrary.a
- on ios 10.15 and xcode 10 error
- Transaction Failed because of POS Device no detected HOT 2
- CM Terminal mode not listening the swipe
- BT Mode searching for AD (audio device) HOT 2
- Is there a option to customize the messages?
- AuthNet Error Conflicts with Swift Error Definiton
- EMV solution
- [AuthNet issueSSLPost:withURL:withSoap:] errors
- iOS SDK Example app always displays "Transaction was unsuccessful" even though transaction succeeds HOT 1
- Issue after update iOS 15.1 - BBPOS device shows -Transaction Failed.Please try again checking the bluetooth connection with POS reader
- Unable to build chain to self-signed root for signer HOT 1
- EMV Reader firmware update required during busiest holiday shopping time of the year HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inperson-sdk-ios.