Yoursafe

Subscription

OpenAPI
  • https://secure.verotel.com
  • https://secure.billing.creditcard
  • https://secure.gaycharge.com
  • https://secure.yoursafedirect.com

Create a subscription order

Examples are for Verotel FlexPay PHP client library

Examples are for FlexPay Java client library

The “startorder” subscription request is used to redirect buyer to the Verotel Order Page to process subscription with a given amount, duration and currency.

HTTP request

Verotel

GET https://secure.verotel.com/startorder?

CardBilling

GET https://secure.billing.creditcard/startorder?

GayCharge

GET https://secure.gaycharge.com/startorder?

YoursafeDirect

GET https://secure.yoursafedirect.com/startorder?

When processing without Orderpage, at least version 3.3 must be used. | NOTE: only EUR is can be used for DDEU payment method system | NOTE: DDEU and YOURSAFE_DIRECT only support one-time | recurring only | amount to be processed in nnn.nn format for the initial trial period, minimum is 2 days | recurring only | duration in ISO8601 format, for example: P30D | NOTE: DDEU is available only in DE, AT, CH, BE, IT, NL, ES and FR If oneClickToken is sent, the payment method must be set to CC. When processing without Orderpage, IDEAL must be set. | NOTE: email is excluded from signature calculations (max 100 chars else it will be ignored) |

$brand = Verotel\FlexPay\Brand::create_from_merchant_id(/* Your customer ID */ '9804000000000000');

$flexpayClient = new Verotel\FlexPay\Client(/* shop ID */ 12345, "FlexPay Signature Key", $brand);

$subscriptionUrl = $flexpayClient->get_subscription_URL([
    "subscriptionType" => "recurring",
    "name" => "Test subscription",
    "trialAmount" => 5,
    "trialPeriod" => 'P7D',
    "priceAmount" => 12.64,
    "priceCurrency" => "EUR",
    "period" => 'P30D',
]);

Sends this request from your browser to the selected host. The reference does not publish a sandbox host.

GET/startorder

Query parameters

versionnumberrequired
  • version version of the FlexPay call, 4 for this version.
  • When processing without Orderpage, at least version 3.3 must be used.
shopIDnumberrequired

numerical ID of the website in the Verotel system

typestringrequired

subscription

priceAmountnumberrequired

priceAmount amount to be processed in nnn.nn format

priceCurrencystringrequired
  • priceCurrency 3 char ISO code, must be one of the Sale currencies (USD EUR GBP AUD CAD CHF DKK NOK SEK)
  • NOTE: only EUR is can be used for DDEU payment method system
periodstringrequired

duration in ISO8601 format, for example: P30D, minimum is 7 days for recurring and 2 days for on-time

subscriptionTypestringrequired
  • one-time or recurring
  • NOTE: DDEU and YOURSAFE_DIRECT only support one-time
trialAmountnumber

amount to be processed in nnn.nn format for the initial trial period, minimum is 2 days

trialPeriodstring

duration in ISO8601 format, for example: P30D

namestring

description of the product. Text is displayed on the order page - max 100 printable characters

paymentMethodstring
  • payment method, CC, YOURSAFE_DIRECT or DDEU (if not set then buyers can choose from available payment methods)
  • NOTE: DDEU is available only in DE, AT, CH, BE, IT, NL, ES and FR
  • If oneClickToken is sent, the payment method must be set to CC.
  • When processing without Orderpage, IDEAL must be set.
referenceIDstring

merchant’s reference identifier. It must be unique if provided

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

successURLstring

URL for redirect after successful transaction - max 255 characters. Defaults to success landing URL on the website.

declineURLstring

URL for redirect after declined transaction - max 255 characters. Defaults to decline landing URL on the website.

emailstring
  • email of the buyer. If not set, it will be collected on the Order Page
  • NOTE: email is excluded from signature calculations (max 100 chars else it will be ignored)
signaturestringrequired

Signature calculation

Success redirect

After a successful transaction the buyer is redirected to one of these:

  • The default website Flexpay success URL (Setup in Control Center/Setup Websites/Website detail/FlexPay Options)

  • The URL set in successURL Flexpay parameter – overrides the website Flexpay success URL

GET https://example.com/success
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=initial
    &referenceID=order-1001
    &saleID=123456
    &priceAmount=9.99
    &priceCurrency=USD
    &period=P30D
    &trialAmount=5.00
    &trialPeriod=P7D
    &expiresOn or nextChargeOn=value
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &paymentMethod=CC
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

one-time or recurring

eventstring

initial

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

priceAmountnumber

amount to be processed in nnn.nn format

priceCurrencystring

3 char ISO code of the Sale currency

periodstring

subscription duration in ISO8601 format

trialAmountnumber

amount to be processed (max 2 decimal places, stripped zeroes) for the initial trial period

trialPeriodstring

duration in ISO8601 format

expiresOn or nextChargeOnstring

date of next rebill or expiry date [yyyy-mm-dd] eq. “2015-04-24”

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

paymentMethodstring

payment method, CC, YOURSAFE_DIRECT, DDEU

signaturestring

Signature calculation

Postbacks

Examples are for Verotel FlexPay PHP client library

Examples are for FlexPay Java client library

After every sale or transaction based action a corresponding postback is sent to the registered Postback URL.

Postback data are sent as GET request.

Verifying postback

As a security measure postback have to be validated that it contains correctly computed Signature.

Responding to postback

Important: The Verotel system expects HTTP status code 200 and plain text “OK” response. The response must be returned within 30 seconds.

$brand = Verotel\FlexPay\Brand::create_from_merchant_id(/* Your customer ID */ '9804000000000000');

$flexpayClient = new Verotel\FlexPay\Client(/* shop ID */ 12345, "FlexPay Signature Key", $brand);

if (!$flexpayClient->validate_signature($_GET)){
    http_response_code(400);
    echo "ERROR - Invalid signature!";
    exit;
}

// handle correct postback
...

echo "OK";

Initial postback

The initial sale postback is sent to the website “Flexpay postback URL” immediately after the sale has been processed. The postback is sent only for successfully approved transactions. The data in the postback provide essential information about the sale. If more information is needed, for example billing address or email address of the buyer, the merchant should query the status page.

Important: The Verotel system expects HTTP status code 200 and plain text “OK” response. The response must be returned within 30 seconds.

GET https://example.com/postback
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=initial
    &referenceID=order-1001
    &saleID=123456
    &transactionID=987654
    &priceAmount=9.99
    &priceCurrency=USD
    &period=P30D
    &trialAmount=5.00
    &trialPeriod=P7D
    &expiresOn or nextChargeOn=value
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &paymentMethod=CC
    &signature=abcdef0123456789abcdef0123456789abcdef01
    &truncatedPAN=411111******1111
    &CCBrand=VISA
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

one-time or recurring

eventstring

initial

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

transactionIDnumber

identifier of the transaction in the Verotel system (only avaible for postbacks version 2)

priceAmountnumber

amount to be processed in nnn.nn format

priceCurrencystring

3 char ISO code of the Sale currency

periodstring

subscription duration in ISO8601 format

trialAmountnumber

amount to be processed (max 2 decimal places, stripped zeroes) for the initial trial period

trialPeriodstring

duration in ISO8601 format

expiresOn or nextChargeOnstring

date of next rebill or expiry date [yyyy-mm-dd] eq. “2015-04-24”

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

paymentMethodstring

payment method, CC, YOURSAFE_DIRECT, DDEU

signaturestring

Signature calculation

truncatedPANstring

Truncated (masked) payment instrument identification, e.g. card number

CCBrandstring

Only present if paid via Credit Card, represents the card brand, e.g. VISA

Rebill postback

Rebill postback call is sent to the merchant’s URL immediately after a successful rebill transaction.

GET https://example.com/postback
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=rebill
    &referenceID=order-1001
    &saleID=123456
    &transactionID=987654
    &amount=9.99
    &currency=USD
    &nextChargeOn=2015-04-24
    &subscriptionPhase=terminated
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &paymentMethod=CC
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

recurring

eventstring

rebill

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

transactionIDnumber

identifier of the transaction in Verotel system

amountnumber

amount to be processed in nnn.nn format

currencystring

3 char ISO code of the Sale currency

nextChargeOnstring

date of next rebill [yyyy-mm-dd] eq. “2015-04-24”

subscriptionPhasestring

normal or discounted

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

paymentMethodstring

