Skip to main content

Retrieve a price option group

Overview

Use the getPriceOptionGroup method to extract information about a specific price option group that you configured.

Parameters

Parameters Type/Description

ProductGroup

Object

Details below.

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.

groupCode

Required (string)

 

The code that the 2Checkout system generated or that you set for the product pricing options group.

Response

Parameters Type/Description

PriceOptionGroup

Array of objects

Request

<?php

require ('PATH_TO_AUTH');

$groupCode = 'USERS';

try {
    $existentPriceOptionGroup = $client->getPriceOptionGroup($sessionID, $groupCode);
}

catch (SoapFault $e) {
    echo "existentPriceOptionGroup: " . $e->getMessage();
    exit;
}

var_dump("existentPriceOptionGroup", $existentPriceOptionGroup);

?>

 

Retrieve information on promotions

Overview

Use the searchPromotions method to extract information on promotions you set up for your account.

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.

Types

StringArray

 

Discount type:

  • REGULAR
  • GLOBAL
  • RENEWAL

Channel

String

 

Channel:

  • ECOMMERCE
  • CHANNEL_MANAGER
  • ALL

ProductCode

String

 

Unique code that you set for each of your products.

Limit

Int

 

Number of results returned by the method.

Page

Int

 

Results pagination.

Response

Promotion

Array of objects

Request

<?php

$host   = "https://api.2checkout.com";
$client = new SoapClient($host . "/soap/3.0/?wsdl", array(
    'location' => $host . "/soap/3.0/",
    "stream_context" => stream_context_create(array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    ))
));


function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}

$merchantCode = "YOURCODE123"; //your account's merchant code available in the 'System settings' area of the cPanel: https://secure.2checkout.com/cpanel/account_settings.php
$key          = "SECRET_KEY"; //your account's secret key available in the 'System settings' area of the cPanel: https://secure.2checkout.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')

$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);

try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}

catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}

$SearchOptions              = new stdClass();
$SearchOptions->Types       = array();
$SearchOptions->Types[0]    = 'REGULAR';
$SearchOptions->Types[1]    = 'RENEWAL';
$SearchOptions->Channel     = 'ECOMMERCE';
$SearchOptions->ProductCode = 'my_subscription_1';
$SearchOptions->Limit       = 10;
$SearchOptions->Page        = 1;


try {
    $Discounts = $client->searchPromotions($sessionID, $SearchOptions);
}

catch (SoapFault $e) {
    echo "Discounts: " . $e->getMessage();
    exit;
}

var_dump("Discounts", $Discounts);


?>

 

Disable recurring billing

Overview

Use the disableRecurringBilling method to disable recurring billing for a subscription. When you disable recurring billing, the subscription status doesn’t change. Users continue to use subscriptions with recurring billing disabled until they expire, and Avangate provides them with the option to renew their subscription through manual payments.

Parameters

Parameters Type/Description

Parameters

Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

subscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

Response

Parameters Type/Description

Boolean

true or false depending on whether the changes were successful or not.

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';

$jsonRpcRequest = array (
'method' => 'disableRecurringBilling',
'params' => array($sessionID, $subscriptionReference),
'id' => $i++,
'jsonrpc' => '2.0');

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Add/Import subscriptions with credit/debit data

Overview

Include payment (credit/debit card) information that Avangate uses for recurring billing to renew imported subscriptions. Importing subscriptions with payment data is available only to eligible Avangate accounts. Contact Avangate directly for additional details.

Use the addSubscription method to import a subscription into the Avangate system.

Parameters

Parameters

Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

Subscription import

Required (Object)

 

Object designed to provide Avangate with all the information to create a subscription.

CardPayment

Optional (Object)

 

Object containing card details.

Response

SubscriptionReference

String

 

Unique, system-generated subscription identifier.

Request


<?php
$host   = "https://api.avangate.com";
$client = new SoapClient($host . "/soap/4.0/?wsdl", array(
    'location' => $host . "/soap/4.0/",
    "stream_context" => stream_context_create(array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    ))
));

function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
$merchantCode = "YOUR_MERCHANT_CODE";// your account's merchant code available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$key = "YOUR_SECRET_KEY";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);
try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}
catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}
$Product = new stdClass ();
$Product->ProductCode = 'my_subscription_1';
$Product->ProductId = 4639321;
$Product->ProductName = 'Avangate Subscription Imported';
$Product->ProductVersion = 1.0;
$Product->ProductQuantity = 3;
$Product->PriceOptionCodes = array();
$EndUser = new stdClass ();
$EndUser->Address1 = 'Address line 1';
$EndUser->Address2 = 'Address line 2';
$EndUser->City = 'LA';
$EndUser->Company = 'Company Name';
$EndUser->CountryCode = "US";
$EndUser->Email = 'customerAPI@avangate.com';
$EndUser->FirstName = 'Customer';
$EndUser->Language = 'en';
$EndUser->LastName = 'Avangate';
$EndUser->Phone = '1234567890';
$EndUser->State = 'California';
$EndUser->Fax = NULL;
$EndUser->Zip = '90210';
$Subscription = new stdClass();
$Subscription->ExternalSubscriptionReference = '12345678912ImportedSubscription';
$Subscription->SubscriptionCode= NULL;
$Subscription->StartDate = '2013-01-01';
$Subscription->ExpirationDate = '2017-12-30';
$Subscription->Product = $Product;
$Subscription->EndUser = $EndUser;
$Subscription->ExternalCustomerReference = '12354678ExtCustRef';
$PaymentCard = new stdClass ();
$PaymentCard->CardNumber = '4111111111111111' ;
$PaymentCard->CardType = 'VISA';
$PaymentCard->ExpirationYear = '2018';
$PaymentCard->ExpirationMonth = '12';
$PaymentCard->CCID = '123';
$PaymentCard->HolderName = 'John Doe';
$PaymentCard->HolderNameTime = '15';
$PaymentCard->CardNumberTime = '15';
$PaymentCard->AutoRenewal = true;
try {
    $importedSubscriptionWithPayData = $client->addSubscription($sessionID, $Subscription, $PaymentCard);
}
catch (SoapFault $e) {
    echo "importedSubscriptionWithPayData: " . $e->getMessage();
    exit;
}
var_dump("importedSubscriptionWithPayData", $importedSubscriptionWithPayData);

Retrieve a pricing configuration by name

Overview

Use the getPricingConfigurationByName method to extract information on a specific pricing configuration you set for a product.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

productCode

Required (string)

 

The editable code that you control at product-level, not the unique, system-generated product ID.

pricingConfigurationName

Required (string)

 

The name of the pricing configuration.

schemaType

Required (string)

 

  • FLAT (without Base Price)
  • DYNAMIC (with Base Price)

priceType

Optional (string)

 

Possible values: NET or GROSS

Response

Parameters Type/Description

PricingConfiguration

Object

Request

<?php

require ('PATH_TO_AUTH');

$productCode = 'subscr1';
$pricingConfigurationName = 'EU prices';
$schemaType = 'DYNAMIC';// FLAT or DYNAMIC
$priceType = 'NET'; // or GROSS

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getPricingConfigurationByName',
'params' => array($sessionID, $productCode, $pricingConfigurationName, $schemaType, $priceType)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));

?>

Retrieve product by code

Overview

Use getProductByCode to extract product information using the unique identifier you assign to subscription plans/products.  

Parameters

Parameters Type/Description

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.

ProductCode

String

 

The product code that you control.

Response

Parameters Type/Description
Product Object

Request

<?php

require ('PATH_TO_AUTH');

$ProductCode = "subscr1";

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getProductByCode',
'params' => array($sessionID, $ProductCode)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

?>

Retrieve upgrade price

Overview

Use the getProductUpgradeOptionsPrice method to retrieve information about the costs a customer incurs when upgrading a specific subscription. Retrieve information about the costs a customer incurs when upgrading a specific subscription.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

subscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

productCode

Required (string)

 

Unique identifier of the target product for the subscription upgrade process. You control the product code and can set it up in the Control Panel.

currency

Required (string)

 

ISO 4217 code.

options

Required (string)

 

Pricing options of the target product for the subscription upgrade process.

 

String - ';' separated list of 'OptionValue' returned by getProductUpgradeOptions function.

If the pricing options groups is "scale" (interval), the Options parameter should be sent like this: [option group unique code] + "=" + value

e.g. Users=7

Response

Parameters Type/Description

UpgradePrice

