Calculation Request

The Calculation Request calculates and returns an installment plan depending on the request parameters and the stored parameters of the merchant profile.

Request Parameters

<head> Section

Parameter Condition Enumeration
system-id Mandatory
operation Mandatory CALCULATION_REQUEST
operation@subtype Mandatory - calculation-by-rate
- calculation-by-time
credential Mandatory

<content> Section

The <content> section of the CALCULATION_REQUEST request contains the input parameters for the instalment plan favored by the customer.

Parameter Condition Type
installment-calculation Mandatory installmentCalculationType

XML Examples

calculation-request-by-ratecalculation-request-by-time
Copy
Copied
<?xml version="1.0"?>
<request version="1.0" xmlns="urn://www.ratepay.com/payment/1_0">
	<head>
		<system-id>MyTestsystem</system-id>
		<operation subtype="calculation-by-rate">CALCULATION_REQUEST</operation>
		<credential>
			<profile-id>INTEGRATION_TE_DACH</profile-id>
			<securitycode>4c0a11923fa3433fb168f9c7176429e9</securitycode>
		</credential>
	</head>
	<content>
		<installment-calculation>
			<amount>230.00</amount>
			<calculation-rate>
				<rate>50.00</rate>
			</calculation-rate>
		</installment-calculation>
	</content>
</request>
Copy
Copied
<?xml version="1.0"?>
<request version="1.0" xmlns="urn://www.ratepay.com/payment/1_0">
	<head>
		<system-id>MyTestsystem</system-id>
		<operation subtype="calculation-by-time">CALCULATION_REQUEST</operation>
		<credential>
			<profile-id>INTEGRATION_TE_DACH</profile-id>
			<securitycode>4c0a11923fa3433fb168f9c7176429e9</securitycode>
		</credential>
	</head>
	<content>
		<installment-calculation>
			<amount>200.00</amount>
			<calculation-time>
				<month>3</month>
			</calculation-time>
		</installment-calculation>
	</content>
</request>

Response Parameters

<head> Section

Parameter Condition Enumeration
system-id Mandatory
operation Mandatory
operation@subtype Mandatory - calculation-by-rate
- calculation-by-time
response-type Mandatory - INSTALLMENT_PLAN
- STATUS_ERROR
processing Mandatory

<content> Section

The <content> section of the CALCULATION_REQUEST response contains the details of the calculated instalment plan.

Parameter Condition Type
installment-calculation-result Mandatory installmentCalculationResultType

XML Examples

by-rateby-time
Copy
Copied
<response xmlns="urn://www.ratepay.com/payment/1_0" version="1.0">
<head>
	<system-id>MyTestsystem</system-id>
	<operation subtype="calculation-by-rate">CALCULATION_REQUEST</operation>
	<response-type>INSTALLMENT_PLAN</response-type>
	<external />
	<processing>
		<timestamp>2016-01-06T16:10:50.000</timestamp>
		<status code="OK">Successfully</status>
		<reason code="697">Calculation reason: NOT_ALLOWED_RUNTIME: Rate or runtime did not match allowed runtime – rate has been adjusted.</reason>
		<result code="502">Calculation successful</result>
	</processing>
</head>
<content>
	<installment-calculation-result>
		<total-amount>244.67</total-amount>
		<amount>230</amount>
		<interest-amount>10.72</interest-amount>
		<service-charge>3.95</service-charge>
		<interest-rate>13.7</interest-rate>
		<annual-percentage-rate>19.36</annual-percentage-rate>
		<monthly-debit-interest>1.08</monthly-debit-interest>
		<number-of-rates>6</number-of-rates>
		<rate>40.79</rate>
		<last-rate>40.72</last-rate>
		<payment-firstday>28</payment-firstday>
	</installment-calculation-result>
</content>
</response>
Copy
Copied
<response xmlns="urn://www.ratepay.com/payment/1_0" version="1.0">
  <head>
	<system-id>MyTestsystem</system-id>
	<operation subtype="calculation-by-time">CALCULATION_REQUEST</operation>
	<response-type>INSTALLMENT_PLAN</response-type>
	<external />
	<processing>
	  <timestamp>2016-03-29T13:37:08.000</timestamp>
	  <status code="OK">Successfully</status>
	  <reason code="603">Calculation reason: FULFILLED_CONDITION: The payment plan fulfilled the conditions.</reason>
	  <result code="502">Calculation successful</result>
	</processing>
  </head>
  <content>
	<installment-calculation-result>
	  <total-amount>208.31</total-amount>
	  <amount>200</amount>
	  <interest-amount>4.36</interest-amount>
	  <service-charge>3.95</service-charge>
	  <interest-rate>13.7</interest-rate>
	  <annual-percentage-rate>28.04</annual-percentage-rate>
	  <monthly-debit-interest>1.08</monthly-debit-interest>
	  <number-of-rates>3</number-of-rates>
	  <rate>69.45</rate>
	  <last-rate>69.41</last-rate>
	  <payment-firstday>28</payment-firstday>
	</installment-calculation-result>
  </content>
</response>

How the instalment calculation result of the CALCULATION_REQUEST maps to the instalment details of the PAYMENT_REQUEST

Some parameters of the Calculation Request response must be passed to the Gateway with the subsequent Payment Request request. The following illustration demonstrates how those parameters are mapped.

Mapping of Calculation Request results to Payment Request parameters

Mapping Table

CALCULATION_REQUEST
Response parameters
= PAYMENT_REQUEST
Resquest parameters
total-amount = amount
àmount = shopping-basket@amount
interest-rate = interest-rate
number-of-rates = installment-number
rate = installment-amount
last-rate = last-installment-amount
payment-firstday = payment-firstday