Page MenuHomeDatingVIP

Search
Updated 2,664 Days AgoPublic

payment_subscriptions.search

Description

Search for user's subscription

NOTE: Search can be performed against any of the DVIP CS urls
staging: https://cs-m1.dvipdev.com/
production: https://cs-m1.dvipapp.com/
query: /api.json?cmd=payment_subscriptions.search&//input1//=some_value&//input2//=some_other_vaule
Input Parameters
NameTypeRequiredDescription
emailstringNo (at least 2*)User's email address
usernamestringNo (at least 2*)Username used to register with DatingVIP website
ccnamestringNo (at least 2*)First name + Last name on credit card
ccnumstringNo (at least 2*)Last four digits of credit card number

*Required are at least 2 parameters of above mentioned ones, except username+ccname

NOTE: username+ccnum is allowed, but limited
NOTE: username+ccname is not allowed

About search against username+ccnum
To perform search we must first find user by his username. Since we have 100+ systems with 100+ databases, full scale solution would require brute force over every single system(database), which is, obviously, too much. We discussed possible ways to make this happen somehow .. and since there are only partner websites(with merchant overrides) on m1 and a41(for now), we can make username+ccnum work on small number of systems - m1, a41 by default. As number of partner websites spreads over systems, at some point results will be incomplete. So, bottom line is, email is preferable, since there is no easy way to implement this kind of search that would completely support growth of partner websites across systems, but there are special cases - lower number of systems used - that are covered.
So, to allow at least some useful username+ccnum search in some cases, we have one more optional parameter, it is only relevant for username+ccnum.

Optional Input Parameters
NameTypeRequiredDescriptionDefault value
systemsstringNo(optional)Comma separated list of systems on which to perform search against usernamem1,a41

This parameter allows to define systems that will be used to search for user by username - if not passed defaults to m1,a41 - mainstream, porn2 - where partner websites(with merchant overrides) exist at the moment. Of course, if number of used systems grows over some max value, search will fail. When number of used systems grows, we can just add more systems to default, or execute api call with appropriate systems passed, but up to some reasonable number of systems.

Return

Returns array of subscription data grouped by it's status on DVIP, where status is:

StatusDescription
-1Subscription is canceled - User is premium, at current cycle end won't be rebilled and will drop to free
0Subscription is stopped - Subscriptions that expired
1Subscription is active - User is premium, at current cycle end will be rebilled
Subscription fields
NameTypeDescriptionNoteImportant
sub_idintSubscription IDpayment_subscription.edit
rebill_countintHow many times subscription was rebilled
statusstringDVIP Payment statusDon't mix this with subscription status on DVIP(-1,0,1)
next_rebill_amountfloatAmount to be used for next rebill only
item_idintItem IDpayment_subscription.cancel
order_idintOrder ID
amountfloatAmount to be used for all rebills (except for next)
trial_amountfloatOriginal trial amount
trial_unitstringUnits of trial duration(month, day, etc.)
trial_periodintNumber of units of trial duration
rebill_unitstringUnits of rebill cycle(month, day, .etc)
rebill_periodintNumber of units for rebill cycle duration
max_rebill_countintHow many times subscription will rebill
descriptionstringWhat user paid and how much
user_idintDVIP User ID
transactionsarrayArray of transactions dataDescribed in table bellow
usernamestringUsername
site_domainstringDomain of the DVIP website where user is registered
site_namestringName of the DVIP website where user is registered
system_idstringDVIP System IDpayment_subscriptions.cancel payment_subscriptions.edit
descriptorstringWhat credit card statement was billed as
site_idintDVIP Website ID
date_startintTimestamp of date subscription started
date_stopintTimestamp of date subscription was stoppedIrrelevant for not stopped(0) subscriptions
date_cancelintTimestamp of date subscription was canceledIrrelevant for active(1) subscriptions
date_rebillintTimestamp of date subscription will rebill, if status is active(1), Timestamp of date subscription will expire, if status is canceled(-1)Irrelevant for stopped(0) subscriptions
Transaction fields
NameTypeDescription
tran_idintTransaction ID
transaction_typeintTransaction Type ('S' for sale, 'A' for auth, 'R' for refund)
amountfloatTransaction Amount
currencystringTransaction currency
descriptionstring Transaction Description
statusstringStatus (successful|failed|init)
refunded_tran_idintRefunded transaction ID (if transaction is refund)
refundedintIs transaction refunded
refunded_amountfloatRefunded Amount
ccnumstringCredit Card Number
ccnamestringCredit Card Name
ccxpdatestringCredit Card Expired Date
cctypestringCredit Card Type (I.e. visa)
cccountrystringCredit Card Country
processorstringPayment Processor short name (NB, RG ...)
processor_namestringPayment Processor full name (NetBilling, Rocket Gate, ...)
datestringTransaction Date (unix timestamp)
Usage Example

example url:

/api.json?cmd=payment_subscriptions.search&email=knotiaw71@yahoo.com&ccnum=0474
/api.json?cmd=payment_subscriptions.search&email=knotiaw71@yahoo.com&ccname=Knotia Wilson

example of subscription found:

{
  "meta": {
    "status": "OK"
  },
  "result": {
    "data": {
      "1": [
        {
          "sub_id": "1267827",
          "rebill_count": 1,
          "status": "rebill",
          "next_rebill_amount": "29.99",
          "item_id": "2671757",
          "order_id": "2635889",
          "amount": "29.99",
          "trial_amount": "4.99",
          "trial_unit": "day",
          "trial_period": "5",
          "rebill_unit": "month",
          "rebill_period": "1",
          "max_rebill_count": "-1",
          "description": "$4.99 5 day trial rebills at $29.99\/month",
          "user_id": "7967584",
          "transactions": [
            {
              "tran_id": "6675677",
              "amount": "29.99",
              "currency": "USD",
              "status": "successful",
              "refunded_tran_id": "0",
              "refunded": 0,
              "refunded_amount": 0,
              "ccnum": "474472xxxxxx0474",
              "ccname": "Knotia Wilson",
              "ccxpdate": "2019-05-01",
              "cctype": "visa",
              "cccountry": "US",
              "processor": "RG",
              "processor_name": "RocketGate"
            },
            {
              "tran_id": "6639402",
              "amount": "29.99",
              "currency": "USD",
              "status": "failed",
              "refunded_tran_id": "0",
              "refunded": 0,
              "refunded_amount": 0,
              "ccnum": "474472xxxxxx0474",
              "ccname": "Knotia Wilson",
              "ccxpdate": "2019-05-01",
              "cctype": "visa",
              "cccountry": "US",
              "processor": "RG",
              "processor_name": "RocketGate"
            },
            {
              "tran_id": "6596588",
              "amount": "4.99",
              "currency": "USD",
              "status": "successful",
              "refunded_tran_id": "0",
              "refunded": 0,
              "refunded_amount": 0,
              "ccnum": "474472xxxxxx0474",
              "ccname": "Knotia Wilson",
              "ccxpdate": "2019-05-01",
              "cctype": "visa",
              "cccountry": "US",
              "processor": "RG",
              "processor_name": "RocketGate"
            }
          ],
          "username": "knotiaw71",
          "site_domain": "www.bbwtoday.com",
          "site_name": "BBW Today",
          "system_id": "m1",
          "descriptor": "DATINGCUSTSERV.COM 866-294-5787",
          "site_id": "5017",
          "date_start": "1459301206",
          "date_stop": "",
          "date_cancel": "",
          "date_rebill": "1462325204"
        }
      ]
    },
    "id": 0
  }
}

example of failure response:

{
  "meta": {
    "errors": [
      {
        "code": "sub_not_found",
        "params": null,
        "sticky": false,
        "text": "No subscription found"
      }
    ],
    "status": "ERROR"
  },
  "result": {
    "data": false,
    "id": 0
  }
}
Last Author
boris
Last Edited
Jan 6 2017, 08:34

Event Timeline

boris edited the content of this document. (Show Details)
boris shifted this object from the Restricted Space space to the S6 Everyone space.Aug 8 2018, 08:12