Coder Social home page Coder Social logo

accept-sample-ios's Introduction

Sample Application for the Authorize.Net Accept Mobile SDK

This is a sample iOS application, demonstrating usage of the Accept Mobile SDK for iOS

Usage

Clone this repository

git clone https://github.com/AuthorizeNet/accept-sample-ios.git

Open the project XCode and run.

Examples

Sample app demonstrates usage of Apple Pay and the Accept Mobile SDK

Apple Pay Accept Token

accept-sample-ios's People

Contributors

brianmc avatar kbollepa avatar pankajtaneja86 avatar rakeshvisa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

accept-sample-ios's Issues

Support On React Native

I want to implement Apply Pay on React Native using Authorize.net is there any sdk for this

Error 153

Hello,

My app was working before for a long time but now I'm getting this error:

"Error 153, There was an error processing the payment data. Unable to decrypt data."

I'm sending the opaqueData in base64 encoding like before, but I'm getting this error now. I've reset my certificates already with no success. Any ideas on how to solve this issue?

Thank you!

App crash in iOS Device

Hello all,
I had integrated "AuthorizeNetAccept" in my project. It was working fine in simulator as well as in real device but now it crash when I want to create object for "AcceptSDKCardFieldsValidator" as well as "AcceptSDKHandler" class.

My project is in swift 2.3. Can anyone please help me out in this??
@brianmc can you please help me out in this?

Error - E00001, Unexpected character encountered

I'm working on Authorize.net payment api and while making transaction request as follows:

`let json = """
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "",
"transactionKey": ""
},
"refId": "2",
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": "(totalAmount)",
"payment": {
"opaqueData": {
"dataDescriptor": "(inResponse.getOpaqueData().getDataDescriptor())",
"dataValue": "(inResponse.getOpaqueData().getDataValue())"
}
}
}
}
}
"""

let jsonData = Data(json.utf8)
do {
  let transaction = try JSONDecoder().decode(Transaction.self, from: jsonData)
  print(transaction)
  // encoding
  let encodedData = try JSONEncoder().encode(transaction)
  print(String(data: encodedData, encoding: .utf8)!)

  //Data to [String : Any]
  do {
    let params = try JSONSerialization.jsonObject(with: encodedData, options: []) as! [String: Any]
    print(params)
    Alamofire.request(“https://apitest.authorize.net/xml/v1/request.api”, method: .post, parameters: params).responseJSON {response in
      print(response)
    }
  } catch {
    print(error)
  }

`

getting following error

error { messages = { message = ( { code = E00001; text = "Unexpected character encountered while parsing value: c. Path '', line 0, position 0."; } ); resultCode = Error; }; }
Is my approach of implementation correct? Please help.

[iOS][Swift] Cannot import module AuthorizeNetAccept

After I run successfully your sample app. Then I decide to mere source from it to my project.
I install successully your module via command pod 'AuthorizeNetAccept' and copy/ paste the 'ViewController.swift' file + your ViewController to my story board.
But when I build, I met the issue 'No such module AuthorizeNetAccept' at import statement. Can you give me the step by step to resolve this issue.
Thanks.

"The element 'createTransactionRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'refId' in namespace

Getting error response while making payment , how can I solve this?Any help please

Request :

[
"createTransactionRequest":
["refId": "123456",
"transactionRequest":
["payment": ["opaqueData": ["dataDescriptor": "COMMON.ACCEPT.INAPP.PAYMENT", "dataValue": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx="]],
"shipTo": ["state": "TX", "city": "Pecan Springs", "zip": "44628", "address": "12 Main Street", "lastName": "Bayles", "firstName": "China", "company": "Thyme for Tea", "country": "USA"], "userFields": ["userField": [["name": "MerchantDefinedFieldName1", "value": "MerchantDefinedFieldValue1"], ["name": "favorite_color", "value": "blue"]]], "poNumber": "456654", "billTo": ["state": "TX", "city": "Pecan Springs", "zip": "44628", "address": "14 Main Street", "lastName": "Johnson", "firstName": "Ellen", "company": "Souveniropolis", "country": "USA"], "transactionType": "authCaptureTransaction", "lineItems": ["lineItem": ["itemId": "1", "name": "vase", "description": "Cannes logo", "quantity": "18", "unitPrice": "45.00"]], "amount": "1", "customerIP": "192.168.1.1"],

"merchantAuthentication":
["name": "xxxxxxxxxxx", "transactionKey": "xxxxxxxxxxxxx"]
]
]

Response:

{
messages = {
message = (
{
code = E00003;
text = "The element 'createTransactionRequest' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'refId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'merchantAuthentication' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.";
}
);
resultCode = Error;
};
}

Sample app for objective c

I try to do implement authorize.net with accept sdk in my objective c project. but this code in swift , so please provide me objective c code for accept sdk.

Swift 4.1

Kindly update the package for swift 4.1, Getting error in the package it's compiled on swift 4.0.1

Kindly update it. need urgent request to build

Thanking in advance.

Success but no charge

Using this code I see a successful token bit I don't see how to submit the opaque data to authorize.net to actually charge the card

memory leak for URLSession

  • Platform: iOS x86 Simulator
  • OS Version: 13.3
  • Issue Detail
    class HTTP in AcceptSDK does not deallocate after getTokenWithRequest completed

Instruments_2020-03-12 16-25-04@2x

  • Steps to Reproduce
    call getTokenWithRequest

  • Reason
    In this line, class HTTP has been set as URLSession's delegate, and URLSessionDelegate is a strong reference property, not weak reference

  • Solution
    After task has finished, making URLSession invalidate will remove the reference to HTTP.
    session.finishTasksAndInvalidate()
    Add the above code after semaphore.wait

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.