Object

    Details below.
  BillingPrice Int
    Net billing price available for  the upgrade process.
  BillingGrossPrice Int
    Gross billing price available for  the upgrade process.
  BillingCurrency String
    Billing currency available for the upgrade process.
  Quantity String
    Quantity available for the upgrade process.
  DisplayPrice Int
    Net display price available for the upgrade process.
  DisplayGrossPrice Int
    Gross display price available for the upgrade process.
  DisplayCurrency String
    Display currency available for the upgrade process.
  Discount Float
    Applied discounts
  DiscountedProratedPrice Float
    Prorated net price for the upgrade with applied discounts
  DiscountedProratedGrossPrice Float
    Prorated gross price for the upgrade with applied discounts
  DiscountedBillingPrice     Float
    Net billing price available for  the upgrade process with applied discounts
  DiscountedBillingGrossPrice     Float
    Gross billing price available for  the upgrade process with applied discounts
  DisplayDiscount     Float
    Discount displayed for the upgrade process
  DiscountedDisplayPrice     Float
    Net display price available for the upgrade process with applied discounts
  DiscountedDisplayGrossPrice     Float
    Gross display price available for the upgrade process with applied discounts

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';
$productCode = 'my_subscription_123';
$currency = 'usd';
$options = 'emailsupport;oneuser1';

try {
    $upgradeOptions = $client->getProductUpgradeOptionsPrice($sessionID, $subscriptionReference, $productCode, $currency, $options);
}
catch (SoapFault $e) {
    echo "upgradeOptions: " . $e->getMessage();
    exit;
}
var_dump("upgradeOptions", $upgradeOptions);

Upgrade subscription

Overview

Use the setSubscriptionUpgrade method to upgrade a subscription.

Requirements

You can only upgrade subscriptions with automatic renewal enabled.

Parameters

Parameters Type/Description

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)

 

Unique, system-generated subscription identifier.

productCode

Required (string)

 

Unique identifier of the target product for the subscription upgrade process. You control the product code and can set it up in the Control Panel.

options

Optional (string)

 

Pricing options of the target product for the subscription upgrade process.

 

String - ';' separated list of 'OptionValue' returned by getProductUpgradeOptions function.

If the pricing options groups is "scale" (interval), the Options parameter should be sent like this: [option group unique code] + "=" + value

e.g. Users=7

customPrice

Optional (string)

 

The price you want to charge customers for the upgrade. The currency used by default is the same as in the previous payment customers made.

Response

Parameters Type/Description

Boolean

true or false depending on whether or not the operation succeeded.

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'BE14FDCF37';
$ProductCode = 'my_subscription_123';
$Options = 'emailsupport;oneuser1';//case sensitive; include only price options codes (exclude spaces)
$customPrice = 1;

try {
    $upgradedSubscriptions = $client->setSubscriptionUpgrade($sessionID, $subscriptionReference, $ProductCode, $Options, $customPrice);
}
catch (SoapFault $e) {
    echo "upgradedSubscriptions: " . $e->getMessage();
    exit;
}
var_dump("upgradedSubscriptions", $upgradedSubscriptions);

 

Retrieve orders without partner invoice

Overview

Use this method to list all orders that have yet to be included in a partner invoice.

Requirements

This method requires you to set a specific partner using setPartner.

Parameters

Parameters Type/Description
sessionID Required (String)
  Session identifier, output of the Login method. An exception is thrown if the values are incorrect.

Response parameters

Parameters Type/Description
Order information Object

Request Sample

<?php

require ('PATH_TO_AUTH');  // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/02Authentication
require ('PATH_TO_SET_PARTNER'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/06Reference/Partner/00Set_partner

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getOrdersWithoutProforma',
'params' => array($sessionID)
);
var_dump (callRPC((Object)$jsonRpcRequest,$host));

Response sample