payment method, CC, YOURSAFE_DIRECT, DDEU

signaturestring

Signature calculation

Extend postback

Merchant or Verotel support may grant extra days to an active subscription. This means that the expiration date or the date of the next planned rebill gets shifted by number of days to the future. The extend postback is then sent to merchant’s postback URL to notify the merchant about that the subscription got extended.

GET https://example.com/postback
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=extend
    &referenceID=order-1001
    &saleID=123456
    &nextChargeOn or expiresOn=value
    &subscriptionPhase=terminated
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

recurring or one-time

eventstring

extend

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

nextChargeOn or expiresOnstring

date when cancelled or one-time subscription expires, or date of the next planned rebill [yyyy-mm-dd] e.g “2015-04-24”

subscriptionPhasestring

trial normal discounted

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

signaturestring

Signature calculation

Downgrade postback

If Merchant or Verotel support changes the next rebill price the Downgrade postback call is sent

GET https://example.com/postback
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=downgrade
    &referenceID=order-1001
    &saleID=123456
    &amount=9.99
    &currency=USD
    &subscriptionPhase=normal
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

recurring or one-time

eventstring

downgrade

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

amountnumber

amount to be processed in nnn.nn format

currencystring

3 char ISO code of the Sale currency

subscriptionPhasestring

normal

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

signaturestring

Signature calculation

Cancel postback

Cancel postback call is sent to the merchant’s URL after the subscription is cancelled by the buyer, merchant, Verotel support or by the system.

GET https://example.com/postback
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=cancel
    &referenceID=order-1001
    &saleID=123456
    &expiresOn=2015-04-24
    &cancelledBy=merchant
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

recurring

eventstring

cancel

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

expiresOnstring

expiry date [yyyy-mm-dd] eq. “2015-04-24”

cancelledBystring

user support merchant system

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

signaturestring

Signature calculation

Uncancel postback

Occasionally, buyers wish to revert cancellation of their subscription. Uncancel can be done only by Verotel support. The postback call is sent to the merchant’s postback URL immediately after the subscription was uncancelled.

GET https://example.com/postback
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=uncancel
    &referenceID=order-1001
    &saleID=123456
    &nextChargeOn=2015-04-24
    &subscriptionPhase=terminated
    &uncancelledBy=support
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

recurring

eventstring

uncancel

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

nextChargeOnstring

date of the next planned rebill [yyyy-mm-dd] eq. “2015-04-24”

subscriptionPhasestring

trial normal discounted

uncancelledBystring

support

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

signaturestring

Signature calculation

Expiry postback

Expiry postback call is sent to the merchant’s postback URL when the subscription gets terminated. The reason for the termination could be the end of a cancelled subscription, declined rebill transaction or termination by Verotel support or the merchant.

GET https://example.com/postback
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=expiry
    &referenceID=order-1001
    &saleID=123456
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

recurring or one-time

eventstring

expiry

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

signaturestring

Signature calculation

Credit postback

Credit postback call is sent to the merchant’s postback URL when any transaction of the subscription is credited by merchant, Verotel support or by system (e.g. when an automated refund is performed). The refund also terminates subscription.

GET https://example.com/postback
    ?shopID=12345
    &event=credit
    &referenceID=order-1001
    &saleID=123456
    &priceAmount=9.99
    &priceCurrency=USD
    &transactionID=987654
    &parentID=456789
    &subscriptionType=recurring
    &subscriptionPhase=terminated
    &type=subscription
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

eventstring

credit

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

priceAmountnumber

amount of refunded transaction

priceCurrencystring

refunded transaction currency

transactionIDnumber

transaction id of credit transaction

parentIDnumber

transaction id of transaction which was credited

subscriptionTypestring

recurring or one-time

subscriptionPhasestring

terminated or normal (for partial credit without terminate initiated)

typestring

subscription

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

signaturestring

Signature calculation

Chargeback postback

Chargeback postback call is sent to the merchant’s postback URL when sale transaction is chargebacked. This also blacklists the buyer.

GET https://example.com/postback
    ?shopID=12345
    &event=chargeback
    &referenceID=order-1001
    &saleID=123456
    &priceAmount=9.99
    &priceCurrency=USD
    &transactionID=987654
    &parentID=456789
    &subscriptionType=recurring
    &subscriptionPhase=terminated
    &type=subscription
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

