Options
All
  • Public
  • Public/Protected
  • All
Menu

Contains all Requests connected with payments

Hierarchy

  • BaseExtend
    • Payment

Index

Constructors

constructor

  • new Payment(config: ApiConfig, request: Request): Payment
  • Parameters

    • config: ApiConfig
    • request: Request

    Returns Payment

Properties

config

config: ApiConfig

request

request: Request

Methods

applePayPayment

  • applePayPayment(__namedParameters: { accessFeeId: number; brandingId: number; referrer: string; voucherCode?: string }): Promise<AxiosResponse<CommonResponse>>
  • Process a request for start apple payment

    method

    applePayPayment

    async
    example
    InPlayer.Payment
    .applePayPayment({
    1243,
    'http://google.com',
    143,
    '123qwerty987'
    }).then((data) => console.log(data));

    Parameters

    • __namedParameters: { accessFeeId: number; brandingId: number; referrer: string; voucherCode?: string }
      • accessFeeId: number
      • brandingId: number
      • referrer: string
      • Optional voucherCode?: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data:

    {
    code: 200,
    message: "Submitted for payment"
    }

confirmDonationPayment

  • confirmDonationPayment(__namedParameters: { brandingId: number; donationId?: number; paymentIntentId: string; paymentMethod: string }): Promise<AxiosResponse<CommonResponse>>
  • As part of new bank regulations, we need to provide options for additional authentication during the payment flow for customers

    method

    confirmDonationPayment

    async
    throws

    Will throw an HTTP 400 error if the payment intent id is not sent.

    example
    InPlayer.Payment
    .confirmDonationPayment('332242', 1, 'Card')
    .then(data => console.log(data));

    Parameters

    • __namedParameters: { brandingId: number; donationId?: number; paymentIntentId: string; paymentMethod: string }
      • brandingId: number
      • Optional donationId?: number
      • paymentIntentId: string
      • paymentMethod: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data:

    {
    code: 200,
    message: "Submitted for payment",
    }

confirmPayment

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

    method

    confirmPayment

    async
    throws

    Will throw an HTTP 400 error if the payment intent id is not sent.

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

    Parameters

    • paymentIntentId: string

      The id of the payment. Part of the return url (payment_intent query parameter) after successful authetication in SCA process.

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data:

    {
    code: 200,
    message: "Submitted for payment",
    }

createDirectDebitMandate

  • createDirectDebitMandate(__namedParameters: { address?: string; iban: string; name: string }): Promise<AxiosResponse<CreateDirectDebitResponse>>
  • Creates direct debit mandate for user

    method

    createDirectDebitMandate

    async
    example
    InPlayer.Payment
    .createDirectDebitMandate({
    name: 'Name Surname',
    iban: '123Nk362'
    })
    .then(data => console.log(data));

    Parameters

    • __namedParameters: { address?: string; iban: string; name: string }
      • Optional address?: string
      • iban: string
      • name: string

    Returns Promise<AxiosResponse<CreateDirectDebitResponse>>

    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"
    }
    }

createDonationPayment

  • Makes a Donation Payment for a given Authorization token + asset/payment details.

    method

    createDonationPayment

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

    Parameters

    Returns Promise<AxiosResponse<CreateDonationPaymentData>>

    Contains the data:

    {
    code: 200,
    message: "Submitted for payment"
    }

createPayment

  • createPayment(__namedParameters: { accessFee: number; brandingId: number; cardName: string; cvv: number; expMonth: string; expYear: string; isGift?: boolean; number: number; paymentMethod: number; receiverEmail?: string; referrer: string; returnUrl: string; voucherCode: string }): Promise<AxiosResponse<CommonResponse>>
  • 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',
    isGift,
    receiverEmail: 'mail@gmail.com'
    })
    .then(data => console.log(data));

    Parameters

    • __namedParameters: { accessFee: number; brandingId: number; cardName: string; cvv: number; expMonth: string; expYear: string; isGift?: boolean; number: number; paymentMethod: number; receiverEmail?: string; referrer: string; returnUrl: string; voucherCode: string }
      • accessFee: number
      • brandingId: number
      • cardName: string
      • cvv: number
      • expMonth: string
      • expYear: string
      • Optional isGift?: boolean
      • number: number
      • paymentMethod: number
      • Optional receiverEmail?: string
      • referrer: string
      • returnUrl: string
      • voucherCode: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Containes the data:

    {
    code: 200,
    message: "Submittet for payment"
    }

