NAME
Verotel::FlexPay
DESCRIPTION
This library allows merchants to use Verotel payment gateway and get paid by their users via Credit card and other payment methods.
get_signature($secret, %params)
Returns sha1_hex signature for the given parameters using $secret.
Signature is an SHA-1 hash as hexadecimal number generated from $secret followed by the parameters joined with colon (:). Parameters ("$key=$value") are alphabeticaly orderered by their keys. Only the following parameters are considered for signing:
AUTHOR
Verotel dev team
SUPPORT
Documentation PDF for the library can be found on the Verotel blog (http://blog.verotel.com/downloads/).
version, shopID, saleID, referenceID, priceAmount, priceCurrency, description, name custom1, custom2, custom3 subscriptionType period trialAmount, trialPeriod cancelDiscountPercentage
Example:
get_signature('aaB',
shopID => '123',
custom1 => 'xyz',
custom2 => undef ,
ignored => 'bla'
);
returns the SHA-1 string for "aaB:custom1=xyz:custom2=:shopID=123" converted to lowercase.
validate_signature($secret, %params)
Returns true if the signature passed in the parameters match the signature computed from all parameters (except for the signature itself).
Example:
validate_signature('aaB',
shopID => 123,
saleID => 345,
signature => '30a671fd2ab5a7580c3ecc279e092eef35a97ff1'
);
returns true as the signature passed as the parameter is the same as the signature computed for "aaB:saleID=345:shopID=123"
get_purchase_URL($secret, %params)
Return URL for purchase with signed parameters (only the parameters listed in the description of get_signature() are considered for signing).
Example:
get_purchase_URL('mySecret', shopID => 65147, priceAmount => '6.99', priceCurrency => 'USD');
returns
"https://secure.verotel.com/startorder?priceAmount=6.99&priceCurrency=USD&shopID=65147&type=purchase&version=3&signature=419265a47644c7852c4a595385b867a4ce87da7b"
get_subscription_URL($secret, %params)
Return URL for subscription with signed parameters (only the parameters listed in the description of get_signature() are considered for signing).
Example:
get_subscription_URL('mySecret', shopID => 65147, subscriptionType => 'recurring', period => 'P1M');
returns
"https://secure.verotel.com/startorder?period=P1M&shopID=65147&subscriptionType=recurring&type=subscription&version=3&signature=602c185d1ab001b84b8e5248b67539aae94aa7fb"
get_subscription_URL($secret, %params)
Return URL for upgrade subscription with signed parameters (only the parameters listed in the description of get_signature() are considered for signing).
Example:
get_upgrade_subscription_URL('mySecret', shopID => 65147, subscriptionType => 'recurring', period => 'P1M');
returns
"https://secure.verotel.com/startorder?period=P1M&shopID=65147&subscriptionType=recurring&type=upgradesubscription&version=3.4&signature=602c185d1ab001b84b8e5248b67539aae94aa7fb"
get_status_URL($secret, %params)
Return URL for status with signed parameters (only the parameters listed in the description of get_signature() are considered for signing).
Example:
get_status_URL('mySecret', shopID => '65147', saleID => '1485');
returns
"https://secure.verotel.com/salestatus?saleID=1485&shopID=65147&version=3&signature=c6f7c22553ba51e6171b34918652cf5099320f77"
get_cancel_subscription_URL($secret, %params)
Return URL for cancel subscription with signed parameters (only the parameters listed in the description of get_signature() are considered for signing).
Example:
get_cancel_subscription_URL('mySecret', shopID => '65147', saleID => '1485');
returns
"https://secure.verotel.com/cancel-subscription?saleID=1485&shopID=65147&version=3&signature=c6f7c22553ba51e6171b34918652cf5099320f77"