Sample-monthlypayment: Difference between revisions
(Created page with "__NOTOC__ {{PageTitle|title=Online TV - service with monthly payment sample}} This example is the input of <span class="api-ver">v2</span> /Payment/Start...") |
No edit summary |
||
Line 2: | Line 2: | ||
{{PageTitle|title=Online TV - service with monthly payment sample}} | {{PageTitle|title=Online TV - service with monthly payment sample}} | ||
This example is the input of <span class="api-ver">v2</span> [[Payment-Start-v2|/Payment/Start]] API call for an online TV that collects monthly subscription fees. This is the simplest transaction type where the customer pays to the service provider. There are two versions of the call, an initial, where [[Token_payment|Token payment]] is initiated and user is redirected to the Payment GUI, and a subsequent call where the token is used to make payments from the initial funding source without user interaction. The second call shall be repeated monthly by the TV, as long as the service is active. The sum may vary from call to call, eg. if the prices drop or new programs are added. | This example is the input of <span class="api-ver">v2</span> [[Payment-Start-v2|/Payment/Start]] API call for an online TV that collects monthly subscription fees. This is the simplest transaction type where the customer pays to the service provider. There are two versions of the call, an initial, where [[Token_payment|Token payment]] is initiated and user is redirected to the Payment GUI, and a subsequent call where the token is used to make payments from the initial funding source without user interaction. The second call shall be repeated monthly by the TV, as long as the service is active. The sum may vary from call to call, eg. if the prices drop or new programs are added; the sample shows HBO is added in February. | ||
'''API Input JSON for initiating Token payment''' | '''API Input JSON for initiating Token payment''' | ||
Line 31: | Line 31: | ||
POSTransactionId: "tr-25", | POSTransactionId: "tr-25", | ||
Payee: "[email protected]", | Payee: "[email protected]", | ||
Total: | Total: 10, | ||
Items: [ | Items: [ | ||
{ | { | ||
Line 42: | Line 42: | ||
SKU: "tv-mon" | SKU: "tv-mon" | ||
}, | }, | ||
] | ] | ||
} | } | ||
Line 57: | Line 48: | ||
</source> | </source> | ||
'''API Input JSON for subsequent Token payments''' | '''API Input JSON for subsequent Token payments, with HBO added as an extra''' | ||
<source lang="javascript"> | <source lang="javascript"> | ||
{ | { |
Latest revision as of 11:07, 6 September 2017
Online TV - service with monthly payment sample
This example is the input of v2 /Payment/Start API call for an online TV that collects monthly subscription fees. This is the simplest transaction type where the customer pays to the service provider. There are two versions of the call, an initial, where Token payment is initiated and user is redirected to the Payment GUI, and a subsequent call where the token is used to make payments from the initial funding source without user interaction. The second call shall be repeated monthly by the TV, as long as the service is active. The sum may vary from call to call, eg. if the prices drop or new programs are added; the sample shows HBO is added in February.
API Input JSON for initiating Token payment
{
POSKey: "999FFDDA-04FF-333F-CCCC-345FCB555FFC",
PaymentType: "Immediate",
PaymentWindow: "00:30:00",
GuestCheckout : "True",
FundingSources: [ "All" ],
InitiateRecurrence : "True", //If set to True, the Token will be recorder
RecurrenceId : "345986-25646-3456346", //Token provided by merchant for subsequent payments
PaymentRequestId: "payment-25",
OrderNumber: "order-25",
PayerHint: "[email protected]",
RedirectUrl: "http://shop.example.com/thank-you-page",
CallbackUrl: "http://shop.example.com/api/callback",
Locale: "en-US",
Currency: "EUR",
Transactions: [
{
POSTransactionId: "tr-25",
Payee: "[email protected]",
Total: 10,
Items: [
{
Name: "TV Subscription Silver",
Description: "Monthly TV subscription fee 'Silver package' for January 2017",
Quantity: 1,
Unit: "pcs",
UnitPrice: 10,
ItemTotal: 10,
SKU: "tv-mon"
},
]
}
]
}
API Input JSON for subsequent Token payments, with HBO added as an extra
{
POSKey: "999FFDDA-04FF-333F-CCCC-345FCB555FFC",
PaymentType: "Immediate",
PaymentWindow: "00:30:00",
GuestCheckout : "True",
FundingSources: [ "All" ],
InitiateRecurrence : "False", //If set to False, the Token will be used to execute the payment
RecurrenceId : "345986-25646-3456346", //Token previously recorded
PaymentRequestId: "payment-26",
OrderNumber: "order-26",
PayerHint: "[email protected]",
RedirectUrl: "http://shop.example.com/thank-you-page",
CallbackUrl: "http://shop.example.com/api/callback",
Locale: "en-US",
Currency: "EUR",
Transactions: [
{
POSTransactionId: "tr-26",
Payee: "[email protected]",
Total: 25,
Items: [
{
Name: "TV Subscription Silver",
Description: "Monthly TV subscription fee 'Silver package' for February 2017",
Quantity: 1,
Unit: "pcs",
UnitPrice: 10,
ItemTotal: 10,
SKU: "tv-mon"
},
{
Name: "HBO-OD",
Description: "Monthly HBO On Demand subscription fee for February 2017",
Quantity: 1,
Unit: "pcs",
UnitPrice: 15,
ItemTotal: 15,
SKU: "tv-hbood-mon"
}
]
}
]
}