Last active
September 23, 2022 03:55
-
-
Save PaxPrz/797eb46958d553c995cc7989425a230e to your computer and use it in GitHub Desktop.
Example payment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PaymentProcessor: | |
... | |
def pay(self, amount: float, user: int) -> bool: | |
"""some logic implemented""" | |
payment = self.run_pay() | |
return payment.id | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from integration.stripe import sync_payment | |
class PaymentProcessor: | |
... | |
def pay(self, amount: float, user: int) -> bool: | |
"""some logic implemented""" | |
payment = self.run_pay() | |
# Code Added by Steve # | |
if payment.is_success: | |
sync_payment(payment.id, payment.code, payment.destination, ...) | |
# Code Added by Steve # | |
return payment | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from integration.stripe import sync_payment | |
from integration.paypal import sync_payment as sync_paypal_payment | |
class PaymentProcessor: | |
... | |
def pay(self, amount: float, user: int) -> bool: | |
"""some logic implemented""" | |
payment = self.run_pay() | |
# Code Added by Steve # | |
if payment.is_success: | |
sync_payment(payment.id, payment.code, payment.destination, ...) | |
# Code Added by Steve # | |
# Code Added by John # | |
if payment.is_success: | |
sync_paypal_payment(payment.id, payment.destination, payment.amount, ...) | |
# Code Added by John # | |
return payment | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment