Coder Social home page Coder Social logo

authorize-net-cim's People

Contributors

durango avatar heyharvs avatar mpuittinen avatar qwales1 avatar sean-hill avatar thgaskell avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

authorize-net-cim's Issues

undefined is not a function

I'm running trying to create a customer payment profile using your example, and I get an error when trying to call new Authorize.CreditCard. Authorize.CreditCard is undefined. I also copied and pasted the sample code:

var Authorize = require('auth-net-cim')
, _AuthorizeCIM = require('auth-net-cim')
, AuthorizeCIM = new _AuthorizeCIM({
api: '123',
key: '124',
sandbox: true // false
});

But I used my credentials. Am I missing a step somewhere?
Thanks!

getting error 'CERT_UNTRUSTED'..

when i call createcustomerprofile method, that time create a profile on website succesfully, but i m getting an error that 'CERT_UNTRUSTED'. so that why in reponce getting null.

createCustomerPaymentProfile doesn't work properly

The createCustomerPaymentProfile example in the README returns this error.

{ [AuthNetError: Authorize.net error: The element 'payment' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'creditCard, bankAccount, trackData, encryptedTrackData, payPal, opaqueData' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.]
  message: 'Authorize.net error: The element \'payment\' in namespace \'AnetApi/xml/v1/schema/AnetApiSchema.xsd\' has incomplete content. List of possible elements expected: \'creditCard, bankAccount, trackData, encryptedTrackData, payPal, opaqueData\' in namespace \'AnetApi/xml/v1/schema/AnetApiSchema.xsd\'.',
  code: 'E00003' }

This is my code

var payment = new Types.Payment({
    creditCard: new Types.CreditCard({
        cardNumber: 41111111111111111,
        expirationDate: '2012-01',
        cardCode: 111
    })
});

var paymentProfile = {
    customerType: 'individual',
    payment: payment
};

AuthorizeCIM.createCustomerPaymentProfile({
    customerProfileId: customerId,
    paymentProfile: paymentProfile
}, function(err, response){
    console.log(err);
});

How do I fix this issue?

createCustomerProfileTransaction request

Hey there, I was wondering how to parse the response from the createCustomerProfileTransaction request. The response I'm getting is

{   
    '$': {
        '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: 'Ok',
        message: { 
            code: 'I00001', 
            text: 'Successful.' 
        } 
    },
    directResponse: '1,1,1,This transaction has been approved.,RS7XSG,Y,2226525593,,,20.25,CC,auth_only,,Sean,Hill,,THE ADDRESS,THE PHONE NUMBER,,[email protected],,,,,,,,,,,,,,7387E8D182EE544B82A4AC96334F4D63,,2,,,,,,,,,,,XXXX4242,Visa,,,,,,,,,,,,,,,,' 
}

I would like the transaction id out of this, which I believe is 2226525593. Do I just need to run some crazy regex like

directResponse.match(/\d\d\d\d\d\d\d\d\d\d/)

?

Thanks for any help

Changes to XML API

We recently have ran into issues because it seems that the XML API has changed on AuthorizeNet's side. I'm not sure if more changes need to be made to the other projects (durango/authorize-net-types and durango/authorize-net-request)?

It looks like the code responsible for generating the xml needs to be updated to comply with their new api?

http://developer.authorize.net/api/reference