directDebitCharge

  • directDebitCharge(__namedParameters: { accessFeeId: number; assetId: number; brandingId?: number; referrer: string; voucherCode: string }): Promise<AxiosResponse<CommonResponse>>
  • 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

    • __namedParameters: { accessFeeId: number; assetId: number; brandingId?: number; referrer: string; voucherCode: string }
      • accessFeeId: number
      • assetId: number
      • Optional brandingId?: number
      • referrer: string
      • voucherCode: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data:

    {
    code: '200',
    message: "Submitted for payment",
    }

directDebitSubscribe

  • directDebitSubscribe(__namedParameters: { accessFeeId: number; assetId: number; brandingId?: number; referrer: string; voucherCode: string }): Promise<AxiosResponse<CommonResponse>>
  • Process a request for direct debit subscribe

    deprecated

    Please use the one from Subscription module i.e InPlayer.Subscription.directDebitSubscribe()

    method

    directDebitSubscribe

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

    Parameters

    • __namedParameters: { accessFeeId: number; assetId: number; brandingId?: number; referrer: string; voucherCode: string }
      • accessFeeId: number
      • assetId: number
      • Optional brandingId?: number
      • referrer: string
      • voucherCode: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data

    {
    code: 200,
    message: "Submitted for payment"
    }

getDefaultCreditCard

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

    deprecated

    Please use the one from Subscription module i.e InPlayer.Subscription.getDefaultCreditCard()

    method

    getDefaultCreditCard

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

    Returns Promise<AxiosResponse<GetDefaultCard>>

getDirectDebitMandate

  • Checks for existing user direct debit mandate

    method

    getDirectDebitMandate

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

    Returns Promise<AxiosResponse<DirectDebitMandateResponse>>

    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"
    }
    }

getPayPalParams

  • getPayPalParams(__namedParameters: { accessFeeId: number; brandingId?: number; origin: string; paymentMethod: number; voucherCode: string }): Promise<AxiosResponse<GeneratePayPalParameters>>
  • Gets parameters for PayPal

    method

    getPayPalParams

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

    Parameters

    • __namedParameters: { accessFeeId: number; brandingId?: number; origin: string; paymentMethod: number; voucherCode: string }
      • accessFeeId: number
      • Optional brandingId?: number
      • origin: string
      • paymentMethod: number
      • voucherCode: string

    Returns Promise<AxiosResponse<GeneratePayPalParameters>>

    Contains the data:

    {
    endpoint: string;
    business: string;
    item_name: string;
    currency_code: string;
    return: string;
    cancel_return: string;
    }

getPaymentMethods

  • Gets all payment methods for a given user

    method

    getPaymentMethods

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

    Returns Promise<AxiosResponse<MerchantPaymentMethod[]>>

    Contains the data:

    [
    {
    id: number;
    method_name: string;
    is_external: boolean;
    }
    ]

getPurchaseHistory

  • Gets the purchase history

    method

    getPurchaseHistory

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

    Parameters

    • status: string = 'active'

      The purchase status (active/inactive). It it is not set the active purchases will be returned.

    • page: number = 0

      The current page number. If it is not set the starting page will be returned.

    • limit: number = 5

      The number of items per page. If it is not set the number of items per page will be 15.

    Returns Promise<AxiosResponse<PurchaseHistoryCollection[]>>

    Contains the data:

    {
    total: number;
    page: number;
    offset: number;
    limit: number;
    collection: [{
    consumer_email: string;
    created_at: number;
    customer_id: number;
    expires_at: number;
    is_trial: boolean;
    item_access_id: number;
    item_id: number;
    item_title: string;
    merchant_id: number;
    parent_resource_id: string;
    payment_method: string;
    payment_tool: string;
    purchase_access_fee_description: string;
    purchased_access_fee_id: number;
    purchased_access_fee_type: string;
    purchased_amount: number;
    purchased_currency: string;
    revoked: number;
    starts_at: number;
    type: string;
    }];
    }

