Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Payment

Contains all Requests connected with payments

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns Payment

Properties

config

config: ApiConfig

confirmIdealPayment

  • confirmIdealPayment(sourceId: string): Promise<any>
  • Process a request for ideal payment confirmation

    method

    confirmIdealPayment

    async
    example
    InPlayer.Payment
    .confirmIdealPayment('125sour2ce')
    .then(data => console.log(data));

    Parameters

    • sourceId: string

    Returns Promise<any>

    Contains the data - { code: '200', message: "Submitted for payment", }

confirmIdealSubscribe

  • confirmIdealSubscribe(sourceId: string): Promise<any>
  • Process a request for ideal payment confirmation

    method

    confirmIdealSubscribe

    async
    example
    InPlayer.Payment
    .confirmIdealSubscribe('125sour2ce')
    .then(data => console.log(data));

    Parameters

    • sourceId: string

    Returns Promise<any>

    Contains the data - { code: '200', message: "Submitted for payment", }

createDirectDebitMandate

  • Create direct debit mandate for customer

    method

    createDirectDebitMandate

    async
    example
    InPlayer.Payment
    .createDirectDebitMandate('/v2/payments/direct-debit/mandate', body)
    .then(data => console.log(data));

    Parameters

    Returns Promise<any>

    Contains the data - { "id": "src_1F2GzxJqmvwo8uTaJnRVkgYS", "currency": "eur", "created": 1564576421, "client_secret": "src_client_secret_FXLhLpWGLiupZtUlPStd3jLo", "owner": "John", "full_name": "Bret Johannes", "statement_descriptor": "InPlayer", "status": "chargeable", type_data: { "bank_code": 37040044, "branch_code": 111000000, "country": "DE", "fingerprint": "wGjUgpjH1Rj4NtBf", "last4": 3000, "mandate_reference": "8OC5CIAXSF2UKON4", "mandate_url": "https://hooks.stripe.com/adapter/sepa_debit/file/src_1F2Jqmvwo8DwAwwqraJnRVkgYS" } }

directDebitCharge

  • Process a request for direct debit SEPA charge

    method

    directDebitCharge

    async
    example
    InPlayer.Payment
    .directDebitCharge({ assetId, accessFeeId, voucherCode, brandingId })
    .then(data => console.log(data));

    Parameters

    • data: DirectDebitData

      Contains the data - { assetId: {string}, accessFeeId: {string}, voucherCode: {string}, brandingId?: number }

    Returns Promise<any>

    Contains the data - { code: '200', message: "Submitted for payment", }

directDebitSubscribe

  • Process a request for direct debit subscribe

    method

    directDebitSubscribe

    async
    example
    InPlayer.Payment
    .directDebitSubscribe({ assetId, accessFeeId, voucherCode, brandingId })
    .then(data => console.log(data));

    Parameters

    • data: DirectDebitData

      Contains the data - { assetId: {string}, accessFeeId: {string}, voucherCode: {string}, brandingId?: number }

    Returns Promise<any>

    Contains the data - { code: '200', message: "Submitted for payment", } }

getDirectDebitMandate

  • getDirectDebitMandate(): Promise<any>
  • Checks for existing user direct debit mandate

    method

    getDirectDebitMandate

    async
    example
    InPlayer.Payment
    .getDirectDebitMandate()
    .then(data => console.log(data));

    Returns Promise<any>

    Contains the data - { is_approved: {boolean}, statement_descriptor: {string}, mandate: { "bank_code": 37040044, "branch_code": 111000000, "country": "DE", "fingerprint": "wGjUgpjH1Rj4NtBf", "last4": 3000, "mandate_reference": "8OC5CIAXSF2UKON4", "mandate_url": "https://hooks.stripe.com/adapter/sepa_debit/file/src_1F2Jqmvwo8DwAwwqraJnRVkgYS" } }

idealPayment

  • Process a request for start ideal payment

    method

    idealPayment

    async
    example
    InPlayer.Payment
    .idealPayment({
       1243,
       'handelsbanken',
       'https://event.inplayer.com/staging',
       'http://google.com',
       143,
       '123qwerty987' })
    .then(data => console.log(data));

    Parameters

    • data: IdealPaymentData

      Contains the data - { accessFeeId: number, bank: {string}, returnUrl: {string}; referrer: string, brandingId?: number voucherCode?: {string}, }

    Returns Promise<any>

    Contains the data - { code: '200', message: "Submitted for payment", }