<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <merchantAuthentication>
    <name>API_LOGIN_ID</name>
    <transactionKey>API_TRANSACTION_KEY</transactionKey>
  </merchantAuthentication>
  <refId>123456</refId>
  <transactionRequest>
    <transactionType>authCaptureTransaction</transactionType>
    <amount>5</amount>
    <payment>
      <creditCard>
        <cardNumber>5424000000000015</cardNumber>
        <expirationDate>1220</expirationDate>
        <cardCode>999</cardCode>
      </creditCard>
    </payment>
    <order>
     <invoiceNumber>INV-12345</invoiceNumber>
     <description>Product Description</description>
    </order>
    <lineItems>
      <lineItem>
        <itemId>1</itemId>
        <name>vase</name>
        <description>Cannes logo </description>
        <quantity>18</quantity>
        <unitPrice>45.00</unitPrice>
      </lineItem>
    </lineItems>
    <tax>
      <amount>4.26</amount>
      <name>level2 tax name</name>
      <description>level2 tax</description>
    </tax>
    <duty>
      <amount>8.55</amount>
      <name>duty name</name>
      <description>duty description</description>
    </duty>
    <shipping>
      <amount>4.26</amount>
      <name>level2 tax name</name>
      <description>level2 tax</description>
    </shipping>
    <poNumber>456654</poNumber>
    <customer>
      <id>99999456654</id>
    </customer>
    <billTo>
      <firstName>Ellen</firstName>
      <lastName>Johnson</lastName>
      <company>Souveniropolis</company>
      <address>14 Main Street</address>
      <city>Pecan Springs</city>
      <state>TX</state>
      <zip>44628</zip>
      <country>USA</country>
    </billTo>
    <shipTo>
      <firstName>China</firstName>
      <lastName>Bayles</lastName>
      <company>Thyme for Tea</company>
      <address>12 Main Street</address>
      <city>Pecan Springs</city>
      <state>TX</state>
      <zip>44628</zip>
      <country>USA</country>
    </shipTo>
    <customerIP>192.168.1.1</customerIP>
    <!-- Uncomment this section for Card Present Sandbox Accounts -->
    <!-- <retail><marketType>2</marketType><deviceType>1</deviceType></retail> -->
    <transactionSettings>
      <setting>
        <settingName>testRequest</settingName>
        <settingValue>false</settingValue>
      </setting>
    </transactionSettings>
    <userFields>
      <userField>
        <name>MerchantDefinedFieldName1</name>
        <value>MerchantDefinedFieldValue1</value>
      </userField>
      <userField>
        <name>favorite_color</name>
        <value>blue</value>
      </userField>
    </userFields>
  </transactionRequest>
</createTransactionRequest>

transactionTypes issues

This library defines transaction types as

this.transactionTypes = [
    'AuthOnly', 'AuthCapture',
    'CaptureOnly', 'PriorAuthCapture',
    'Refund', 'Void'
];

But in the createCustomerProfileTransaction this line of code prevents Refund or Void requests.

if (transactionType !== "AuthCapture" && transactionType !== "AuthOnly" && transactionType !== "CaptureOnly" && transactionType !== "PriorAuthCapture") {
    throw new Error('Invalid transactionType. Must be: AuthCapture, AuthOnly, CaptureOnly, or PriorAuthCapture');
}

This could be fixed by this code

if (this.transactionTypes.indexOf(transactionType) === -1) {
    throw new Error('Invalid transactionType. Must be: ' + this.transactionTypes.join(', '));
}

@durango if this could be fixed that'd be great!

CreateCustomerProfileFromTransaction

Hi!

In one of our customer cases, the initial credit card transaction is first done to Authorize.net and only after the successful transaction, the payment profile is created based on that transaction. i.e. I'd need an interface to the Authorize.net CIM createCustomerProfileFromTransaction call.

Since we need that ASAP, we'll work on that on a fork and let you know once we're done.

-Mikael

Walkthrough

Do you have any ideas where to find a walk through when using this software, and Authorize.net CIM in a node application?

node-gyp has a python dependency in windows

This is just a nit, but one to be aware of, xml2json requires building c++ code and uses node-gyp. It's a bit heavy on requirements on the windows side.

xml2js does not have those heavy requirements, but, it does have lodash, which means waiting for about 30 seconds during npm install as lodash-node is a bit of an inefficient repo.

Chunking Issue for large requests

auth-net-request 2.0.0 does not account for chunking making any response that is to large makes the your app crash because it attempts to parse an uncompleted XML response.

auth-net-request 2.1.0 Fixes this issue so I recommend updating the packages to fix this issue.

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.