eventstring

chargeback

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

priceAmountnumber

amount of chargebacked transaction

priceCurrencystring

chargebacked transaction currency

transactionIDnumber

transaction id of credit transaction

parentIDnumber

transaction id of transaction which was credited

subscriptionTypestring

recurring or one-time

subscriptionPhasestring

terminated

typestring

subscription

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

signaturestring

Signature calculation

Upgrade postback

Upgrade postback call is sent to the merchant’s postback URL when the subscription is switched from one plan to another. The postback is sent instead of the Successful sale postbacks when the new subscription the buyer is switching to is successfully created and the previous subscription is terminated in Verotel system (No Expiry postback is sent). See “FlexPay API Upgrade” document for more details.

GET https://example.com/postback
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=upgrade
    &referenceID=order-1001
    &saleID=123456
    &transactionID=987654
    &precededBySaleID=123450
    &priceAmount=9.99
    &priceCurrency=USD
    &period=P30D
    &expiresOn or nextChargeOn=value
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &paymentMethod=CC
    &signature=abcdef0123456789abcdef0123456789abcdef01
    &truncatedPAN=411111******1111
    &CCBrand=VISA
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

one-time or recurring

eventstring

upgrade

referenceIDstring

merchant reference identifier if provided in the first sale.

saleIDnumber

identifier of the sale in the Verotel system

transactionIDnumber

identifier of the transaction in the Verotel system (only avaible for postbacks version 2)

precededBySaleIDnumber

Identifier of the previous sale the enduser is switching from

priceAmountnumber

amount to be processed in nnn.nn format

priceCurrencystring

3 char ISO code of the Sale currency

periodstring

subscription duration in ISO8601 format

expiresOn or nextChargeOnstring

date of next rebill or expiry date [yyyy-mm-dd] eq. “2015-04-24”

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

paymentMethodstring

payment method, CC, YOURSAFE_DIRECT, DDEU

signaturestring

Signature calculation

truncatedPANstring

Truncated (masked) payment instrument identification, e.g. card number

CCBrandstring

Only present if paid via Credit Card, represents the card brand, e.g. VISA

Status page request

A status of a sale made with a FlexPay API can be reviewed by querying the status page. Status page provides complete information about the sale, the buyer, and its status.

HTTP request

Verotel

GET https://secure.verotel.com/status/order?

CardBilling

GET https://secure.billing.creditcard/status/order?

GayCharge

GET https://secure.gaycharge.com/status/order?

YoursafeDirect

GET https://secure.yoursafedirect.com/status/order?

NOTFOUND - purchase not found ERROR - error (see ‘error’ key) | Can be one of following: Credit Card or Direct Debit EU |

$brand = Verotel\FlexPay\Brand::create_from_merchant_id(/* Your customer ID */ '9804000000000000');

$flexpayClient = new Verotel\FlexPay\Client(/* shop ID */ 12345, "FlexPay Signature Key", $brand);

$statusURL = $flexpayClient->get_status_URL(['saleID' => 123456]);

$statusPageData = Symfony\Component\Yaml\Yaml::parse(file_get_contents($statusURL));

// handle data fetched from status page

Sends this request from your browser to the selected host. The reference does not publish a sandbox host.

GET/status/order

Query parameters

versionnumber

4

shopIDnumber

numerical ID of the website in the Verotel system

referenceIDstring

Merchant’s reference identifier if provided (referenceID OR saleID must be posted - NOT BOTH)

saleIDnumber

Verotel saleID identifier (referenceID OR saleID must be posted - NOT BOTH)

signaturestring

Signature calculation

Response

200
responsestring
  • FOUND - purchase record found and returned
  • NOTFOUND - purchase not found
  • ERROR - error (see ‘error’ key)
errorstring

message (for response=ERROR)

saleIDstring

identifier of the transaction in Verotel System

shopIDstring

ID of website in Verotel system

paymentMethodstring
  • an identifier of payment method that was used for the transaction.
  • Can be one of following: Credit Card or Direct Debit EU
priceAmountstring

amount processed in nnn.nn format

priceCurrencystring

3 char ISO code of the Sale currency

trialAmountstring

trial period processed amount

trialPeriodstring

