/Wallet/GetPaymentOptionsForBuyingEDaler

Allows the client to initiate the process of getting payment options for buying eDaler.

JSON

Request
{
	"serviceId": Required(Str(PServiceId)),
	"serviceProvider": Required(Str(PServiceProvider)),
	"successUrl": Optional(Str(PSuccessUrl)),
	"failureUrl": Optional(Str(PFailureUrl)),
	"cancelUrl": Optional(Str(PCancelUrl)),
	"transactionId": Optional(Str(PTransactionId)),
	"tabId": Optional(Str(PTabId)),
	"functionName": Optional(Str(PFunctionName))
}
Response (if successful)
{
	"id":Required(Str(PId)),
	"state":Required(Str(PState)),
	"started":Required(DateTime(PStarted)),
	"ended":Optional(DateTime(PEnded)),
	"serviceId": Required(Str(PServiceId)),
	"serviceProvider": Required(Str(PServiceProvider)),
	"successUrl": Optional(Str(PSuccessUrl)),
	"failureUrl": Optional(Str(PFailureUrl)),
	"cancelUrl": Optional(Str(PCancelUrl)),
	"clientUrl": Optional(Str(PClientUrl))
}

XML

Request
<GetPaymentOptionsForBuyingEDaler xmlns="https://waher.se/Schema/BrokerAgent.xsd"
                   serviceId=(Required(Str(PServiceId)))
                   serviceProvider=(Required(Str(PServiceProvider)))
                   successUrl=(Optional(Str(PSuccessUrl)))
                   failureUrl=(Optional(Str(PFailureUrl)))
                   cancelUrl=(Optional(Str(PCancelUrl)))
                   transactionId=(Optional(Str(PTransactionId)))
                   tabId=(Optional(Str(PTabId)))
                   functionName=(Optional(Str(PFunctionName)))/>
Response (if successful)
<TransactionInformation xmlns="https://waher.se/Schema/BrokerAgent.xsd"
                        id=(Required(Str(PId)))
                        state=(Required(Str(PState)))
                        started=(Required(DateTime(PStarted)))
                        ended=(Optional(Datetime(PEnded)))
                        serviceId=(Required(Str(PServiceId)))
                        serviceProvider=(Required(Str(PServiceProvider)))
                        successUrl=(Optional(Str(PSuccessUrl)))
                        failureUrl=(Optional(Str(PFailureUrl)))
                        cancelUrl=(Optional(Str(PCancelUrl)))
                        clientUrl=(Optional(Str(PClientUrl)))/>

Input Parameters

Parameter Description
PServiceId ID of service to use.
PServiceProvider ID of service provider publishing the service selected.
PSuccessUrl Optional URL to call from Client web page, when the transaction has concluded successfully.
PFailureUrl Optional URL to call from Client web page, if the transaction fails.
PCancelUrl Optional URL to call from Client web page, if the client cancels the transaction.
PTransactionId Optional ID of transaction.
PTabId Optional TAB ID. Used by Events.js, and can be used to inform the client when a change is reported for the transaction.
PFunctionName Optional name of Javascript function to call if Events.js is included, and a Tab ID is reported.

Response Parameters

Parameter Description
Id ID of transaction.
State State of transaction. Possible values are Created, Preparing, Prepared, Executing, Executed, Committing, Committed, RollingBack, RolledBack and Error.
Started When transaction started.
Ended When (if) transaction ended.
PServiceId ID of service to use.
PServiceProvider ID of service provider publishing the service selected.
PSuccessUrl Optional URL to call from Client web page, when the transaction has concluded successfully.
PFailureUrl Optional URL to call from Client web page, if the transaction fails.
PCancelUrl Optional URL to call from Client web page, if the client cancels the transaction.
PClientUrl URL to third-party web page that the client needs to open and complete, for the transaction to take place.

Javascript Library

Use the following asynchronous method in the Javascript Library, to call this resource.

var Response = await AgentAPI.Wallet.GetPaymentOptionsForBuyingEDaler(ServiceId,ServiceProvider,SuccessUrl,FailureUrl,CancelUrl,TransactionId,TabId,FunctionName);
Test







Request Payload:

   

Response Payload:

   

Event Payload: