Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
Update release notes, sample for security test TLS endpoint, and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
avidas committed Nov 9, 2015
1 parent 5947df4 commit 8bf08ea
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The PayPal REST SDK provides Python APIs to create, process and manage payment.
> If deploying on Google appengine and running into issues since requests is a dependency, see [#66](https://github.com/paypal/PayPal-Python-SDK/issues/66) for workaround.
> To verify that your server supports PCI compliant version of TLS, run [this sample](/samples/payment/create_with_paypal_security_test.py) with your credentials.
## System Requirements
PayPal SDK depends on the following system libraries:

Expand Down
6 changes: 6 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
PayPal Python SDK release notes
============================

v1.11.1
----
* Security test sandbox endpoint avaiable as a configuration
* Warn if merchant server has below 1.0 version of OpenSSL
* Update User Agent with crypto lib version

v1.11.0
----
* Full request/response logged at DEBUG level for non production environments
Expand Down
63 changes: 63 additions & 0 deletions samples/payment/create_with_paypal_security_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Create Payment Using PayPal Sample against endpoint
# that only allows an acceptable highest TLS version
from paypalrestsdk as paypal
import logging
logging.basicConfig(level=logging.INFO)

paypal.configure({
"mode": "security-test-sandbox", # sandbox or live
"client_id": "<CLIENT_ID>",
"client_secret": "<CLIENT_SECRET>" })

# Payment
# A Payment Resource; create one using
# the above types and intent as 'sale'
payment = paypal.Payment({
"intent": "sale",

# Payer
# A resource representing a Payer that funds a payment
# Payment Method as 'paypal'
"payer": {
"payment_method": "paypal"},

# Redirect URLs
"redirect_urls": {
"return_url": "http://localhost:3000/payment/execute",
"cancel_url": "http://localhost:3000/"},

# Transaction
# A transaction defines the contract of a
# payment - what is the payment for and who
# is fulfilling it.
"transactions": [{

# ItemList
"item_list": {
"items": [{
"name": "item",
"sku": "item",
"price": "5.00",
"currency": "USD",
"quantity": 1}]},

# Amount
# Let's you specify a payment amount.
"amount": {
"total": "5.00",
"currency": "USD"},
"description": "This is the payment transaction description."}]})

# Create Payment and return status
if payment.create():
print("Payment[%s] created successfully" % (payment.id))
# Redirect the user to given approval url
for link in payment.links:
if link.method == "REDIRECT":
# Convert to str to avoid google appengine unicode issue
# https://github.com/paypal/rest-api-sdk-python/pull/58
redirect_url = str(link.href)
print("Redirect for approval: %s" % (redirect_url))
else:
print("Error while creating payment:")
print(payment.error)

0 comments on commit 8bf08ea

Please sign in to comment.