duration of trial period in ISO8601 format

discountAmountstring

reccurring amount after cancel discount confirmation by buyer

periodstring

duration in ISO8601 format, for example: P30D

descriptionstring

Product description text - max 100 printable characters

typestring

purchase or subscription

subscriptionTypestring

one-time or recurring

expiredstring

yes or no

expiresOnstring

when subscription will be terminated

referenceIDstring

Merchant reference identifier - max 100 printable characters

namestring

name of the buyer

emailstring

email address of the buyer

countrystring

selected or detected country ISO code (ISO 3166-1-alpha-2 code)

oneClickTokenstring

If the feature is enabled - Currently valid oneClickToken

cancelledstring

yes or no

cancelledOnstring

Timestamp of cancellation

cancelledBystring

user support merchant system

createdOnstring

Timestamp of purchase creation

saleResultstring

purchase processing result (APPROVED)

billingAddr_fullNamestring

billing address: full name field value

billingAddr_companystring

billing address: company field value

billingAddr_addressLine1string

billing address: 1st line field value

billingAddr_addressLine2string

billing address: 2nd line field value

billingAddr_citystring

billing address: city name

billingAddr_zipstring

billing address: zip code / postal code

billingAddr_statestring

billing address: US state code (ISO 3166-2)

billingAddr_countrystring

billing address: country ISO code (ISO 3166-1-alpha-2 code)

Cancel subscription request

Examples are for Verotel FlexPay PHP client library

Examples are for FlexPay Java client library

To allow your subscribers to cancel their subscriptions on your website you can now generate a subscription specific cancel URL.

HTTP request

Verotel

GET https://secure.verotel.com/cancel-subscription?

CardBilling

GET https://secure.billing.creditcard/cancel-subscription?

GayCharge

GET https://secure.gaycharge.com/cancel-subscription?

YoursafeDirect

GET https://secure.yoursafedirect.com/cancel-subscription?

$brand = Verotel\FlexPay\Brand::create_from_merchant_id(/* Your customer ID */ '9804000000000000');

$flexpayClient = new Verotel\FlexPay\Client(/* shop ID */ 12345, "FlexPay Signature Key", $brand);

$cancelSubscriptionURL = $flexpayClient->get_cancel_subscription_URL([
    "saleID" => 654321
]);

Sends this request from your browser to the selected host. The reference does not publish a sandbox host.

GET/cancel-subscription

Query parameters

versionstringrequired

version version of the FlexPay call, 4 for this version

shopIDnumberrequired

numerical ID of the website or shop in Verotel system

saleIDnumberrequired

Verotel saleID identifier

signaturestringrequired

Signature calculation

Upgrade subscription request

Examples are for Verotel FlexPay PHP client library

Examples are for FlexPay Java client library

Subscription upgrade allows switching from one currently active subscription to a new one with new pricing and rebill period. It is possible to switch between recurring and one-time subscriptions, between payment methods and change the periods and amounts.

If successful – an upgrade postback is sent, the current subscription is terminated in Verotel system (the expiry postback is not send in this case) and the buyer continues with the new subscription.

Upgrade Options

The optional upgradeOption parameter specifies how the remaining time from the previous sale is handled:

  • extend - Any remaining time from previous sale is added to the initial period of the new subscription. This is also how the remaining time is handled if the “upgradeOption” parameter is not specified.

  • lost - Any remaining time from previous sale is ignored/lost.

Constructing the Upgrade request

The “upgrade” request is used to redirect buyer to the Verotel Order Page in order to process superseding subscription with a given amount, duration and currency.

The upgrade request is like the startorder request but the type needs to be “upgradesubscription” and there is mandatory precedingSaleID parameter.

Please note that referenceID parameter is not accepted in the upgrade request. If referenceID was supplied initially in the startorder of the preceding subscription, it is copied over to the new upgraded subscription.

HTTP request

Verotel

GET https://secure.verotel.com/startorder?

CardBilling

GET https://secure.billing.creditcard/startorder?

GayCharge

GET https://secure.gaycharge.com/startorder?

YoursafeDirect

GET https://secure.yoursafedirect.com/startorder?

