Payment

Payment

Provides features related to payment

Constructor

new Payment(options)

Source:
Parameters:
Name Type Description
options object
Properties
Name Type Attributes Default Description
clientId string

Mandatory client id

redirectUri string <optional>

Redirect uri

env string <optional>
PRE

Schibsted account environment: PRE, PRO or PRO_NO

publisher string <optional>

ZUORA publisher

window object <optional>
Throws:
  • If any of options are invalid
Type
SDKError

Classes

Payment

Methods

Source:

Starts the flow for the paylink in a popup or current window

Parameters:
Name Type Description
options object
Properties
Name Type Attributes Default Description
paylink string

The paylink

preferPopup boolean <optional>
false

Should we try to open a popup?

redirectUri string <optional>
this.redirectUri
Returns:
  • Returns a reference to the popup window, or null if no popup was used
Type
Window | null

purchaseHistoryUrl(redirectUriopt) → {string}

Source:

Get the url for the end user to review the purchase history

Parameters:
Name Type Attributes Default Description
redirectUri string <optional>
this.redirectUri
Returns:
  • The url to the purchase history review page
Type
string

redeemUrl(voucherCode, redirectUriopt) → {string}

Source:

Get the url for the end user to redeem a voucher code

Parameters:
Name Type Attributes Default Description
voucherCode string
redirectUri string <optional>
this.redirectUri
Returns:
  • The url
Type
string

purchasePaylinkUrl(paylinkId, redirectUriopt) → {string}

Source:
Deprecated:
  • https://github.com/schibsted/account-sdk-browser/issues/94 Get the url for the paylink purchase
To Do:
  • Check working-ness for BFF + SPiD
Parameters:
Name Type Attributes Default Description
paylinkId string
redirectUri string <optional>
this.redirectUri
Returns:
  • The url to the API endpoint
Type
string

purchaseProductFlowUrl(productId, redirectUriopt) → {string}

Source:

Get the url for flow to purchase a product

Parameters:
Name Type Attributes Default Description
productId string
redirectUri string <optional>
this.redirectUri
Returns:
  • The url to the products review page
Type
string

purchaseCampaignFlowUrl(campaignId, productId, voucherCodeopt, redirectUriopt) → {string}

Source:
To Do:
  • Check working-ness for BFF + SPiD

Get the url for flow to purchase a product through a campaign and voucher code

Parameters:
Name Type Attributes Default Description
campaignId string
productId string
voucherCode string <optional>
redirectUri string <optional>
this.redirectUri
Returns:
  • The url to the products review page
Type
string

purchasePromoCodeProductFlowUrl(code, stateopt, redirectUriopt) → {string}

Source:
Deprecated:
  • Get the url for flow to purchase a promo code product with ZUORA
Parameters:
Name Type Attributes Default Description
code string

promocode product code

state string <optional>
''

An opaque value used by the client to maintain state between the request and callback. It's also recommended to prevent CSRF

redirectUri string <optional>
this.redirectUri
Returns:
  • The url to the buy promo code product flow
Type
string