Skip to content

@sourceloop/payment-service / Exports / RazorpayProvider

Class: RazorpayProvider

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new RazorpayProvider(transactionsRepository, ordersRepository, subscriptionsRepository, logger, config?)

Parameters

Name Type
transactionsRepository TransactionsRepository
ordersRepository OrdersRepository
subscriptionsRepository SubscriptionsRepository
logger ILogger
config? IRazorpayConfig

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:28

Properties

config

Private Optional Readonly config: IRazorpayConfig

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:37


instance

instance: any

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:40


logger

logger: ILogger

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:35


ordersRepository

Private Readonly ordersRepository: OrdersRepository

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:32


razorpayKey

razorpayKey: undefined | string

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:46


subscriptionsRepository

Private Readonly subscriptionsRepository: SubscriptionsRepository

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:34


transactionsRepository

Private Readonly transactionsRepository: TransactionsRepository

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:30

Methods

subscriptionCharge

subscriptionCharge(chargeResponse): Promise<{ res: ResponseMessage = ResponseMessage.NotSucess; subscriptionId: undefined | string = chargeResponse.razorpay_subscription_id }>

Parameters

Name Type
chargeResponse DataObject<{ razorpay_payment_id: string ; razorpay_subscription_id: string }>

Returns

Promise<{ res: ResponseMessage = ResponseMessage.NotSucess; subscriptionId: undefined | string = chargeResponse.razorpay_subscription_id }>

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:102


subscriptionCreate

subscriptionCreate(subscription, paymentTemplate): Promise<string>

Parameters

Name Type
subscription Subscriptions
paymentTemplate string

Returns

Promise<string>

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:48


subscriptionWebHook

subscriptionWebHook(sub): Promise<boolean>

Parameters

Name Type
sub DataObject<{ payload: DataObject<{ subscription: DataObject<{ entity: DataObject<{ id: undefined | string ; status: string }> }> }> }>

Returns

Promise<boolean>

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:139


value

value(): Object

Returns

Object

Name Type
charge (chargeResponse: DataObject<{ razorpay_order_id: string ; razorpay_payment_id: string }>) => Promise<{ orderId: undefined | string ; res: ResponseMessage = ResponseMessage.Sucess }>
create (payorder: Orders, paymentTemplate: string) => Promise<unknown>
refund (transactionId: string) => Promise<any>
subscriptionCharge (chargeResponse: DataObject<{ razorpay_payment_id: string ; razorpay_subscription_id: string }>) => Promise<{ res: ResponseMessage = ResponseMessage.NotSucess; subscriptionId: undefined | string = chargeResponse.razorpay_subscription_id }>
subscriptionCreate (subscription: Subscriptions, paymentTemplate: string) => Promise<string>
subscriptionWebHook (sub: DataObject<{ payload: DataObject<{ subscription: DataObject<{ entity: DataObject<{ id: undefined | string ; status: string }> }> }> }>) => Promise<boolean>

Implementation of

Provider.value

Defined in

services/payment-service/src/providers/razorpay/razorpay.provider.ts:160