胖斑马蟒蛇库
fatzebra的Python项目详细描述
现在,这个库为胖斑马支付网关提供了*基本*功能。
退款
附加功能的进一步支持将在时间允许的情况下添加,但是如果您需要此功能并且无法自己添加,请联系support@fatzebra.com.au并请求更改。
=fatzebra.gateway.gateway(“您的用户名”、“您的令牌”,true)最后一个参数指示是否使用沙盒
请尝试:
result=gw.purchase(100,“Jim Smith”,“5123456789012346”,“05/2014”,“123”,“122.99.99.111”)
如果结果成功:
打印“已批准购买-id:”+result.id
否则:
打印“拒绝购买”。消息:“+result.message
除了fatzebra.errors.gateway error,e:
print”gateway error:“+str(e.errors)<;--e.errors是一个数组。
除了fatzebra。errors.authentication error:
打印“authentication error-please check your username and token”
true)最终参数指示是否使用沙盒
尝试:
card=gw.tokenize(“jim smith”,“5123456789012346”,“05/2014”,“123”)
打印“card tokenized-token:”+card.token
除了fatzebra.errors.gateway error,e:
打印“网关错误:”+str(e.errors)<;--e.errors是一个数组。
除了fatzebra。errors.authentication error:
打印“authentication error-please check your username and token”
true)最终参数指示是否使用沙盒
尝试:
token=“abc12345”
结果=gw.purchase(100,token,“122.99.99.111”)
如果结果成功:
打印“已批准购买-ID:”+结果。ID
否则:
打印“已拒绝购买”。消息:“+result.message
除了fatzebra.errors.gateway error,e:
print”gateway error:“+str(e.errors)<;--e.errors是一个数组。
除了fatzebra。errors.authentication error:
打印“authentication error-please check your username and token”
refund
----
gw=fatzebra.gateway.gateway(“your username”,“your token”,true);最后的参数指示是否使用沙盒
尝试:
original_transaction=“013-P-ABJU879H”
结果=gw.退款(original_transaction,100,“我的退款参考”)
如果结果成功:
打印“退款已批准-ID:”+结果ID
否则:
打印“退款已拒绝”。消息:“+result.message
除了fatzebra.errors.gateway error,e:
print”网关错误:“+str(e.errors)<;--e.errors是数组。
除了fatzebra.errors.authenticationerror:
print”身份验证错误-请检查您的用户名和令牌“
使用3个错误类:
*`fatzebra.errors.gateway error`-这表示来自网关的响应失败(卡号无效、过期等)。检查消息(数组)的“errors”属性
*`fatzebra.errors.gatewayUnknownError`-这表示未知错误。有关详细信息,请检查“code”和“response”属性
*`fatzebra.errors.authent通信错误`-这表示您的用户名和令牌不正确。确认您拥有正确的详细信息并且正在使用正确的网关。沙盒凭证将以**test**
credits
==
此库由Matthew Savage(胖斑马)在Simon Meers(数字爱斯基摩人)的帮助下开发。如果对此库有任何疑问或问题,请联系Fat Zebra(support@fat zebra.com.au)或打开“问题”https://github.com/fatzebra/fatzebra python/issues>;`。
退款
附加功能的进一步支持将在时间允许的情况下添加,但是如果您需要此功能并且无法自己添加,请联系support@fatzebra.com.au并请求更改。
=fatzebra.gateway.gateway(“您的用户名”、“您的令牌”,true)最后一个参数指示是否使用沙盒
请尝试:
result=gw.purchase(100,“Jim Smith”,“5123456789012346”,“05/2014”,“123”,“122.99.99.111”)
如果结果成功:
打印“已批准购买-id:”+result.id
否则:
打印“拒绝购买”。消息:“+result.message
除了fatzebra.errors.gateway error,e:
print”gateway error:“+str(e.errors)<;--e.errors是一个数组。
除了fatzebra。errors.authentication error:
打印“authentication error-please check your username and token”
true)最终参数指示是否使用沙盒
尝试:
card=gw.tokenize(“jim smith”,“5123456789012346”,“05/2014”,“123”)
打印“card tokenized-token:”+card.token
除了fatzebra.errors.gateway error,e:
打印“网关错误:”+str(e.errors)<;--e.errors是一个数组。
除了fatzebra。errors.authentication error:
打印“authentication error-please check your username and token”
true)最终参数指示是否使用沙盒
尝试:
token=“abc12345”
结果=gw.purchase(100,token,“122.99.99.111”)
如果结果成功:
打印“已批准购买-ID:”+结果。ID
否则:
打印“已拒绝购买”。消息:“+result.message
除了fatzebra.errors.gateway error,e:
print”gateway error:“+str(e.errors)<;--e.errors是一个数组。
除了fatzebra。errors.authentication error:
打印“authentication error-please check your username and token”
refund
----
gw=fatzebra.gateway.gateway(“your username”,“your token”,true);最后的参数指示是否使用沙盒
尝试:
original_transaction=“013-P-ABJU879H”
结果=gw.退款(original_transaction,100,“我的退款参考”)
如果结果成功:
打印“退款已批准-ID:”+结果ID
否则:
打印“退款已拒绝”。消息:“+result.message
除了fatzebra.errors.gateway error,e:
print”网关错误:“+str(e.errors)<;--e.errors是数组。
除了fatzebra.errors.authenticationerror:
print”身份验证错误-请检查您的用户名和令牌“
使用3个错误类:
*`fatzebra.errors.gateway error`-这表示来自网关的响应失败(卡号无效、过期等)。检查消息(数组)的“errors”属性
*`fatzebra.errors.gatewayUnknownError`-这表示未知错误。有关详细信息,请检查“code”和“response”属性
*`fatzebra.errors.authent通信错误`-这表示您的用户名和令牌不正确。确认您拥有正确的详细信息并且正在使用正确的网关。沙盒凭证将以**test**
credits
==
此库由Matthew Savage(胖斑马)在Simon Meers(数字爱斯基摩人)的帮助下开发。如果对此库有任何疑问或问题,请联系Fat Zebra(support@fat zebra.com.au)或打开“问题”https://github.com/fatzebra/fatzebra python/issues>;`。