bango safe subscriptions

Upload: vladan-golubovic

Post on 07-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/4/2019 Bango Safe Subscriptions

    1/25

    Version 2.5 Page 1 of 25

    Integration Guide

    Safe Subscriptions

    Time-based & on-demand payments

    Version 2.5

    October 2007

  • 8/4/2019 Bango Safe Subscriptions

    2/25

    Version 2.5 Page 2 of 25

    CONTENTS

    CONTENTS.......................................................................................................................................................................2

    DOCUMENT CHANGE LOG .........................................................................................................................................4

    INTRODUCTION ..............................................................................................................................................................5

    TIME-BASED SUBSCRIPTION (MANAGED BY BANGO) ......................................................................................................5 TIME-BASED SUBSCRIPTION (MANAGED BY YOU) ...........................................................................................................5 ON-DEMAND....................................................................................................................................................................6

    BEFORE YOU START....................................................................................................................................................8

    YOUR RESPONSIBILITY TO YOUR CUSTOMERS ...............................................................................................................9

    SETTING UP SAFE SUBSCRIPTIONS...........................................................................................................................10

    USING THE BANGO.COM MANAGEMENT TOOLS INTERFACE.........................................................................................11 ENHANCED PRICING WITH BANGO RELAY ....................................................................................................................16

    USER EXPERIENCE.....................................................................................................................................................19

    HOW TO SUBSCRIBE......................................................................................................................................................22 MY SUBSCRIPTIONS......................................................................................................................................................22

    My Subscriptions detail..........................................................................................................................................24 Cancel subscription................................................................................................................................................26

    CONFIGURABLE SPEND LIMITS.....................................................................................................................................27

    HOW TO BRAND MY SUBSCRIPTIONS..................................................................................................................29

    BRINGING A USER BACK TO YOUR SITE.........................................................................................................................29 MANAGING YOUR SUBSCRIPTION SERVICE......................................................................................................31

    TIME-BASED SUBSCRIPTIONS (MANAGED BY BANGO)..................................................................................................31 TIME-BASED (MANAGED BY YOU)..................................................................................................................................32 ON-DEMAND PAYMENTS................................................................................................................................................32

    WEB SERVICES API ....................................................................................................................................................33

    SECURITY......................................................................................................................................................................33 WSDLLOCATION .........................................................................................................................................................34 REQUESTING WEB SERVICES ACCESS.........................................................................................................................35 WEB METHODS .............................................................................................................................................................37

    GetSubscribers .......................................................................................................................................................37

    GetCancellations ....................................................................................................................................................37GetNewSubscriptions ............................................................................................................................................39 GetSubscriptionID ..................................................................................................................................................39 CancelSubscription ................................................................................................................................................41 GetSubscriptionInfo................................................................................................................................................41 RequestPayment....................................................................................................................................................41 GetPaymentInfo......................................................................................................................................................41

    APIUSAGE EXAMPLES .................................................................................................................................................41

  • 8/4/2019 Bango Safe Subscriptions

    3/25

    Version 2.5 Page 3 of 25

    Document change log

    Date Version Change detail

    15 April 2007 2.1 Added information regarding welcome and renewal messages sent touser

    31 May 2007 2.3 Updated Management Tools screenshots20 August 2007 2.4 Change description wording for GetSubscribers method03 October 2007 2.5 RequestPayment responses extended

    GetSubscriptionInfo response nextRenewalDate removed

  • 8/4/2019 Bango Safe Subscriptions

    4/25

    Version 2.5 Page 4 of 25

    Introduction

    The Bango Safe Subscriptions service allows a user to agree either to a time-based regularly recurringcharge, or to a series of on-demand payments.

    The Safe Subscriptions system supports many different scenarios, including:

    Time-based subscription (managed by Bango)A time-based subscription where Bango automatically collects renewal payments.

    Bango system configured with price and subscription period Bango system displays subscription terms during sign-up Bango system charges initial subscription period price (unless free) Bango system automatically renews at the configured interval and price until cancelled by either you

    or the user

    Suitable for: time-based subscription services with minimum effort

    Time-based subscription (managed by you)Time-based, with renewal payments triggered by you. The Bango platform does not automatically renew.

    Bango system configured with price but no subscription period You display subscription terms Bango system displays initial subscription period price during sign-up, advising user will be charged

    additional amounts as required Bango system charges initial subscription period price (unless free) You initiate renewal payments via secure API

    Renewal price and interval must be as per the subscription terms approved by the user prior to sign-up.

    Suitable for: time-based subscription services where you require full control

    On-demandAllows you to request payments of any amount, at any time.

    Bango system configured with price but no subscription period Bango system displays initial price during sign-up, advising user will be charged additional amounts

    as required Bango system charges initial price (unless free) You request subsequent payments via secure API

    As not time-based, the Bango system has no information about subscription length and does notautomatically renew.

    Suitable for: in-application payments (e.g. on-handset game or chat service), or general on-demand billing

  • 8/4/2019 Bango Safe Subscriptions

    5/25

    Version 2.5 Page 5 of 25

    Before you start

    Its worth thinking about how to price subscriptions before you begin. Our flexible pricing options let you fixsubscription prices in a range of currencies. You can also vary the cost by making an initial payment higheror lower than subsequent payments - even making the initial price free for an introductory offer or promotion.

    Pricing options

    1. Higher initial price, lower subsequent paymentsYou might want to consider a higher initial price and then lower subsequent payments as anincentive to continue the subscription. Useful as it guarantees an up-front revenue if subscribers tailoff during the course of a subscription.

    2. Free initial price, higher subsequent paymentsFreebies are a great selling point and a useful way to introduce new content to your customers.

    3. Lower initial price, higher subsequent paymentsSet a low-cost opening offer to keep them coming back for more.

    4. Same price throughoutFor a consistent price, just leave the initial price blank and fill in a content price.

    Multi-currency pricing (Target & Advantage package holders only)Your content must always be priced in your default package currency. You dont have to set a price in allcurrencies, but if you do it means that your customers in these territories will always pay a fixed price. If youdont set additional currency prices, well convert your default package currency into each users localcurrency. This means the price will be subject to change based on the exchange rate, which is calculatedfrom the first day of each month.

    For enhanced pricing options use the Bango Relay service.

    Your responsibility to your customers

    Theres one important point about charging for subscriptions that you must always consider:

    Once youve fixed your content price and have a number of subscribers, you cant change the price of thatcontent in the middle of a subscription period. This is to protect your customers and retain their confidence inthe service. After all, if they return to renew a subscription and are expected to pay a different price withoutbeing notified of the changes, it may undermine consumer trust.

    The subscriber must always agree to any changes to their service.

    Any arbitrary changes would mean you wont be honouring the subscription Terms and Conditions, which theuser approved at sign up. These are a service contract between you and your customers.

    The only exception is where a customer cancels a subscription and then you subsequently change thefrequency or price of the subscription. If they then choose to restart the subscription, they must pay at yourrevised frequency/price.

  • 8/4/2019 Bango Safe Subscriptions

    6/25

    Version 2.5 Page 6 of 25

    Setting up Safe Subscriptions

    There are minor differences in the information required for the different subscription models:

    Time-based, managed by BangoSelect the Subscription access model and set the following:

    A subscription period (e.g. 1 day/week/month etc) A subscription renewal price (which can be changed dynamically at subscription set-up) An optional initial subscription period price (e.g. 1

    stperiod price free/reduced/increased)

    An optional initial offer exclusion period (e.g. user must wait this long after cancelling beforebeing able to take advantage of any reduced 1st period price)

    Time-based, managed by youSelect the On-demand access model and set the following:

    A subscription price

    On-demandSelect the On-demand payments access model and set the following:

    A subscription price (which can be changed dynamically at any time during the subscription)

    Using the bango.com Management tools interface

    1. Log in to Management tools at http://bango.com/protected/managementtools.aspx .

    2. Create a new Bango Numberor choose an existing one. Its best to use Tracking numbers for billing,as youll also want to use them for checking revenues and other reporting functions.

    Tracking numbers are not seen by your customers and should be used for priced content only. You dontget to choose them - well allocate a Tracking number for you automatically when you use the Add anumber feature.

    3. Open Content Management in Management tools.

  • 8/4/2019 Bango Safe Subscriptions

    7/25

    Version 2.5 Page 7 of 25

    4. At the pricing stage, choose the appropriate subscription access model Subscription orOn-demand

    Payments

    The following options will appear:

    Timed Based options only:

    Period of accessHow often your consumers must make repeat payments for your content, in minutes, hours anddays. Subscriptions are not given a definitive end date, they just automatically renew every Xmins/hours/days when your customers will automatically make another payment.

    Exclusion periodHelps prevent users repeatedly taking advantage of free or reduced price content. For example, youmay set a free introductory period of one week. A customer subscribes then cancels after the weekis up. They then sign up again for another free period and keep returning week after week. Toprevent this you could opt to set an Exclusion period of, say, one month. If that same customerreturns within the month, they cant access your content unless they pay the regular price for thatsubscription.

    On-demand only:

    As well as selecting the access model On-demand payments you must make sure you haverequested your Web Services credentials - refer to Web Services API section below for moreinformation.

    5. Scroll down to Specify content pricing as shown below. Set the price for your subscription content.

  • 8/4/2019 Bango Safe Subscriptions

    8/25

    Version 2.5 Page 8 of 25

    Currency Description Maximum price Contentprice

    Initial price(timed basedonly)

    A threedigit ISOcode

    The currencyin full

    The most you cancharge for thatcontent. Thisensures your

    content pricedoes not exceedthe maximumspecified byservice operators,helping you todeliver the largestrange of billingmethods to yourcustomers.

    The regularcost of yourcontent. Thisis the price

    yourconsumerspay on aregular basisonce theyhave paid theInitial price.

    A one-offintroductoryprice thatcan differ

    from theregularcontentprice. Use itto set up freeor reduced-priceopeningoffers.

    6. Select Edit content price to change the Content price and Initial price in any number of currencies. Seta Content price. If you want to choose a different introductory price, fill in an Initial price for your

    subscription.

    7. Click Set this price to save, or cancel to abandon your changes.

  • 8/4/2019 Bango Safe Subscriptions

    9/25

    Version 2.5 Page 9 of 25

    Enhanced pricing with Bango Relay

    For added flexibility, the Bango Relay service gives Advantage and Target package holders even morepricing options.

    If you are familiar with the Relay service, youll know that you can use it to pass parameters to dynamicallychange information presented to your consumers when they visit your site. Relay works in the same waywith Subscriptions, with the addition of a new parameter (ic) to change your initial price.

    The Relay service helps you change the price of your content as follows:

    1. Initial cost parameter (ic)The initial cost (ic) parameter is unique to the Subscriptions service and can be used to dynamicallychange the introductory cost.

    Although you can set the value of the ic parameter to 0, its not the most effective use of Relay asyou wont see any transaction information passed back to you if theres no cost and hence notransaction to associate it with.

    Example: Your default price as set in Management tools (initial cost) is $1.50. You want to charge$2 for that particular piece of content. You could pass the ic parameter as ic=200 where 200 is cents(or lowest currency denomination). Heres how its done:

    The mobile user visits your site, chooses content and clicks a link you set up this link topoint to the following URL:

    http://bango.net/go.aspx?b=123456&ic=200.

    The mobile user is then sent to Bango and a charge of 200 cents ($2) is made.

    The user is then be re-directed tohttp://yoursite.net/get-tone.asp? &b=123456&ic=200&u=0&t=0where they can download their chosen content.

    2. Multi-currency initial cost parameter (iceur, icusd, icgbp and so on)Change the price options for all currencies dynamically. If youre familiar with the Relay service youllknow we have an existing multi-currency parameter for other pricing models (ceur, cusd, cgbp andso on). This works in the same way, except its used to configure the initial cost.

    As with the ic parameter above, we dont recommend you use this function to allocate free content,as you could use your Relay functions more effectively for priced content to give you informationabout individual transactions.

    3. Cost parameter (c)This parameter will override the default content price you set in Management tools. This is theregular charge (after the initial price) that you set for your content.

    Remember that any changes you make to subscription prices will only affect new subscribers.Existing subscription prices cant be changed.

    Refer to Bango Relay guide for more information.

  • 8/4/2019 Bango Safe Subscriptions

    10/25

    Version 2.5 Page 10 of 25

    User Experience

    When a user accesses a service enabled for a subscription, the user is asked to approve an agreement.The initial period for either a time-based or on-demand subscription may be free, without requiring the userto be billed immediately.

    Once the agreement is in place, for time-based subscriptions, the subscription will automatically renew at theagreed interval. For on-demand subscriptions, you can use the secure API to bill the user any amount atany time.

    On-demand payments will be collected at your request using the API, subject to any optional spend limit setfor the agreement by the user.

    An agreement can be cancelled at any time by either party.

    User chooses payment method onBango-hosted payment page. This

    shows a branded payment page.

    User returns to your site todownload content.

    Mobile user chooses apayment method onBango-hostedpayment page.

    This shows a brandedpayment page

  • 8/4/2019 Bango Safe Subscriptions

    11/25

    Version 2.5 Page 11 of 25

    How to subscribeA user reaches content either through your mobile internet site or via Bango as normal. Potential subscriberscan also initiate a subscription by sending a text. Bango will then send them a link to start a WAP sessionand redirect them to Bango to confirm the subscription terms.

    Subscribers are directed to the Bango hosted pages where we tell them the frequency and cost of theirsubscription. The Terms and Conditions of their subscription can be seen at all stages of the paymentprocess.

    When a user signs up for a time-based subscription, a free-to-receive welcome message is sent advising theuser they are now signed up for a subscription. This message is sent where Bango has a supporteddomestic free-to-receive shortcode (UK, US, Belgium, Spain).

    A free-to-receive renewal advice message is sent at the renewal point to the user reminding the user theirsubscription has been renewed and advising how they can get more information via My Subsciptions.

    My Subscriptions

    Once a subscriber initiates their service, it will appear in theirMy Subscriptions area ofMy Options athttp://bango.net on their handset:

    A subscriber can end their subscription at any time by openinghttp://bango.net on their mobile phone, then selecting My Options.

    Theyll then see a My Subscriptions option detailing all their repeat

    billing services.

  • 8/4/2019 Bango Safe Subscriptions

    12/25

    Version 2.5 Page 12 of 25

    My Subscriptions detail

    My Subscriptions shows the cost and start date of eachsubscription. Subscriber clicks More for additional detail oneach subscription.

    History lists start date and renewal payments for that subscription.Subscriber can cancel at any time.

  • 8/4/2019 Bango Safe Subscriptions

    13/25

    Version 2.5 Page 13 of 25

    Cancel subscription

    Configurable Spend LimitsA user is able to configure a daily, weekly or monthly spend limit for on-demand payments. By default, nolimit is configured for a user, but the user can set one by visiting My Options and selecting the Spend Limitslink.

    Once the total value of on-demand payments for a user reaches their configured limit, all subsequent on-demand payments will be rejected with a SPEND_LIMIT error code until the value of on-demand paymentswithin the configured period has dropped below the spend limit.

    For security, any configured spend limit and period are visible only to the user.

    Subscriber clicks Cancel subscription button and is asked to confirmdecision.

    Subscriber has a clear call to action when they wish to canceltheir service. Can proceed or go back and retain theirsubscription service.

  • 8/4/2019 Bango Safe Subscriptions

    14/25

    Version 2.5 Page 14 of 25

    How to brand My Subscriptions

    A link to a My Subscriptions page fully branded in your style can be offered to your customers from yourmobile web site.

    By clicking this link, your customers will only see subscriptions for your content, rather than also seeingsubscriptions for any other Bango-enabled content providers. This means there's no leakage and with yourbranding at the top of the page, you keep users in your world.

    You insert the text "Manage my subscriptions" into your site

    You add the following link: http://bango.net/subscriptions.aspx?bango=

    nnnn is any Bango Number in your package - it could be your access Bango Number that you use in

    promotions. If you have more than one subscription in the same package, just pass any Bango Number inyour package and all your subscriptions will be shown to your customers.

    If you already have branding configured for your package (or Bango Number) then all subscription pagesincluding the ones on bango.net are shown in your branding.

    Bringing a user back to your site

    A Back link is shown on the "My Subscriptions" page. To make this link point back to your mobile web site,set an appropriate Home Phrase for the number you passed in the URL for subscriptions.aspx.

    Once the user has finished managing their subscriptions, clicking this link will return them to your mobile website.

    Refer to Mobile Interface Branding guide for more information.

  • 8/4/2019 Bango Safe Subscriptions

    15/25

    Version 2.5 Page 15 of 25

    Managing your subscription service

    The subscription model you choose determines how much work you want to do for yourself and how muchyou want Bango to do automatically.

    For all subscription models, the Web Services API detailed later in this guide allows you to check the statusof both the subscription itself (i.e. is the subscription active, has the user paid etc), check the status of anindividual payment, or even to cancel an individual subscription.

    Time-based subscriptions (managed by Bango)

    For a time-based subscription, once a user has agreed to the subscription terms, you dont need to doanything else. At the end of each subscription period, Bango will automatically bill the customer again. Onlya customer that has a currently paid-up subscription will be allowed to access the content behind yoursubscription Bango Number.

    Otherwise, unless a user cancels their subscription, you will automatically receive subscription payments ateach renewal.

    You might want to check the status of a subscription in other areas of your mobile web site, allowingsubscribers to access special areas of your site. See the Web Services API section for details on how to dothis.

    Time-based (managed by you)

    For time-based subscriptions you manage, you can use the Web Services API detailed later in this guide totrigger renewal payments at the subscription period agreed with the user.

    On-demand payments

    For on-demand subscriptions, you can use the Web Services API to collect ad-hoc payments from the user.

    These payments can be for any amount, at any time, subject to any spend limit the user may haveconfigured to limit their spending over a day/week/month.

  • 8/4/2019 Bango Safe Subscriptions

    16/25

    Version 2.5 Page 16 of 25

    Web Services API

    The Web Services API is a secure server-to-server API (SSL only), offering full control over yoursubscriptions.

    The API allows access to details of current subscribers, the status of individual payments, subscriptioncancellation etc. For on-demand subscriptions, this API allows you to request additional payments from anysubscriber at any time.

    Security

    The Bango Web Services API is protected to ensure that only authorized clients use it. There are threeprimary levels of security:

    The Web Services API allows your server to send requests to the Bango server. The Bango server will onlyaccept requests from authorized IP addresses. Requests directly from an on-handset application are notallowed the application must communicate with your server, which must then communicate with the BangoWeb Services API.

    API username/password and third-party account authentication Client IP address validation Secure Sockets Layer (SSL) data transport

    A failure at any one of these security levels denies access to the Bango Web Services API.

    WSDL Location

    The subscription API WSDL can be located at the following URL.

    https://webservices.bango.com/subscriptions/?wsdl

  • 8/4/2019 Bango Safe Subscriptions

    17/25

    Version 2.5 Page 17 of 25

    Requesting Web Services access

    Before you can use the Web Services API, you need to request access credentials.

    To do this, follow these steps.

    1. Log in to Management tools at http://bango.com/protected/managementtools.aspx .

    2. Select the service package you require Web Services for

    3. Navigate to Edit Properties and scroll down to the Subscriptions section

    4. Select request on Web Services credentials

    5. Select option Yes and then Request change

    6. On receipt of the request well verify your details, set up your credentials and email them to you.

  • 8/4/2019 Bango Safe Subscriptions

    18/25

    Version 2.5 Page 18 of 25

    Web Methods

    Method: GetSubscribers

    Description: Returns a list of all currently active or remaining subscriptions for a particular Bango number.

    Inputs: username Your usernamepassword Your passwordbango Bango Number

    Outputs: subscribers List of (userId, subscriptionId) pairs

    ResponseCodes:

    OK SuccessACCESS_DENIED Invalid username/passwordACCESS_DENIED Invalid IP addressACCESS_DENIED Invalid access to specified Bango numberINVALID_BANGO Invalid Bango numberINTERNAL_ERROR A problem on the server meant that the request could not

    be processed

    Method: GetCancellations

    Description: Returns information for subscriptions that were created in a specified date range.

    Inputs: username Your usernamepassword Your passwordbango Bango NumberfromDate Date filtertoDate Date filter

    Outputs: subscribers List of (userId, subscriptionId) pairs

    ResponseCodes:

    OK SuccessACCESS_DENIED Invalid username/passwordACCESS_DENIED Invalid IP addressACCESS_DENIED Invalid access to specified Bango numberINVALID_BANGO Invalid Bango NumberINVALID_DATERANGE Invalid date rangeINTERNAL_ERROR A problem on the server meant that the request could not

    be processed

  • 8/4/2019 Bango Safe Subscriptions

    19/25

    Version 2.5 Page 19 of 25

    Method: GetNewSubscriptions

    Description: Returns information for subscriptions that were created in a specified date range.

    Inputs: username Your usernamepassword Your passwordbango Bango NumberfromDate Date filtertoDate Date filter

    Outputs: subscribers List of (userId, subscriptionId) pairs

    Response

    Codes:

    OK Success

    ACCESS_DENIED Invalid username/passwordACCESS_DENIED Invalid IP addressACCESS_DENIED Invalid access to specified Bango numberINVALID_BANGO Invalid Bango numberINVALID_DATERANGE Invalid date rangeINTERNAL_ERROR A problem on the server meant that the request could not

    be processed

    Method: GetSubscriptionID

    Description: Returns a Subscription ID that uniquely identifies a users subscription in the Bango system.

    Using the ID, you are able to make further web service calls to query and manage thesubscription.

    Inputs: username Your usernamepassword Your passwordbango Bango numberuserId User ID

    Outputs: responseCode Status of service callresponseMessage Textual description of service statussubscriptionId Subscription ID

    Response

    Codes:

    OK Success

    ACCESS_DENIED Invalid username/passwordACCESS_DENIED Invalid client IP addressACCESS_DENIED Invalid access to specified Bango numberINVALID_BANGO Invalid Bango numberINVALID_USERID Invalid user IDNO_SUBSCRIPTION User not subscribed to Bango numberINTERNAL_ERROR A problem on the server meant that the request could not be

    processed

  • 8/4/2019 Bango Safe Subscriptions

    20/25

    Version 2.5 Page 20 of 25

    Method: CancelSubscription

    Description: Allows you to directly cancel a users subscription without any action required by the user.

    Inputs: username Your usernamepassword Your passwordsubscriptionId Subscription ID

    Outputs: responseCode Status of service callresponseMessage Textual description of service status

    ResponseCodes:

    OK SuccessACCESS_DENIED Invalid username/password

    ACCESS_DENIED Invalid client IP addressACCESS_DENIED Invalid access to specified subscription IDINVALID_SUBSCRIPTIONID

    Invalid subscription ID

    ALREADY_CANCELLED Subscription already cancelledINTERNAL_ERROR A problem on the server meant that the request could not be

    processed

    Method: GetSubscriptionInfo

    Description: Returns information about the current status of a single subscription.

    Inputs: username Your usernamepassword Your passwordsubscriptionId Subscription ID

    Outputs: responseCode Status of serviceresponseMessage Textual description of service statusaccessModel TIMEBASED or ONDEMANDuserId User IDBango Bango numbersubscriptionStatus OK, ERROR, CANCELLED or WAITINGlastPaymentId ID of the last attempted payment for the subscriptioncreationDate Date when the subscription was created

    cancellationDate Date when the subscription was cancelled (if applicable)accessMinutesRemaining Number of minutes remaining for timed access

    subscriptions

    ResponseCodes:

    OK SuccessACCESS_DENIED Invalid username/passwordACCESS_DENIED Invalid client IPACCESS_DENIED Invalid access to specified subscription IDINVALID_SUBSCRIPTIONID Invalid subscription IDINTERNAL_ERROR A problem on the server meant that the request could not

    be processed

  • 8/4/2019 Bango Safe Subscriptions

    21/25

    Version 2.5 Page 21 of 25

    Method: RequestPayment

    Description: Supports the On Demand billing model by attempting to charge a user a specified amount ofmoney. Both the amount to collect and the associated currency must be supplied. Note thatthis is the amount you want to collect from the user. If the user account is configured to use adifferent currency, Bango will automatically take care of any currency conversions.

    A call to this service returns a Payment ID that you should use to check the status of thepayment attempt in a subsequent call to GetPaymentInfo.

    Inputs: username Your usernamepassword Your passwordsubscriptionId Subscription IDamount Amount to bill

    currency Currency of transaction

    Outputs: responseCode Status of service callresponseMessage Textual description of service statuspaymentId Payment ID

    ResponseCodes:

    OK SuccessACCESS_DENIED Invalid username/passwordACCESS_DENIED Invalid client IPACCESS_DENIED Invalid access to specified subscription IDINVALID_SUBSCRIPTIONID Invalid subscription IDINVALID_BANGO Bango number no longer existsSPEND_LIMIT User has reached their predefined spend limit

    NEEDS_INTERACTION Payment details required from userINTERNAL_ERROR A problem on the server meant that the request could not

    be processed

  • 8/4/2019 Bango Safe Subscriptions

    22/25

    Version 2.5 Page 22 of 25

    Method: GetPaymentInfo

    Description: This service returns information relating to a payment attempt that was earlier initiated usingthe RequestPayment service, or to check the status of a recent payment under any type ofsubscription.

    A paymentStatus of OK or FAILED indicates that the payment has finished, whereas a statusof WAITING indicates that the payment attempt has not yet finished.

    In the event of a FAILED status, the paymentFailureCode gives a more detailed status of thecause of the failure.

    A TRYAGAIN status is unlikely, but means the payment could not be processed due to a clash

    with another billing event. This is normally because another content provider issued aRequestPayment request for this user a few seconds before you. Resubmit your request andit will be processed.

    Inputs: username Your usernamepassword Your passwordpaymentId Payment ID

    Outputs: responseCode Status of serviceresponseMessage Textual description of service statuspaymentStatus OK, WAITING, FAILED, TRYAGAINpaymentFailureCode Detailed status code for FAILED paymentsamount Payment amount

    currency Payment currencypaymentDate Date of the payment

    ResponseCodes:

    OK The service executed successfullyACCESS_DENIED Invalid username/passwordACCESS_DENIED Invalid client IPACCESS_DENIED Invalid access to specified payment IDINVALID_PAYMENTID The payment ID is not validINTERNAL_ERROR A problem on the server meant that the request could not

    be processedTRY_AGAIN Request could not be processed right now please resend

    request

  • 8/4/2019 Bango Safe Subscriptions

    23/25

    Version 2.5 Page 23 of 25

    API Usage Examples

    The following examples are pseudo-code for illustration purposes only. Refer to your appropriate technologydocumentation for details of how to use web services in your chosen development environment.

    Get a list of all active subscriptions for a particular Bango number:

    idList = SUBSCRIPTIONAPI.GetSubscribers(username, password, bango)For Each id in idListPrint User ID + idList.userId + has subscription ID + idList.subscriptionId

    End For Each

    Sending the user to a specific page based upon whether they are subscribed or not:

    Long userId = Request(u) // get userId from Bango Identifier output

    GetSubscriptionIDRequest reqreq.username = myUsernamereq.password = myPasswordreq.bango = myBangoreq.userId = userId

    GetSubscriptionIDResponse res = SUBSCRIPTIONAPI.GetSubscriptionID(req)If res.responseCode = OK ThenRedirect to welcome back page

    ElseRedirect to promotion page

    End If

    Obtaining the Subscription ID for a user to be used in later API calls:

    Long userId = Request(u)

    GetSubscriptionIDRequest reqreq.username = myUsername

    req.password = myPasswordreq.bango = myBangoreq.userId = userId

    GetSubscriptionIDResponse res = SUBSCRIPTIONAPI.GetSubscriptionID(req)If res.responseCode = OK ThenSession(userId) = userIdSession(subscriptionId) = res.subscriptionId

    End If

    Initiating a payment request for 1.50:

    Long subscriptionId = Session(subscriptionId)

  • 8/4/2019 Bango Safe Subscriptions

    24/25

    Version 2.5 Page 24 of 25

    Long userId = Session(userId)

    RequestPaymentRequest reqreq.username = myUsernamereq.password = myPasswordreq.subscriptionId = subscriptionId

    RequestPaymentResponse res = SUBSCRIPTIONAPI.RequestPayment(req)

    If res.responseCode = OK ThenLong paymentId = res.paymentIdSession(paymentId) = paymentId // store for later use

    End If

    Checking the status of a payment request:

    Long paymentId = Session(paymentId)

    GetPaymentInfoRequest reqreq.username = myUsernamereq.password = myPasswordreq.paymentId = paymentId

    GetPaymentInfoResponse = SUBSCRIPTIONAPI.GetPaymentInfo(req)

    If res.responseCode = OK Then

    status = res.paymentStatusIf status = OK ThenHandle successful payment

    ElseIf status = ERROR ThenHandle payment error

    Else// payment still being processedCheck again later

    End IfEnd If

    Cancelling a subscription:

    Long subsciptionid = Session(subscriptionId)

    CancelSubscriptionRequest reqreq.username = myUsernamereq.password = myPasswordreq.subscriptionId = subscriptiontId

    CancelSubscriptionResponse res = SUBSCRIPTIONAPI.CancelSubscription(req)

    If res.responseCode = OK Then// subscription successfully cancelledEnd If

  • 8/4/2019 Bango Safe Subscriptions

    25/25

    Version 2 5 Page 25 of 25

    Cancelling all active subscriptions for a particular Bango number:

    GetSubscribersRequest reqreq.username = myUsernamereq.password = myPassword

    GetSubscribersResponse res = SUBSCRIPTIONAPI.GetSubscribers(req)

    If res.responseCode = OK Then

    List subscribers = res.subscribersForEach subscriber in subscribersLong subscriptionId = subscriber.subscriptionId

    CancelSubscriptionRequest creqcreq.username = myUsernamecreq.password = myPasswordcreq.subscriptionId = subscriptiontIdCancelSubscriptionResponse cres = SUBSCRIPTIONAPI.CancelSubscription(creq)

    If cres.responseCode = OK Then// subscription successfully cancelledEnd If

    End ForEachEnd If