Page MenuHomeDatingVIP

subscription.get
Updated 1,155 Days AgoPublic

subscription.get

Description

Return subscription details by ID

Input Parameters
NameTypeRequiredDescription
idintYessubscription ID

Return

array with data
Note:next_rebill_amount and next_rebill_shcedule will be empty shortly after transaction.finish (create) commands. They will contain data once subscription got scheduled by our background tasks to be re-billed

Subscriptions possible statuses are:
initial - new created subscription
trial - new created subscription with trial_amount defined
rebill - successfully re-billed subscription (can be re-activated)
manual - new with rebill_period = -1
changed - after subscription.change when sub status was different than 'stopped'
suspended - suspended by rebill script (few possible reasons)
stopped - cancelled by api call (or no recurring processor type like Dc24)
completed - when max_rebill_count reached (max rebills for item)

Usage Example
<?php

$curl = new \Dinke\CurlHttpClient;

//setup payment url and timeout
$payment_url = 'https://dev-payment.datingvip.com/api.json';
$timeout 	= 30;

$curl->setCredentials('some-token', 'some-pass');

$post_data = array(
	'cmd'	=> 'subscription.get',
	'data'	=> array('id' => 258)
);

$response = $curl->sendPostData($payment_url, $post_data, null, $timeout);
if($response === false)
{
	//handle errors
}

//decode json to get array
$response = json_decode($response, true);
var_dump($response);

Excepted output after running this script should be:

array (size=1)
  'result' => 
    array (size=8)
      'code' => int 700
      'status' => string 'Action completed succesfully' (length=28)
      'command' => string 'subscription.get' (length=17)
      'result' => 
        array (size=1)
            array (size=48)
              'sub_id' => string '258' (length=3)
              'next_rebill_shcedule' => string '0' (length=1)
              'rebill_count' => string '0' (length=1)
              'status' => string 'trial' (length=5)
              'date' => string '1429201466' (length=10)
              'end_date' => string '0' (length=1)
              'next_rebill_amount' => string '0.00' (length=4)
              'item_id' => string '20544' (length=5)
              'order_id' => string '545' (length=3)
              'amount' => string '39.99' (length=5)
              'trial_amount' => string '39.99' (length=5)
              'trial_unit' => string 'day' (length=3)
              'trial_period' => string '90' (length=2)
              'rebill_unit' => string 'day' (length=3)
              'rebill_period' => string '90' (length=2)
              'max_rebill_count' => string '-1' (length=2)
              'description' => string '3 месяца - $13.33USD/месяц||7882' (length=43)
              'tracking_item' => string '0' (length=1)
              'uprc_id' => string '0' (length=1)
              'ptnr_id' => string '55' (length=2)
              'user_id' => string '435' (length=3)
              'pp_id' => string '6' (length=1)
              'ppac_id' => string '109' (length=3)
              'force_mid' => string '' (length=0)
              'ccdt_id' => string '393' (length=3)
              'tracking_order' => string '0' (length=1)
              'tracking_tag' => string '512' (length=3)
              'first_name' => string 'Nerty' (length=5)
              'last_name' => string 'Ben' (length=3)
              'street' => string '' (length=0)
              'city' => string '' (length=0)
              'state' => string 'dev' (length=3)
              'zipcode' => string '10001' (length=5)
              'country' => string 'US' (length=2)
              'email' => string 'yuliapaid@gmail.com' (length=19)
              'ip' => string '66.154.2.78' (length=11)
              'host' => string '66.154.2.78' (length=11)
              'currency' => string 'USD' (length=3)
              'hash' => string '14292014665482f2015ee30f487cf670' (length=32)
              'rebill_transaction_id' => string '1980' (length=4)
              'order_status' => string 'completed' (length=9)
              'ts' => string '1429201466' (length=10)
              'type' => string 'basic' (length=5)
              'step_down' => string '0' (length=1)
              'tax_rate' => string '0.00' (length=4)
              'tax_amount' => string '0.00' (length=4)
              'tracking_user' => string '10166584' (length=8)
              'processor' => string 'RG' (length=2)
      'request' => 
        array (size=4)
          'cmd' => string 'subscription.get' (length=17)
          'data' => 
            array (size=1)
              'id' => string '258' (length=3)
          'token' => string 'some-token' (length=26)
          'pass' => string 'some-pass' (length=32)
      'ts' => int 1429562553
      'origin_ip' => string '93.87.220.184' (length=13)
      'errors' => null
Last Author
aplawecki
Last Edited
Feb 26 2021, 09:46