Retrieve subscription payment information
Use the getSubscriptionPaymentInformation method to retrieve information related to the payment made for a subscription.
Request parameters
sessionID
Required (String)
Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes.
subscriptionReference
Required (string)
The reference of the subscription you want to retrieve payment information for.
Request sample
<?php
require ('PATH_TO_AUTH');
$subscriptionReference = "Subscription_Code";
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getSubscriptionPaymentInformation';
$jsonRpcRequest->params = array($sessionID, $subscriptionReference);
$jsonRpcRequest->id = $i++;
$paymentInformation = callRPC($jsonRpcRequest, $host);
var_dump($paymentInformation);Response parameters
Type
String
Payment method type.
Currency
String
ISO code of the order currency.
PaymentMethod
Object
PaymentMethod.FirstDigits
String
First 4 digits of the card used on the order.
PaymentMethod.LastDigits
String
Last 4 digits of the card used on the order.
PaymentMethod.CardType
String
ype of card used on the order.
PaymentMethod.ExpirationMonth
String
Card expiration month.
PaymentMethod.ExpirationYear
String
Card expiration year.
PaymentMethod.CardUpdated
Boolean
The card updated by our internal account updater.
PaymentMethod.Authorize3DSUrl
String
URL address to which customers are redirected after the 3DS details get validated by the bank and the order is successfully authorized.
Response sample
Last updated
Was this helpful?