NOTE: only EUR is can be used for DDEU payment method system | NOTE: DDEU and YOURSAFE_DIRECT only support one-time | NOTE: DDEU is available only in DE, AT, CH, BE, IT, NL, ES and FR If oneClickToken is sent, the payment method must be set to CC | NOTE: email is excluded from signature calculations (max 100 chars else will be ignored) |

$brand = Verotel\FlexPay\Brand::create_from_merchant_id(/* Your customer ID */ '9804000000000000');

$flexpayClient = new Verotel\FlexPay\Client(/* shop ID */ 12345, "FlexPay Signature Key", $brand);

$upgradeSubscriptionURL = $flexpayClient->get_upgrade_subscription_URL([
    "period" => 'P30D',
    "name" => 'Upgrade to one year subscription'
    "precedingSaleID" => 123456,
    "priceAmount" => 20,
    "priceCurrency" => 'USD',
    "period" => 'P1Y',
    "upgradeOption" => 'extend',
]);

Sends this request from your browser to the selected host. The reference does not publish a sandbox host.

GET/startorder

Query parameters

versionnumberrequired

version version of the FlexPay call, 4 for this version

shopIDnumberrequired

numerical ID of the website in the Verotel system

typestringrequired

upgradesubscription

precedingSaleIDnumberrequired

Identificator of sale the buyer is upgrading from

priceAmountnumberrequired

amount to be processed in nnn.nn format

priceCurrencystringrequired
  • priceCurrency 3 char ISO code, must be one of the Sale currencies (USD EUR GBP AUD CAD CHF DKK NOK SEK)
  • NOTE: only EUR is can be used for DDEU payment method system
periodstringrequired

duration in ISO8601 format, for example: P30D, minimum is 7 days for recurring and 2 days for on-time

subscriptionTypestringrequired
  • one-time or recurring
  • NOTE: DDEU and YOURSAFE_DIRECT only support one-time
namestring

description of the product. Text is displayed on the order page - max 100 printable characters

upgradeOptionstring

lost or extend - – this option defines how to deal with the remaining period from the previous sale, if not provided the remaining period is added to new sale (“same as “extend”)

paymentMethodstring
  • payment method, CC, YOURSAFE_DIRECT, DDEU (if not set then buyers can choose from available payment methods)
  • NOTE: DDEU is available only in DE, AT, CH, BE, IT, NL, ES and FR
  • If oneClickToken is sent, the payment method must be set to CC
custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

successURLstring

URL for redirect after successful transaction - max 255 characters. Defaults to success landing URL on the website.

emailstring
  • email of the buyer. If not set, it will be collected on the Order Page
  • NOTE: email is excluded from signature calculations (max 100 chars else will be ignored)
signaturestringrequired

Signature calculation

trialAmountnumber

amount to be processed (max 2 decimal places, stripped zeroes) for the initial trial period

trialPeriodstring

duration in ISO8601 format

GET https://example.com/success
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=initial
    &referenceID=order-1001
    &saleID=123456
    &priceAmount=9.99
    &priceCurrency=USD
    &period=P30D
    &trialAmount=5.00
    &trialPeriod=P7D
    &expiresOn or nextChargeOn=value
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &paymentMethod=CC
    &signature=abcdef0123456789abcdef0123456789abcdef01
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

one-time or recurring

eventstring

initial

referenceIDstring

merchant reference identifier. It must be unique if provided

saleIDnumber

identifier of the sale in the Verotel system

priceAmountnumber

amount to be processed in nnn.nn format

priceCurrencystring

3 char ISO code of the Sale currency

periodstring

subscription duration in ISO8601 format

trialAmountnumber

amount to be processed (max 2 decimal places, stripped zeroes) for the initial trial period

trialPeriodstring

duration in ISO8601 format

expiresOn or nextChargeOnstring

date of next rebill or expiry date [yyyy-mm-dd] eq. “2015-04-24”

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

paymentMethodstring

payment method, CC, YOURSAFE_DIRECT, DDEU

signaturestring

Signature calculation

Upgrade postback

Upgrade postback call is sent to the merchant’s postback URL when the subscription is switched from one plan to another. The postback is sent instead of the Successful sale postbacks when the new subscription the buyer is switching to is successfully created and the previous subscription is terminated in Verotel system (No Expiry postback is sent). See “FlexPay API Upgrade” document for more details.

GET https://example.com/postback
    ?shopID=12345
    &type=subscription
    &subscriptionType=recurring
    &event=upgrade
    &referenceID=order-1001
    &saleID=123456
    &transactionID=987654
    &precededBySaleID=123450
    &priceAmount=9.99
    &priceCurrency=USD
    &period=P30D
    &expiresOn or nextChargeOn=value
    &custom1=xxyyzz
    &custom2=custom-2
    &custom3=custom-3
    &paymentMethod=CC
    &signature=abcdef0123456789abcdef0123456789abcdef01
    &truncatedPAN=411111******1111
    &CCBrand=VISA
GETPostback

Your endpoint receives this call.

Query parameters

shopIDnumber

numerical ID of the website in the Verotel system

typestring

subscription

subscriptionTypestring

one-time or recurring

eventstring

upgrade

referenceIDstring

merchant reference identifier if provided in the first sale.

saleIDnumber

identifier of the sale in the Verotel system

transactionIDnumber

identifier of the transaction in the Verotel system (only avaible for postbacks version 2)

precededBySaleIDnumber

Identifier of the previous sale the enduser is switching from

priceAmountnumber

amount to be processed in nnn.nn format

priceCurrencystring

3 char ISO code of the Sale currency

periodstring

subscription duration in ISO8601 format

expiresOn or nextChargeOnstring

date of next rebill or expiry date [yyyy-mm-dd] eq. “2015-04-24”

custom1string

pass-through variable - max 255 printable characters

custom2string

pass-through variable - max 255 printable characters

custom3string

pass-through variable - max 255 printable characters

paymentMethodstring

payment method, CC, YOURSAFE_DIRECT, DDEU

signaturestring

Signature calculation

truncatedPANstring

Truncated (masked) payment instrument identification, e.g. card number

CCBrandstring

Only present if paid via Credit Card, represents the card brand, e.g. VISA

Signature calculation

Examples are for Verotel FlexPay PHP client library

Examples are for FlexPay Java client library

If you are using one of our client libraries, signature calculation is handled by the library.

The signature used in FlexPay requests and postbacks is calculated as SHA-256 hash (hexadecimal output) from the request parameters.

The first parameter has to be your signatureKey, followed by the parameters ordered alphabetically by their names.

Optional arguments that are used (have value) must be contained in the signature calculation. Optional arguments that are not used must not be contained in the signature calculation.

The email parameter in “startorder” request is not included in the signature calculations.

It is mandatory to convert arguments values into UTF-8 before computing the signature.

$brand = Verotel\FlexPay\Brand::create_from_merchant_id(/* Your customer ID */ '9804000000000000');

$flexpayClient = new Verotel\FlexPay\Client(/* shop ID */ 12345, "FlexPay Signature Key", $brand);

$computed_signature = $flexpayClient->get_signature([
    'description' => 'Super video download',
    'priceAmount' => '9.99',
    'priceCurrency' => 'USD',
    'shopID' => 12345,
    'version' => 4,
]);

Example calculation

Parameter Value
(signatureKey) BddJxtUBkDgFB9kj7Zwguxde4gAqha
description Super video download
priceAmount 9.99
priceCurrency USD
custom1 xxyyzz
shopID 64233
type purchase
version 4
Formula
signature = sha256_hex(BddJxtUBkDgFB9kj7Zwguxde4gAqha:custom1=xxyyzz:description=Super video download:priceAmount=9.99:priceCurrency=USD:shopID=64233:type=purchase:version=4) => ccaf2357fe330654322a1b0f3f92984b3fe2a1462d6fc5082650a00c5ada2f2a
HTTP
https://secure.verotel.com/startorder?custom1=xxyyzz&description=Super+video+download&priceAmount=9.99&priceCurrency=USD&shopID=64233&type=purchase&version=4&signature=ccaf2357fe330654322a1b0f3f92984b3fe2a1462d6fc5082650a00c5ada2f2a

Payment processor

Processor name Allowed payment method Base URL
VerotelCCDDEUhttps://secure.verotel.com/
CardBillingCChttps://secure.billing.creditcard/
GayChargeCCDDEUhttps://secure.gaycharge.com/
YoursafeDirectDDEUYOURSAFE_DIRECThttps://secure.yoursafedirect.com/