Page MenuHomeDatingVIP

Refund & Stop
Updated 2,578 Days AgoPublic

payment_subscriptions.refund-stop

Description

Stops user's subscription and refunds transaction. User will be demoted to free access.

IMPORTANT: Refund-stop must be performed against appropriate system's url(system_id, retrieved by payment_subscriptions.search)
if system_id == m21
staging: https://cs-m21.dvipdev.com/
production: https://cs-m21.dvipapp.com/
Input Parameters
NameTypeRequiredDescriptionNote
sub_idintYesSubscription IDSubscription that will be stopped
tran_idintYesTransaction IDTransaction that will be refunded
pp_typestringNoPayment Processor TypeIf not passed will be retrieved from subscription/transaction payment data
Return
NameTypeDescriptionNote
successboolIs subscription stopped and is transaction refunded?Checks state for both transaction and subscription - returns true if transaction is refunded and subscription is stopped - also true if transaction was refunded before, and/or subscription stoppped before.
refundedboolIs transaction refunded?Checks transaction state - true if transaction is(or already was) refunded
stoppedboolIs subscription stopped?Checks subscription state - true if subscription is(or already was) stopped
Usage Example

example query:

/api.json?cmd=payment_subscriptions.refund-stop&tran_id=117303&sub_id=14624&pp_type=RG

example of successful execution:

{
  "meta": {
    "messages": [
      {
        "code": "refund_success",
        "params": null,
        "sticky": false,
        "text": "refund_success"
      }
    ],
    "status": "OK"
  },
  "result": {
    "success": true,
    "refunded": true,
    "stopped": true,
    "id": 0,
    "data": [
      
    ],
    "item": [
      
    ]
  }
}

Example of repeated call after successful one:

{
  "meta": {
    "errors": [
      {
        "code": "614: [102] Cannot Credit - A credit operation cannot be performed because the original transaction has already been voided, credited, or has not been settled.",
        "params": null,
        "sticky": false,
        "text": "614: [102] Cannot Credit - A credit operation cannot be performed because the original transaction has already been voided, credited, or has not been settled."
      },
      {
        "code": "refund_failed",
        "params": null,
        "sticky": false,
        "text": "refund_failed"
      }
    ],
    "messages": [
      {
        "code": "err_sub_stopped_canceled",
        "params": null,
        "sticky": false,
        "text": "err_sub_stopped_canceled"
      }
    ],
    "status": "ERROR"
  },
  "result": {
    "success": true,
    "refunded": true,
    "stopped": true,
    "id": 0,
    "data": [
      
    ],
    "item": [
      
    ]
  }
}

Example of failed execution(refund failed - transaction is not refunded), subscription stopped successfully

{
  "meta": {
    "errors": [
      {
        "code": "820: Can't find matching transaction",
        "params": null,
        "sticky": false,
        "text": "820: Can't find matching transaction"
      },
      {
        "code": "refund_failed",
        "params": null,
        "sticky": false,
        "text": "refund_failed"
      }
    ],
    "status": "ERROR"
  },
  "result": {
    "success": false,
    "refunded": false,
    "stopped": true,
    "id": 0,
    "data": [
      
    ],
    "item": [
      
    ]
  }
}
Last Author
asimic
Last Edited
Apr 4 2017, 09:55

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