Skip to content

standardize readme format and info across repos #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jul 6, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
standardize readme format and info across repos
  • Loading branch information
adavidw committed Jul 3, 2017
commit 93b66426ac94fbfa049e65be2870414e374665e5
70 changes: 20 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,32 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-python/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-python/?branch=master)
[![PyPI](https://img.shields.io/pypi/v/authorizenet.svg)](https://badge.fury.io/py/authorizenet)

`pip install authorizenet`

## Requirements

## Prerequisites
* Python 2.7 or greater
* OpenSSL 1.0.2 or greater
* An Authorize.Net account (see Registration & Configuration section below)

- Python 2.7 or greater
- OpenSSL 1.0.2 or greater

We'll be ensuring this SDK is compatible with Python 2.7+, 3.2+ and PyPy but we're primarily testing against Python 2.7 so that's the current prerequisite.
We'll be ensuring this SDK is compatible with Python 2.7+, 3.2+ and PyPy but we're primarily testing against Python 2.7.


## Installation
To install AuthorizeNet

To install the AuthorizeNet Python SDK:

`pip install authorizenet`


## Registration & Configuration
## Registration & Configuration {#Registration}

Use of this SDK and the Authorize.Net APIs requires having an account on our system
Get a sandbox account at https://developer.authorize.net/sandbox


### Authentication

Set your API credentials:

```python
Expand All @@ -34,56 +40,16 @@ Set your API credentials:
```


## Usage
See our sample code repository at https://github.com/AuthorizeNet/sample-code-python

For the simplest "Hello World" example, paste this into a file called charge-credit-card.py and run:

```python
from authorizenet import apicontractsv1
from authorizenet.apicontrollers import *
from decimal import *

merchantAuth = apicontractsv1.merchantAuthenticationType()
merchantAuth.name = 'YOUR_LOGIN_ID'
merchantAuth.transactionKey = 'YOUR_TRANSACTION_KEY'

creditCard = apicontractsv1.creditCardType()
creditCard.cardNumber = "4111111111111111"
creditCard.expirationDate = "2020-12"

payment = apicontractsv1.paymentType()
payment.creditCard = creditCard

transactionrequest = apicontractsv1.transactionRequestType()
transactionrequest.transactionType = "authCaptureTransaction"
transactionrequest.amount = Decimal ('1.55')
transactionrequest.payment = payment


createtransactionrequest = apicontractsv1.createTransactionRequest()
createtransactionrequest.merchantAuthentication = merchantAuth
createtransactionrequest.refId = "MerchantID-0001"

createtransactionrequest.transactionRequest = transactionrequest
createtransactioncontroller = createTransactionController(createtransactionrequest)
createtransactioncontroller.execute()

response = createtransactioncontroller.getresponse()

if (response.messages.resultCode=="Ok"):
print "Transaction ID : %s" % response.transactionResponse.transId
else:
print "response code: %s" % response.messages.resultCode

```
### Setting Production or Sandbox Environments
To set the environment use the setenvironment method on the controller before executing. E.g. for the example above:
```python
# Defaults to constants.SANDBOX for sandbox testing
createtransactioncontroller.setenvironment(constants.PRODUCTION)
```

## Usage
See our sample code repository at https://github.com/AuthorizeNet/sample-code-python

## Building and Testing Source Code

Requirements
Expand All @@ -105,3 +71,7 @@ Testing

`>nosetests`


## License

This repository is destributed under a proprietary license. See the provided [LICENSE.txt] file.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy