1
0

mv-connect-sdk.ts 828 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @description
  3. * A fake payment API based loosely on the Stripe Connect multiparty payments flow
  4. * described here: https://stripe.com/docs/connect/charges-transfers
  5. */
  6. export class MyConnectSdk {
  7. constructor(private options: { apiKey: string }) {}
  8. /**
  9. * Used to create a payment on the platform itself.
  10. */
  11. async createPayment(options: { amount: number; currency: string; transfer_group: string }) {
  12. return { transactionId: Math.random().toString(36).substring(3) };
  13. }
  14. /**
  15. * Used to create a transfer payment to a Seller.
  16. */
  17. async createTransfer(options: {
  18. amount: number;
  19. currency: string;
  20. connectedAccountId: string;
  21. transfer_group: string;
  22. }) {
  23. return { transactionId: Math.random().toString(36).substring(3) };
  24. }
  25. }