php - Design Pattern for Multiple Payment Providers and notifying different users based on the implementation -


I'm trying to come up with a simple way to add multiple implementation of payment providers in the system, which is only for one Uses Now

I have to link a company object to a membership . There are items related to multiple invoices in a membership can be associated with one subscription only one payment provider interface But we will have the option of changing the payment provider to subscribe to the subscription generated by the Payment Provider Interface factory.

The problem is that the reason for applying different PaymentProviderInterface to the user is to be different, for a particular PaymentProviderInterface I would send an email to our system instead of a real end user, for the stripe, email should be sent to the user connected to the Strip Account. For the second service the user is stored in the company object.

Is the PaymentProvider object associated with Subscription ?

Billing Address is the same thing. The way we retrieve the billing address in order to apply the invoice object, the payment provider is different. If this is a stripe, then it is a billing address located on the stripe, if it is another, then Billing Address is stored in our database.

You should be able to define custom arguments passed as a payment provider in the form of a query provider And after the payment attempt, your server will come back as "this" (this does not affect the presence of these custom arguments, a successful or unsuccessful attempt). When your factory selects the correct payment provider interface for membership , then it can select the user using that argument and It can pass in the form of the parameter payment provider (as a string), then the server can know that by parsing the contents of this custom logic field, PaymentProvider Who will notify on the basis of returning by Custom argensals are commonly used for payment purposes in payment providers. Does this make sense?

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -