Update a subscription
**PUT **
https://api.okepay.info/v1.0/Subscription/id
PHP
// $instanceName is a part of the url where you access your okepay installation.
// https://{$instanceName}.okepay.info
$instanceName = 'YOUR_INSTANCE_NAME';
// $secret is the okepay secret for the communication between the applications
// if you think someone got your secret, just regenerate it in the okepay administration
$secret = 'YOUR_SECRET';
$okepay = new \Okepay\Okepay($instanceName, $secret);
$subscription = new \Okepay\Models\Request\Subscription();
$subscription->setId(1);
$subscription->setAmount(500);
$subscription->setCurrency('CHF');
try {
$response = $okepay->update($subscription);
var_dump($response);
} catch (\Okepay\OkepayException $e) {
print $e->getMessage();
}
PATH PARAMS | |
---|---|
id int32 |
REQUIRED The id of the subscription to retrieve. |
QUERY PARAMS | |
---|---|
instance string |
REQUIRED Your OkePay instance name |
BODY PARAMS | |
---|---|
amount string |
The new amount in cents which will be payed on the next payment interval |
currency string |
The ISO code of the currency of the payment. |
purpose string |
The purpose of the payment |
Experimental documentation state
This functionality is already in productional use, but the documentation might contain some errors. Please contact us if you are interested in handling Subscriptions though your own application
Next to read:
Remove a subscription
Remove a subscription