Package pamfax :: Package processors :: Class Shopping
[hide private]
[frames] | no frames]

Class Shopping

source code

Class encapsulating shopping options available through PamFax

Instance Methods [hide private]
 
__init__(self, api_credentials, http)
Instantiates the Shopping class
source code
 
add_credit_to_sandbox_user(self, amount, reason=None)
Adds some credit in user's currency to the currently logged in user.
source code
 
get_invoice(self, payment_uuid, hidecopy=None)
Returns an invoice pdf file for a payment (see UserInfo/ListOrders).
source code
 
get_nearest_fax_in_number(self, ip_address)
Get the nearest available fax-in area code for the given IP-Address.
source code
 
get_shop_link(self, type=None, product=None, pay=None)
Returns different shop links.
source code
 
list_available_items(self)
Returns a list of available items from the shop.
source code
 
list_fax_in_areacodes(self, country_code, state=None)
Returns available fax-in area codes in a given country+state
source code
 
list_fax_in_countries(self)
Retruns a list of countries where new fax-in numbers are currently available
source code
 
redeem_credit_voucher(self, vouchercode)
Redeem a credit voucher.
source code
Method Details [hide private]

add_credit_to_sandbox_user(self, amount, reason=None)

source code 

Adds some credit in user's currency to the currently logged in user.

NOTES: This method is for testing purposes only, so it is not available in the LIVE system. Use it to create some 'virtual' credits for your users.

Arguments: amount -- The amount of credit you want to add to the current user's pamfax credit. Currency is the user's currency. You can also pass a negative value to remove credit from user for testing.

Keyword arguments: reason -- Optionally add some reason why you added this credit

get_invoice(self, payment_uuid, hidecopy=None)

source code 

Returns an invoice pdf file for a payment (see UserInfo/ListOrders).

Returns binary data so call with API_FORMAT_PASSTHRU.

get_nearest_fax_in_number(self, ip_address)

source code 

Get the nearest available fax-in area code for the given IP-Address.

Used to show "You can get a fax-in number in ..." to the user to offer PamFax plans to him

Arguments: ip_address -- IP-Address to find nearest number for

get_shop_link(self, type=None, product=None, pay=None)

source code 

Returns different shop links.

Use these links to open a browser window with the shop in a specific state.

Keyword arguments: type -- Type of link to return. Available: '', credit_packs, basic_plan, pro_plan, checkout product -- Product to add. Available: '',BasicPlan12,ProPlan12,OnDemand,Pack10,Pack30,Pack50,Pack100,Pack250,Pack500,Pack1000 pay -- (DEPRECATED) direct leads to checkout page

list_available_items(self)

source code 

Returns a list of available items from the shop.

When a user is logged in, it will also contain the items only available to validated customers.

redeem_credit_voucher(self, vouchercode)

source code 

Redeem a credit voucher.

These are different then the shop vouchers to be used in the online shop! You can use "PCPC0815" to test this function in the Sandbox API

Arguments: vouchercode -- The voucher code. Format is ignored.