UNSUPPORTED
This library is no longer maintained. Please check other FlexPay libraries at https://github.com/verotel
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 signature for the given parameters using $secret.
Signature is an SHA-256 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
Flexpay documentation can be found on https://controlcenter.verotel.com/flexpay-doc/index.html.
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-256 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
=>
'acb4dd91827bc79999a04ac2082d0e43bb018a9ce563dfd3e863fbae32e5f381'
);
returns true as the signature passed as the parameter is the same as the signature computed for "aaB:saleID=345:shopID=123"
Note: It accepts SHA-256 signature, but for now accepts also old SHA-1 signature for backward compatiblity.
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
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
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
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
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