super-star icon indicating copy to clipboard operation
super-star copied to clipboard

PayPal Provider

Open 0vol opened this issue 1 year ago • 1 comments

Description

Added implementation of a payment provider service using Paypal's Checkout Server SDK.

  • ProviderService Class: extends an abstract service and implements a payment interface. It has two main methods: createACheckoutSession and checkRequestAndReturnDetails.

  • createACheckoutSession Method: creates a new checkout session for a transaction, sets up the details of the transaction, such as the amount and currency, and then sends a request to PayPal to create a new order. If successful, it returns the order ID.

  • checkRequestAndReturnDetails Method: This method takes a request (which should contain an order ID) and sends a request to PayPal to get the details of that order. If successful, it returns the order details.

  • client Function: a helper function that creates and returns a new instance of PayPalHttpClient.


Issue Ticket Number

Fixes #4


Type of change

  • [ ] Bug fix
  • [x] New Provider
  • [ ] Styling
  • [ ] New Feature

Checklist:

  • [x] I have checked to ensure there aren't other open Pull Requests for the same update/change?
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes needed to the documentation

0vol avatar Oct 06 '23 06:10 0vol