Module bluevia :: Class BlueViaPayment
[hide private]
[frames] | no frames]

Class BlueViaPayment

source code

 BlueVia --+    
           |    
BlueViaOauth --+
               |
              BlueViaPayment

The BlueVia class for payments.

Instance Methods [hide private]
 
__init__(self, consumer_key, consumer_secret, sandbox='_Sandbox', realm='BlueVia', version='v1')
Initialize the BlueViaPayment object
source code
 
fetch_request_token(self, amount, currency, serviceId, serviceName, callback='oob')
First call of the Payment oAuth Dance.
source code
 
savePaymentInfo(self, path)
Save Access Token and payment info (amount, currency, serviceId, serviceName, correlator) Will be valid for 48h only!
source code
 
loadPaymentInfo(self, path)
Load Access Token and payment info (amount, currency, serviceId, serviceName, correlator)
source code
 
issuePayment(self)
Issue the actual payment with amount, currency, serviceId, serviceName given by fetch_request_token method
source code
 
checkPayment(self, transactionId)
Check the Payment status (polling)
source code
 
cancelPayment(self, correlator)
Check the Payment status (polling)
source code

Inherited from BlueViaOauth: fetch_access_token, getAccessToken, getConsumer, saveAccessToken

Inherited from BlueVia: hasCredentials, loadAccessToken, setAccessToken, setConsumer, setDebug

Inherited from BlueVia (private): _debug, _signAndSend

Class Variables [hide private]

Inherited from BlueVia: access_token, consumer, debugFlag, environment, http, realm, version

Method Details [hide private]

__init__(self, consumer_key, consumer_secret, sandbox='_Sandbox', realm='BlueVia', version='v1')
(Constructor)

source code 

Initialize the BlueViaPayment object

Parameters:
  • consumer_key - (string): Key of the Consumer Credentials
  • consumer_secret - (string): Secret of the Consumer Credentials
  • sandbox - (string): Indicates whether testing should be done in Sandbox mode. Use "" for real network access; Default: "_Sandbox"
  • realm - (string): Realm string; Default: "BlueVia"
  • version - (string): BlueVia API version; Default: "v1"
Overrides: BlueViaOauth.__init__

fetch_request_token(self, amount, currency, serviceId, serviceName, callback='oob')

source code 

First call of the Payment oAuth Dance. Provide the Consumer Credential and request the one time Request Token (Override of BlueViaOauth fetch_request_token method)

Parameters:
  • amount - (string): Price in the form 125 for 1.25
  • currency - (string): Currency, e.g. "EUR", "GBP"
  • serviceId - (string): Product identifier provided by our Mobile Payments Partner (sandbox: free choice)
  • serviceName - (string): Product name as registered at our Mobile Payments Partner (sandbox: free choice)
  • callback - (string): The callback URL or "oob". Default: "oob"
Returns:
(tuple): (HTTP status, authorization URL). HTTP status == "200" for success
Overrides: BlueViaOauth.fetch_request_token

savePaymentInfo(self, path)

source code 

Save Access Token and payment info (amount, currency, serviceId, serviceName, correlator) Will be valid for 48h only!

Note: Unencrypted storage. Use only during development

Parameters:
  • path - (string): Path to file on disk (pickle file)

loadPaymentInfo(self, path)

source code 

Load Access Token and payment info (amount, currency, serviceId, serviceName, correlator)

Parameters:
  • path - (string): Path to file on disk (pickle file)

issuePayment(self)

source code 

Issue the actual payment with amount, currency, serviceId, serviceName given by fetch_request_token method

Returns:
(tuple): (HTTP status, (dict) paymentStatus). HTTP status == "200" for success.

checkPayment(self, transactionId)

source code 

Check the Payment status (polling)

Parameters:
  • transactionId - (string): Transaction Id provided by issuePayment method
Returns:
(tuple): (HTTP status, (dict) paymentStatus). HTTP status == "200" for success.

cancelPayment(self, correlator)

source code 

Check the Payment status (polling)

Parameters:
  • correlator - (string): correlator provided by issuePayment method
Returns:
(tuple): (HTTP status, (dict) paymentStatus). HTTP status == "200" for success.