| Function |
Return type |
Description |
| __construct($context:SMContext) |
|
Create instance of Payment Extension. $context is the SMContext object available from all extensions. Usually an instance of a Payment Extension is created using the Payment Extension Manager.
|
| GetName() |
String |
Returns display name for the Payment Extension (ie PayPal) |
| GetPaymentMethods() |
SMPaymentMethod[] |
Get information about supported payment methods (usually credit cards). See SMPaymentMethod class for more information. |
| GetCurrencies() |
String[] |
Get list of supported currencies. |
| GetSupportedFunctions() |
SMPaymentFunction[] |
Actually a string array containing values identical to the values of the SMPaymentFunction enum (ie SMPaymentFunction::$Checkout, SMPaymentFunction::$Status etc). Since the extension may only provide a subset of the functionality supported by the Sitemagic Payment Standard, this function may be used to detect what functionality any given Payment Extension implements. See SMPaymentFunction for more information.
|
RegisterExternalCheckout($orderId:string, $currency:string, $amount:integer)
|
|
Register code neccessary in order to load/display payment window available through payment provider. This is usually the easiest way to implement support for payments through a payment provider. The $orderId variable should hold a unique ID identifying an order. $currency should contain the currency code (ie USD, DKK etc), and $amount should contain the amount to pay in the smallest unit available (usually 1/100 - for USD $1 would be 100).
|
| RegisterExternalCheckout($orderId:string, $currency:string, $amount:integer, $autoCapture:bool) |
|
See description for RegisterExternalCheckout( $orderId:string, $currency:string, $amount:integer). The $autoCapture variable determines whether to capture the amount immediately (auto), or later (manually) using the Capture function. Set True to capture automatically, False to authorize payment and capture it later. Auto capture must default to False if both Manual and Auto capture is supported.
|
| RegisterExternalCheckout($orderId:string, $currency:string, $amount:integer, $autoCapture:bool, $callBackInfo:SMPaymentCallBackInfo) |
|
See description for RegisterExternalCheckout($orderId:string, $currency:string, $amount:integer, $autoCapture:bool). The $callBackInfo variable holds a reference to a SMPaymentCallBackInfo object containing information about what URL to return to if a payment is either completed or canceled.
|
| GetCheckoutCaptureSupport() |
SMPaymentCheckoutCapture[] |
Function returns an array containing supported capture methods in RegisterExternalCheckout. See SMPaymentCheckoutCapture enum for more information.
|
| GetCheckoutCallBackSupport() |
SMPaymentCheckoutCallBackSupport[] |
Function returns an array containing supported call back functionality. See SMPaymentCheckoutCallBackSupport enum for more information.
|
Authorize($orderId:string, $currency:string, $amount:integer)
|
Boolean
|
Authorize a payment (reserve money on credit card, to allow it to be drawn later, when shipping the order). The $orderId variable should hold a unique ID identifying an order. $currency should contain the currency code (ie USD, DKK etc), and $amount should contain the amount to pay in the smallest unit available (usually 1/100 - for USD $1 would be 100).
|
| RenewAuthorization($orderId:string) |
Bool |
Renew an existing authorization, which has only been reserved for a given period of time (specified in settings). |
Capture($orderId:string)
|
Bool |
Capture a payment (draw the money reserved). Specify the order ID used to reserve the money (see Authorize function).
|
Subscribe($orderId:string, $currency:string, $amount:integer)
|
Bool
|
Create a subscription which can be captured regulary. The $orderId variable should hold a unique ID identifying an order. $currency should contain the currency code (ie USD, DKK etc), and $amount should contain the amount to pay in the smallest unit available (usually 1/100 - for USD $1 would be 100). |
| Recurring($orderId:string) |
Bool
|
Capture a subscription (draw the money reserved for a subscription). Specify the order ID used to reserve the money (see Subscribe function). |
| Cancel($orderId:string) |
Bool
|
Cancel a payment authorized or subscribed. Specify the order ID used to reserve the money (see Authorize or Subscribe function). |
Refund($orderId:string, $amount:integer)
|
Bool
|
Refund part or the whole of a payment, which has been captured (drawn). Specify the order ID used to reserve the money (see Authorize or Subscribe function), and specify the amount to refund, in the smallest unit available (usually 1/100 - for USD $1 would be 100). Money is returned in the currency in which it was paid.
|
GetStatus($orderId:string)
|
SMPaymentStatus
|
Get payment status. Specify the order ID used to reserve the money (see Authorize or Subscribe function). See SMPaymentStatus class for more information.
|