Payment
Contains all Requests connected with payments
Table of Contents
-
Methods
- confirmPayment(paymentIntent)
- create(data)
- createDirectDebitMandate(data)
- directDebitCharge(data)
- directDebitSubscribe(data)
- getDefaultCreditCard()
- getDirectDebitMandate()
- getPaymentMethods()
- getPaymentTools(paymentMethodId)
- getPayPalParams(data)
- getPurchaseHistory(statuspagelimit)
- setDefaultCreditCard(data)
Methods
confirmPayment
-
paymentIntent
As part of new bank regulations, we need to provide options for additional authentication during the payment flow for customers
Parameters:
-
paymentIntent
String
Returns:
Contains the data - { message: "Submitted for payment", }
Example:
InPlayer.Payment
.confirmPayment('332242')
.then(data => console.log(data));
create
-
data
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.create()
Parameters:
-
data
Object- Payment data - { number: number || string, cardName: string, expMonth: number, expYear: number, cvv: number, accessFee: number, paymentMethod: string, referrer: string voucherCode?: string brandingId?: number returnUrl?: string }
Returns:
Contains the data - { message: "Submitted for payment", }
Example:
InPlayer.Payment
.create({
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));
createDirectDebitMandate
-
data
Create direct debit mandate for customer
Parameters:
-
data
Object- Contains the data - { name: {string}, iban: {string}, }
Returns:
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" } }
Example:
InPlayer.Payment
.createDirectDebitMandate({name, iban})
.then(data => console.log(data));
directDebitCharge
-
data
Process a request for direct debit SEPA charge
Parameters:
-
data
Object- Contains the data - { assetId: {string}, accessFeeId: {string}, voucherCode: {string}, brandingId?: number }
Returns:
Contains the data - { code: '200', message: "Submitted for payment", }
Example:
InPlayer.Payment
.directDebitCharge({ assetId, accessFeeId, voucherCode, brandingId })
.then(data => console.log(data));
directDebitSubscribe
-
data
Process a request for direct debit subscribe
Parameters:
-
data
Object- Contains the data - { assetId: {string}, accessFeeId: {string}, voucherCode: {string}, brandingId?: number }
Returns:
Contains the data - { code: '200', message: "Submitted for payment", } }
Example:
InPlayer.Payment
.directDebitSubscribe({ assetId, accessFeeId, voucherCode, brandingId })
.then(data => console.log(data));
getDefaultCreditCard
()
Object
Gets the default credit card per currency used for subscription rebills
Returns:
Example:
InPlayer.Payment
.getDefaultCreditCard()
.then(data => console.log(data));
getDirectDebitMandate
()
Object
Checks for existing user direct debit mandate
Returns:
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" } }
Example:
InPlayer.Payment
.getDirectDebitMandate()
.then(data => console.log(data));
getPaymentMethods
()
Object
Get all payment methods for a User
Returns:
Example:
InPlayer.Payment
.getPaymentMethods()
.then(data => console.log(data));
getPaymentTools
-
paymentMethodId
Get the payment tools for an aothorization token and payment method ID
Parameters:
-
paymentMethodId
Number- The Payment Method ID
Returns:
Example:
InPlayer.Payment
.getPaymentTools(2)
.then(data => console.log(data));
getPayPalParams
-
data
Gets parameters for PayPal
Parameters:
-
data
Object- Contains details - { origin: {string}, accessFeeId: {number}, paymentMethod: {number} }
Returns:
Example:
InPlayer.Payment
.getPayPalParams({
origin: location.href,
accessFeeId: 34,
paymentMethod: 2
voucherCode: '1231231'
brandingId: 1221
})
.then(data => console.log(data));
getPurchaseHistory
-
status
-
page
-
limit
Gets the purchase history
Parameters:
-
status
String- The status of the purchase - active/inactive
-
page
Number- The current page
-
limit
Number- The number of items per page
Returns:
Example:
InPlayer.Payment
.getPurchaseHistory('active', 0, 5)
.then(data => console.log(data));
setDefaultCreditCard
-
data
Sets card per currency as default card that is to be used for further subscription rebills
Parameters:
-
data
Object- Contains the data - { cardNumber: {string}, cardName: {string}, cvc: {number}, expMonth: {number}, expYear: {number}, currency: {string} }
Returns:
Example:
InPlayer.Payment
.setDefaultCreditCard({
cardNumber: '4242424242424242',
cardName: 'John Doe',
cvc: 123,
expMonth: 1,
expYear: 2020,
currency: 'EUR'
})
.then(data => console.log(data));