addSelfServePrepaid()
void addSelfServePrepaid(string usn, string prepaidCode,
PaymentRequest paymentRequest)
This method adds a prepaid block to a subscription and charges for the prepaid.
Parameters
- usn
- Format: string
- prepaidCode
- Format: string
- paymentRequest
- Format: PaymentRequest XML
Example: Purchase a prepaid block
This example uses a Mastercard to buy a prepaid block worth $16.50.
<PaymentRequest xmlns="http://xml.inomial.com/smile/2.xsd">
<PaymentDetails>
<PaymentType>mastercard</PaymentType>
<AccountName>Joe Smith</AccountName>
<AccountNumber>411111111111</AccountNumber>
<ExpiryDate>2012-12</ExpiryDate>
<CVV>123</CVV>
<PaymentAmount>16.50</PaymentAmount>
</PaymentDetails>
<Object />
</PaymentRequest>
Results
This method adds the prepaid value of the block to the subscription. Depending on your Smile configuration and the value of the prepaid, the subscription's features may be updated after the prepaid is added, for example, the subscription may be unshaped or unwall-gardened. Smile may also reload the subscription's billing configuration and communicate with other network applications.
This method does not return any output. Smile does not emit any messages after it adds prepaid to the subscription, but if the prepaid causes the subscription's features to change, Smile emits the SubscriptionFeaturesChanged message when the feature change is complete.
Faults
PrepaidExceptionThis fault is returned when the subscription does not support the prepaid block, the PaymentRequest XML document does not match the prepaid code (for example, an incorrect amount is specified) or the caller does not have permission to perform this action.
Java client syntax
java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.AddSelfServePrepaid usnprepaidCode filename
- usn
- Purpose: Specifies the USN of the subscription to add the prepaid block to.
- prepaidCode
- Purpose: Specifies the identifier of the prepaid block to add to the subscription.
- filename
- Purpose: Defines the filename of the PaymentRequest XML document.