Implements Braspag Pagador API (manual version 1.9).
Boleto generation is not yet implemented.
All arguments supplied to this method must be keyword arguments.
Parameters: |
|
---|---|
Returns: |
Capture the given amount from the given transaction_id.
This method should only be called after pre-authorizing the transaction by calling authorize() with transaction_types 1 or 3.
Returns: | BraspagResponse |
---|
Refund the given amount for the given transaction_id.
This method should be used to return funds to customers for transactions that happened at least 24 hours ago. For transactions that happended within 24 hours use void().
If the amount is 0 (zero) the full transaction will be refunded.
Returns: | BraspagResponse |
---|
Void the given amount for the given transaction_id.
This method should be used to return funds to customers for transactions that happened within less than 23h and 59 minutes ago. For other transactions use refund().
If the amount is 0 (zero) the full transaction will be voided.
Returns: | BraspagResponse |
---|
The example bellow shows how to authorize a credit card transation:
from braspag import BraspagRequest
ORDER_ID = u'84765421-5435-85C2-3F41-85A72BE2433E'
MERCHANT_ID = u'12345678-1234-1234-1234-1234567890AB'
request = BraspagRequest(merchant_id=MERCHANT_ID, homologation=True)
response = request.authorize(
order_id=ORDER_ID,
customer_id=u'12345678900',
customer_name=u'José da Silva',
customer_email='jose123@dasilva.com.br',
payment_method=997, #simulated BRL
amount=10000,
card_holder=u'Jose da Silva',
card_number=u'0000000000000001',
card_security_code='123',
card_exp_date='05/2018',
)
The argument order_id should be an GUID valid string which indentifies this transaction on your system. The argument customer_id must be a valid CPF or CNPJ for the user.
The amount given should be an integer where the 2 last digits will represent the decimal places.
Bases: braspag.exceptions.BraspagException
Status code Exception