googlePayPayment

  • googlePayPayment(__namedParameters: { accessFeeId: number; brandingId: number; referrer: string; voucherCode?: string }): Promise<AxiosResponse<CommonResponse>>
  • Process a request for start google payment

    method

    googlePayPayment

    async
    example
    InPlayer.Payment
    .googlePayPayment({
    1243,
    'http://google.com',
    143,
    '123qwerty987'
    }).then((data) => console.log(data));

    Parameters

    • __namedParameters: { accessFeeId: number; brandingId: number; referrer: string; voucherCode?: string }
      • accessFeeId: number
      • brandingId: number
      • referrer: string
      • Optional voucherCode?: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data:

    {
    code: 200,
    message: "Submitted for payment"
    }

idealPayment

  • idealPayment(__namedParameters: { accessFeeId: number; bank: string; brandingId?: number; referrer: string; returnUrl: string; voucherCode?: string }): Promise<AxiosResponse<CommonResponse>>
  • 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

    • __namedParameters: { accessFeeId: number; bank: string; brandingId?: number; referrer: string; returnUrl: string; voucherCode?: string }
      • accessFeeId: number
      • bank: string
      • Optional brandingId?: number
      • referrer: string
      • returnUrl: string
      • Optional voucherCode?: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data:

    {
    code: 200,
    message: "Submitted for payment"
    }

idealSubscribe

  • idealSubscribe(__namedParameters: { accessFeeId: number; bank: string; brandingId?: number; referrer: string; returnUrl: string; voucherCode?: string }): Promise<AxiosResponse<CommonResponse>>
  • Process a request for start ideal subscribe

    deprecated

    Please use the one from Subscription module i.e InPlayer.Subscription.idealSubscribe()

    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

    • __namedParameters: { accessFeeId: number; bank: string; brandingId?: number; referrer: string; returnUrl: string; voucherCode?: string }
      • accessFeeId: number
      • bank: string
      • Optional brandingId?: number
      • referrer: string
      • returnUrl: string
      • Optional voucherCode?: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data:

    {
    code: 200,
    message: "Submitted for payment"
    }

setDefaultCreditCard

  • setDefaultCreditCard(__namedParameters: { cardName: string; cardNumber: string; currency: string; cvc: number; expMonth: number; expYear: number }): Promise<AxiosResponse<SetDefaultCard>>
  • Sets card per currency as default card that is to be used for further subscription rebills

    deprecated

    Please use the one from Subscription module i.e InPlayer.Subscription.setDefaultCreditCard()

    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

    • __namedParameters: { cardName: string; cardNumber: string; currency: string; cvc: number; expMonth: number; expYear: number }
      • cardName: string
      • cardNumber: string
      • currency: string
      • cvc: number
      • expMonth: number
      • expYear: number

    Returns Promise<AxiosResponse<SetDefaultCard>>

    Contains the data:

    {
    number: number;
    card_name: string;
    exp_month: number;
    exp_year: number;
    }

validateReceipt

  • validateReceipt(__namedParameters: { accessFeeId?: number; amazonUserId?: string; itemId?: number; platform: ReceiptValidationPlatform; productName?: string; receipt: string }): Promise<AxiosResponse<CommonResponse>>
  • 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: { accessFeeId?: number; amazonUserId?: string; itemId?: number; platform: ReceiptValidationPlatform; productName?: string; receipt: string }
      • Optional accessFeeId?: number
      • Optional amazonUserId?: string
      • Optional itemId?: number
      • platform: ReceiptValidationPlatform
      • Optional productName?: string
      • receipt: string

    Returns Promise<AxiosResponse<CommonResponse>>

    Contains the data

    {
    code: 200,
    message: "Submitted for payment"
    }

Generated using TypeDoc