{
    "RefNo": "112579424",
    "OrderNo": 3167,
    "ExternalReference": null,
    "ShopperRefNo": null,
    "Status": "PENDING",
    "ApproveStatus": "WAITING",
    "VendorApproveStatus": "OK",
    "MerchantCode": "CHAOSGRO",
    "Language": "en",
    "OrderDate": "2020-01-17 12:53:47",
    "FinishDate": null,
    "Source": null,
    "AffiliateSource": null,
    "AffiliateId": null,
    "AffiliateName": null,
    "AffiliateUrl": null,
    "RecurringEnabled": false,
    "HasShipping": false,
    "BillingDetails": {
        "FiscalCode": null,
        "TaxOffice": null,
        "Phone": "830-485-6136",
        "FirstName": "Iron",
        "LastName": "Man",
        "Company": "Stark Industries",
        "Email": "anastasiya.nikolova@chaosgroup.com",
        "Address1": "411 Farland Avenue",
        "Address2": null,
        "City": "Victoria",
        "Zip": "77901",
        "CountryCode": "us",
        "State": "Texas"
    },
    "DeliveryDetails": {
        "Phone": "830-485-6136",
        "FirstName": "Iron",
        "LastName": "Man",
        "Company": "Stark Industries",
        "Email": "anastasiya.nikolova@chaosgroup.com",
        "Address1": "411 Farland Avenue",
        "Address2": null,
        "City": "Victoria",
        "Zip": "77901",
        "CountryCode": "us",
        "State": "Texas"
    },
    "PaymentDetails": {
        "Type": "OTHER",
        "Currency": "usd",
        "PaymentMethod": null,
        "CustomerIP": "212.91.166.163"
    },
    "DeliveryInformation": {
        "ShippingMethod": {
            "Code": null,
            "TrackingUrl": null,
            "TrackingNumber": null,
            "Comment": null
        }
    },
    "CustomerDetails": null,
    "Origin": "Web",
    "AvangateCommission": 0,
    "OrderFlow": "REGULAR",
    "GiftDetails": null,
    "PODetails": null,
    "ExtraInformation": null,
    "PartnerCode": "HBVQ99623329",
    "PartnerMargin": 2478,
    "PartnerMarginPercent": 20,
    "ExtraMargin": 0,
    "ExtraMarginPercent": 0,
    "ExtraDiscount": 0,
    "ExtraDiscountPercent": 0,
    "LocalTime": null,
    "TestOrder": false,
    "FxRate": 1,
    "FxMarkup": 0,
    "PayoutCurrency": "USD",
    "DeliveryFinalized": false,
    "Errors": null,
    "Items": [
        {
            "ProductDetails": {
                "Name": "V-Ray Next for 3ds Max - Perpetual",
                "ShortDescription": "",
                "Tangible": false,
                "IsDynamic": false,
                "ExtraInfo": null,
                "RenewalStatus": false,
                "Subscriptions": [
                    {
                        "SubscriptionReference": "1E26F2D686",
                        "PurchaseDate": "2020-01-17 12:53:48",
                        "SubscriptionStartDate": "2020-01-17 12:53:48",
                        "ExpirationDate": null,
                        "Lifetime": true,
                        "Trial": false,
                        "Enabled": true,
                        "RecurringEnabled": false
                    },
                    {
                        "SubscriptionReference": "F978B4AFDF",
                        "PurchaseDate": "2020-01-17 12:53:48",
                        "SubscriptionStartDate": "2020-01-17 12:53:48",
                        "ExpirationDate": null,
                        "Lifetime": true,
                        "Trial": false,
                        "Enabled": true,
                        "RecurringEnabled": false
                    }
                ],
                "DeliveryInformation": {
                    "Delivery": "NO_DELIVERY",
                    "DownloadFile": null,
                    "DeliveryDescription": "",
                    "CodesDescription": "",
                    "Codes": []
                }
            },
            "PriceOptions": [],
            "Price": {
                "UnitNetPrice": 590,
                "UnitGrossPrice": 628.94,
                "UnitVAT": 38.94,
                "UnitDiscount": 118,
                "UnitNetDiscountedPrice": 472,
                "UnitGrossDiscountedPrice": 510.94,
                "UnitAffiliateCommission": 0,
                "ItemUnitNetPrice": null,
                "ItemUnitGrossPrice": null,
                "ItemNetPrice": null,
                "ItemGrossPrice": null,
                "VATPercent": 8.25,
                "HandlingFeeNetPrice": 0,
                "HandlingFeeGrossPrice": 0,
                "Currency": "usd",
                "NetPrice": 7080,
                "GrossPrice": 7547.28,
                "NetDiscountedPrice": 5664,
                "GrossDiscountedPrice": 6131.28,
                "Discount": 1416,
                "VAT": 467.28,
                "AffiliateCommission": 0
            },
            "LineItemReference": "c790705c387a71545271367303e38e3ffd1b1055",
            "PurchaseType": null,
            "Code": "VR04MXPESCL001",
            "ExternalReference": "",
            "Quantity": 12,
            "SKU": null,
            "CrossSell": null,
            "Trial": null,
            "AdditionalFields": null,
            "Promotion": null,
            "RecurringOptions": null,
            "SubscriptionStartDate": null
        },
        {
            "ProductDetails": {
                "Name": "V-Ray Next for 3ds Max - Perpetual",
                "ShortDescription": "",
                "Tangible": false,
                "IsDynamic": false,
                "ExtraInfo": null,
                "RenewalStatus": false,
                "Subscriptions": [
                    {
                        "SubscriptionReference": "1E26F2D686",
                        "PurchaseDate": "2020-01-17 12:53:48",
                        "SubscriptionStartDate": "2020-01-17 12:53:48",
                        "ExpirationDate": null,
                        "Lifetime": true,
                        "Trial": false,
                        "Enabled": true,
                        "RecurringEnabled": false
                    },
                    {
                        "SubscriptionReference": "F978B4AFDF",
                        "PurchaseDate": "2020-01-17 12:53:48",
                        "SubscriptionStartDate": "2020-01-17 12:53:48",
                        "ExpirationDate": null,
                        "Lifetime": true,
                        "Trial": false,
                        "Enabled": true,
                        "RecurringEnabled": false
                    }
                ],
                "DeliveryInformation": {
                    "Delivery": "NO_DELIVERY",
                    "DownloadFile": null,
                    "DeliveryDescription": "",
                    "CodesDescription": "",
                    "Codes": []
                }
            },
            "PriceOptions": [],
            "Price": {
                "UnitNetPrice": 590,
                "UnitGrossPrice": 628.94,
                "UnitVAT": 38.94,
                "UnitDiscount": 118,
                "UnitNetDiscountedPrice": 472,
                "UnitGrossDiscountedPrice": 510.94,
                "UnitAffiliateCommission": 0,
                "ItemUnitNetPrice": null,
                "ItemUnitGrossPrice": null,
                "ItemNetPrice": null,
                "ItemGrossPrice": null,
                "VATPercent": 8.25,
                "HandlingFeeNetPrice": 0,
                "HandlingFeeGrossPrice": 0,
                "Currency": "usd",
                "NetPrice": 5310,
                "GrossPrice": 5660.46,
                "NetDiscountedPrice": 4248,
                "GrossDiscountedPrice": 4598.46,
                "Discount": 1062,
                "VAT": 350.46,
                "AffiliateCommission": 0
            },
            "LineItemReference": "ec426fce2d07bc279654b295b97644997a5c524d",
            "PurchaseType": null,
            "Code": "VR04MXPESCL001",
            "ExternalReference": "",
            "Quantity": 9,
            "SKU": null,
            "CrossSell": null,
            "Trial": null,
            "AdditionalFields": null,
            "Promotion": null,
            "RecurringOptions": null,
            "SubscriptionStartDate": null
        }
    ],
    "Promotions": [],
    "AdditionalFields": null,
    "CustomParameters": null,
    "Currency": "usd",
    "NetPrice": 12390,
    "GrossPrice": 13207.74,
    "NetDiscountedPrice": 9912,
    "GrossDiscountedPrice": 10729.74,
    "Discount": 2478,
    "VAT": 817.74,
    "AffiliateCommission": 0
}

Errors

Error Description

INVALID_PARTNER

No partner is set.

NO_ORDERS

There are no orders without partner invoice.

 

Set partner invoice payment details (PayPal payment)

Overview

Requirements

Parameters

Response

Request 

<?php

require ('PATH_TO_AUTH');  // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/02Authentication
require ('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/06Reference/Partner/00Set_partner
require ('PATH_TO_setProforma'); // setProforma example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/06Reference/14Billing/00Capture_card_payment/00Set_partner_invoice

$paymentDetails = new stdClass();

$paymentDetails->Type = 'PAYPAL';
$paymentDetails->Curency = 'YOUR_CURRENCY';
$paymentDetails->CustomerIP = 'CUSTOMER_IP';

$paymentDetails->PaymentMethod = new stdClass();
$paymentDetails->PaymentMethod->Email = 'YOUR_PAYPAL_EMAIL';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'setPaymentDetails',
'params' => array($sessionID, $paymentDetails)
);

var_dump (callRPC((Object)$jsonRpcRequest,$host));

Errors

 

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo