Falcon Payments Providers
Each payment provider should have its own package. We created some simple interfaces
to make integration easy!
Payment Provider Interface
Every provider that runs through Falcon Payments requires the following methods:
Get surcharges
getAppliedSurcharge
This method gets any surcharges applied for the payment method. To learn more about surcharges please see our features documentation.
Parameters
- method (
string
) - payment method code (e.g. paypal or creditcard) - inquiry (
PaymentMethodSurchargeInquiry
) -{ country: string; currency: string; total: number; }
Returns
This method returns null
or Surcharge
Get methods
getMethodList
This method gets the list of available payment methods from a provider.
Parameters
- payload (
PaymentLoadPayload
)
Returns
This method returns an array of payment methods (PaymentMethodList
)
Load method
loadMethod
Load method is used to pass additional data from the payment provider to the client. Often this is authentication to allow the client to load some form of UI.
Parameters
- method (
string
) - payload (
PaymentLoadPayload
)
Returns
PaymentMethodInstance
Validate Payment
validate
The validate method is called when the customer places an order (usually in the final step of a checkout). This method passes the order data to the payment provider and returns information about the status, possibly including data to finish the payment at the front-end.
Parameters
- method (
string
) - payload (
PaymentValidationPayload
)
Returns
This method returns PaymentValidationResult
. It has an optional parameter intermediateStep
, this indicates if another step is needed (e.g. redirect to another page or make another request).