idealSubscribe

  • Process a request for start ideal subscribe

    method

    idealSubscribe

    async
    example
    InPlayer.Payment
    .idealSubscribe({
       1243,
       'handelsbanken',
       'https://event.inplayer.com/staging',
       'http://google.com',
       143,
       '123qwerty987'
    .then(data => console.log(data));

    Parameters

    • data: IdealPaymentData

      Contains the data - { accessFeeId: number, bank: {string}, returnUrl: {string}; referrer: string, brandingId?: number voucherCode?: {string}, }

    Returns Promise<any>

    Contains the data - { code: '200', message: "Submitted for payment", }

request

request: Request

setConfig

setConfig: (env: Env) => void

Type declaration

    • (env: Env): void
    • Parameters

      Returns void

validateReceipt

  • validateReceipt(__namedParameters: { access_fee_id: undefined | number; amazon_user_id: undefined | string; item_id: undefined | number; platform: ReceiptValidationPlatform; product_name: undefined | string; receipt: string }): Promise<any>
  • Validates an In App purchase from Amazon, Apple, GooglePlay or Roku services

    method

    validateReceipt

    async
    example

    InPlayer.Payment .validateReceipt({ platform: 'roku', itemId: 123, accessFeeId: 19, receipt: '123abc', .then(data => console.log(data));

    Parameters

    • __namedParameters: { access_fee_id: undefined | number; amazon_user_id: undefined | string; item_id: undefined | number; platform: ReceiptValidationPlatform; product_name: undefined | string; receipt: string }
      • access_fee_id: undefined | number
      • amazon_user_id: undefined | string
      • item_id: undefined | number
      • platform: ReceiptValidationPlatform
      • product_name: undefined | string
      • receipt: string

    Returns Promise<any>

    Contains the data - { code: '200', message: "Submitted", }

Methods

confirmPayment

  • confirmPayment(paymentIntentId: string): Promise<AxiosResponse<CreatePayment>>
  • As part of new bank regulations, we need to provide options for additional authentication during the payment flow for customers

    method

    confirmPayment

    async
    example
    InPlayer.Payment
    .confirmPayment('332242')
    .then(data => console.log(data));

    Parameters

    • paymentIntentId: string

    Returns Promise<AxiosResponse<CreatePayment>>

    Contains the data - { message: "Submitted for payment", }

createPayment

  • Makes a Payment for a given Authorization token + asset/payment details. Use this method ONLY if the assetFee.type is not 'subscription' or 'freemium'. Otherwise please use InPlayer.Subscription.createPayment()

    method

    createPayment

    async
    example
    InPlayer.Payment
    .createPayment({
      number: 4111111111111111,
      cardName: 'PayPal',
      expMonth: 10,
      expYear: 2030,
      cvv: 656,
      accessFee: 2341,
      paymentMethod: 1,
      referrer: 'http://google.com',
      voucherCode: 'fgh1982gff-0f2grfds'
      brandingId: 1234,
      returnUrl: 'https://event.inplayer.com/staging',
     })
    .then(data => console.log(data));

    Parameters

    • data: CreatePaymentData

      Payment data - { number: number || string, cardName: string, expMonth: number, expYear: number, cvv: number, accessFee: number, paymentMethod: string, referrer: string, voucherCode?: string, brandingId?: number, paymentIntentId?: string, }

    Returns Promise<AxiosResponse<CreatePayment>>

getDefaultCreditCard

  • Gets the default credit card per currency used for subscription rebills

    method

    getDefaultCreditCard

    async
    example
    InPlayer.Payment
    .getDefaultCreditCard()
    .then(data => console.log(data));

    Returns Promise<AxiosResponse<GetDefaultCard>>

getPayPalParams

  • Gets parameters for PayPal

    method

    getPayPalParams

    async
    example
    InPlayer.Payment
    .getPayPalParams({
     origin: location.href,
     accessFeeId: 34,
     paymentMethod: 2
     voucherCode: '1231231'
     branding_id: 1133,
    })
    .then(data => console.log(data));

    Parameters

    • data: PayPalParamsData

      Contains details - { origin: {string}, accessFeeId: {number}, paymentMethod: {number} }

    Returns Promise<AxiosResponse<GeneratePayPalParameters>>

getPaymentMethods

  • Get all payment methods for a User

    method

    getPaymentMethods

    async
    example
    InPlayer.Payment
    .getPaymentMethods()
    .then(data => console.log(data));

    Returns Promise<AxiosResponse<MerchantPaymentMethod[]>>

getPaymentTools

  • getPaymentTools(paymentMethodId: number): Promise<AxiosResponse<any>>
  • Get the payment tools for an aothorization token and payment method ID

    method

    getPaymentTools

    async
    example
    InPlayer.Payment
    .getPaymentTools(2)
    .then(data => console.log(data));

    Parameters

    • paymentMethodId: number

      The Payment Method ID

    Returns Promise<AxiosResponse<any>>

getPurchaseHistory

  • Gets the purchase history

    method

    getPurchaseHistory

    async
    example
    InPlayer.Payment
    .getPurchaseHistory('active', 0, 5)
    .then(data => console.log(data));

    Parameters

    • status: string

      The status of the purchase - active/inactive

    • page: number

      The current page

    • limit: number

      The number of items per page

    Returns Promise<AxiosResponse<PurchaseHistoryCollection[]>>

setDefaultCreditCard

  • Sets card per currency as default card that is to be used for further subscription rebills

    method

    setDefaultCreditCard

    async
    example
    InPlayer.Payment
    .setDefaultCreditCard({
         cardNumber: '4242424242424242',
         cardName: 'John Doe',
         cvc: 123,
         expMonth: 1,
         expYear: 2020,
         currency: 'EUR'
     })
    .then(data => console.log(data));

    Parameters

    • data: DefaultCreditCardData

      Contains the data - { cardNumber: {string}, cardName: {string}, cvc: {number}, expMonth: {number}, expYear: {number}, currency: {string} }

    Returns Promise<AxiosResponse<SetDefaultCard>>

Generated using TypeDoc