docs: change usage of AbstractPaymentService with AbstractPaymentProcessor (#5038)
Fixes #5033
This commit is contained in:
@@ -164,7 +164,7 @@ You can also use the constructor to initialize your integration with the third-p
|
|||||||
Additionally, if you’re creating your Payment Processor as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin, you can access it in the constructor. The options are passed as a second parameter:
|
Additionally, if you’re creating your Payment Processor as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin, you can access it in the constructor. The options are passed as a second parameter:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
constructor(container, options) {
|
constructor(container, options) {
|
||||||
super(container)
|
super(container)
|
||||||
@@ -272,7 +272,7 @@ import {
|
|||||||
PaymentSessionResponse,
|
PaymentSessionResponse,
|
||||||
} from "@medusajs/medusa"
|
} from "@medusajs/medusa"
|
||||||
|
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
async initiatePayment(
|
async initiatePayment(
|
||||||
context: PaymentProcessorContext
|
context: PaymentProcessorContext
|
||||||
@@ -302,7 +302,7 @@ An example of a minimal implementation of `retrievePayment` where you don’t ne
|
|||||||
import { Data } from "@medusajs/medusa"
|
import { Data } from "@medusajs/medusa"
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
async retrievePayment(
|
async retrievePayment(
|
||||||
paymentSessionData: Record<string, unknown>
|
paymentSessionData: Record<string, unknown>
|
||||||
@@ -334,7 +334,7 @@ An example of a minimal implementation of `getPaymentStatus` where you don’t n
|
|||||||
import { Data, PaymentSessionStatus } from "@medusajs/medusa"
|
import { Data, PaymentSessionStatus } from "@medusajs/medusa"
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
async getPaymentStatus(
|
async getPaymentStatus(
|
||||||
paymentSessionData: Record<string, unknown>
|
paymentSessionData: Record<string, unknown>
|
||||||
@@ -395,7 +395,7 @@ import {
|
|||||||
} from "@medusajs/medusa"
|
} from "@medusajs/medusa"
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
async updatePayment(
|
async updatePayment(
|
||||||
context: PaymentProcessorContext
|
context: PaymentProcessorContext
|
||||||
@@ -432,7 +432,7 @@ An example of a minimal implementation of `deletePayment` where no interaction w
|
|||||||
import { PaymentSession } from "@medusajs/medusa"
|
import { PaymentSession } from "@medusajs/medusa"
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
async deletePayment(
|
async deletePayment(
|
||||||
paymentSessionData: Record<string, unknown>
|
paymentSessionData: Record<string, unknown>
|
||||||
@@ -484,7 +484,7 @@ import {
|
|||||||
} from "@medusajs/medusa"
|
} from "@medusajs/medusa"
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
async authorizePayment(
|
async authorizePayment(
|
||||||
paymentSessionData: Record<string, unknown>,
|
paymentSessionData: Record<string, unknown>,
|
||||||
@@ -524,7 +524,7 @@ An example of a minimal implementation of `capturePayment` that doesn’t need t
|
|||||||
import { Data, Payment } from "@medusajs/medusa"
|
import { Data, Payment } from "@medusajs/medusa"
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
async capturePayment(payment: Payment): Promise<Data> {
|
async capturePayment(payment: Payment): Promise<Data> {
|
||||||
return {
|
return {
|
||||||
@@ -552,7 +552,7 @@ An example of a minimal implementation of `refundPayment` that doesn’t need to
|
|||||||
import { Data, Payment } from "@medusajs/medusa"
|
import { Data, Payment } from "@medusajs/medusa"
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
async refundPayment(
|
async refundPayment(
|
||||||
paymentSessionData: Record<string, unknown>,
|
paymentSessionData: Record<string, unknown>,
|
||||||
@@ -583,7 +583,7 @@ An example of a minimal implementation of `cancelPayment` that doesn’t need to
|
|||||||
import { Data, Payment } from "@medusajs/medusa"
|
import { Data, Payment } from "@medusajs/medusa"
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
class MyPaymentService extends AbstractPaymentService {
|
class MyPaymentService extends AbstractPaymentProcessor {
|
||||||
// ...
|
// ...
|
||||||
async cancelPayment(
|
async cancelPayment(
|
||||||
paymentSessionData: Record<string, unknown>
|
paymentSessionData: Record<string, unknown>
|
||||||
|
|||||||
Reference in New Issue
Block a user