Created
December 15, 2012 19:32
-
-
Save tonylampada/4298454 to your computer and use it in GitHub Desktop.
Paypal in portuguese
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from paypalx import AdaptivePayments | |
from urllib import urlencode | |
from urllib2 import urlopen, Request | |
import logging | |
paypal = AdaptivePayments(settings.PAYPAL_API_USERNAME, | |
settings.PAYPAL_API_PASSWORD, | |
settings.PAYPAL_API_SIGNATURE, | |
settings.PAYPAL_API_APPLICATION_ID, | |
settings.PAYPAL_API_EMAIL, | |
sandbox=settings.PAYPAL_USE_SANDBOX) | |
receivers = [] | |
receivers.append({'amount' : '10.00', 'email' : '[email protected]'}) | |
response = paypal.pay( | |
actionType = 'PAY', | |
cancelUrl = settings.PAYPAL_CANCEL_URL, | |
currencyCode = 'USD', | |
feesPayer = 'EACHRECEIVER', | |
receiverList = { 'receiver': receivers}, | |
returnUrl = settings.PAYPAL_RETURN_URL, | |
ipnNotificationUrl = settings.PAYPAL_IPNNOTIFY_URL, | |
errorLanguage = "en_US" | |
) | |
paykey = response['payKey'] | |
print('https://www.paypal.com/webapps/adaptivepayment/flow/pay?paykey=%s&expType=light&country.x=us&locale=en_US&change_locale=1' % paykey) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment