Developer Guide

Capture Widget Pay

Creates a session and returns session Information

URL

POST https://api.billagain.com/v1/widgets/capturepaymethod/create

INPUT PARAMETERS (9 Fields)

Parameter Format Description
VaultingType req Alpha Used to Identify how the payment method will be stored
SaleType req Alpha Used to determine what kind of transaction to make
ExpiresIn req TimeSpan Used to specify how long the Iframe session will be valid for.
isVaultOnlyOnSuccess req Boolean Specifies whether the payment method will only be saved on a successful transaction
Amount Alpha Numeric Amount to process in the transaction
CurrencyCode req Alpha Used to specify what currency the transaction to be made in. Gateway selected must support the Currency supported
GatewayToken req Alpha Numeric Gateway Token used to identify which gateway the Iframe must use to process the payment
AuthDomain req Alpha Numeric Unique Session identifier
Description Alpha Numeric Description on what is being paid for

OUTPUT PARAMETERS (17 Fields)

Parameter Format Description
AccountID Numeric Billagain Account Identifer that the session is linked to.
SessionToken Alpha Numeric Unique Session identifier
HashToken Alpha Numeric Hash Token Used in Iframe child
ExtRef Alpha Numeric Account Reference In billagain
CurrencyCode Alpha Used to specify what currency the transaction to be made in. Gateway selected must support the Currency supported
DateCreated Date Date the session was created.
Expires Date Date and time the session will expire.
VaultingType Alpha Used to Identify how the payment method will be stored
SaleType Alpha Used to determine what kind of transaction to make
isVaultOnlyOnSuccess Alpha Numeric Specifies whether the payment method will only be saved on a successful transaction
Amount Numeric Amount to process in the transaction
GatewayToken Alpha Numeric Gateway Token used to identify which gateway the Iframe must use to process the payment
AuthDomain Alpha Numeric Used to restrict the Iframe to only be used by this specified domain
paymentMethodToken Alpha Numeric Token to identify if a payment method was saved during the session
transactionID Numeric Unique Identifer used to identify a transaction linked to a session
Description Alpha Numeric Description on what is being paid for
Html Alpha Numeric HTML placeholder data that contains a container for the Iframe and required javascript files.

EXAMPLES

JSON Input

{
	"VaultingType": "VaultGateway",
	"SaleType":"VaultSale",
	"ExpiresIn":"02:00:00",
	"isVaultOnlyOnSuccess": false,
	"Amount": 40,
	"CurrencyCode":"USD",
	"GatewayToken":"ed111c6d-4cdc-435c-aed9-0ceff5f384d2",
	"AuthDomain":"{Domain hosting IFrame}",
	"Description":"Some Sale Descripion"
}

JSON Output

HTTP CODE: 200 OK
{
    "AccountID": 0,
    "SessionToken": "86bb9d27-8b0b-49b8-a5e4-fd7b72fb8fc3",
    "HashToken": "803c6c09-837d-488a-bd77-5950f1c8d12a",
    "ExtRef": null,
    "CurrencyCode": "USD",
    "DateCreated": "2018-07-06T14:26:41.0746654+02:00",
    "Expires": "2018-07-06T16:26:41.0746654+02:00",
    "VaultingType": "VaultGateway",
    "SaleType": "VaultSale",
    "isVaultOnlyOnSuccess": false,
    "Amount": 40,
    "GatewayToken": "ed111c6d-4cdc-435c-aed9-0ceff5f384d2",
    "AuthDomain": "{Domain hosting IFrame}",
    "paymentMethodToken": null,
    "transactionID": null,
    "Description": "Some Sale Descripion",
    "Html": "<script type='text/javascript' src='http://localhost:49670/javascript/widgets/capturepaymethod/capturepaymethod_iframeparent.js?v=1'><iframe id='dobilling_capturepay_widget' src='http://localhost:49670/widget/capturepay_child/86bb9d27-8b0b-49b8-a5e4-fd7b72fb8fc3' style='min-width: 550px; min-height: 515px;' scrolling='yes'>"
}

Used to set a session as complete and link payment information to a specific customer

URL

PUT https://api.billagain.com/v1/widgets/capturepaymethod/complete

INPUT PARAMETERS (2 Fields)

Parameter Format Description
customerID req Numeric Unique customer identifier
SessionToken req Alpha Numeric Unique Session identifier

EXAMPLES

JSON Input

{
            "customerID":20644,
            "SessionToken":"86bb9d27-8b0b-49b8-a5e4-fd7b72fb8fc3"
}

JSON Output

HTTP CODE: 204 No Content

Returns Session Information for an existing session

URL

GET https://api.billagain.com/v1/widgets/capturepaymethod/get/{SessionToken}

URL PARAMETERS (1 Field)

Parameter Format Description
SessionToken req Alpha Numeric Unique Session identifier

OUTPUT PARAMETERS (22 Fields)

Parameter Format Description
AppId Numeric Unique App Identifer
AccountID Numeric Unique Billagain Account identifier
iframeCapturePayID Numeric unique Identifier for the iframeWidgetSession
IframeType Alpha Specifies the type of Iframe being loaded
SessionToken Alpha Numeric Unique Session identifier
HashToken Alpha Numeric Hash Token Used in Iframe child
ExtRef Alpha Numeric Account Reference In billagain
CurrencyCode Alpha Used to specify what currency the transaction to be made in. Gateway selected must support the Currency supported
DateCreated Date Date the session was created.
Expires Date Date and time the session will expire.
VaultingType Alpha Used to Identify how the payment method will be stored
SaleType Alpha Used to determine what kind of transaction to make
isVaultOnlyOnSuccess Boolean Specifies whether the payment method will only be saved on a successful transaction
Amount Numeric Amount to process in the transaction
gatewayID Numeric Gateway Unique identifier
GatewayToken Alpha Numeric Gateway Token used to identify which gateway the Iframe must use to process the payment
AuthDomain Alpha Numeric Used to restrict the Iframe to only be used by this specified domain
paymentMethodID Numeric Payment Method Identifer
paymentMethodToken Alpha Numeric Token to identify if a payment method was saved during the session
transactionID Numeric Unique Identifer used to identify a transaction linked to a session
Description Alpha Numeric Description on what is being paid for
Html Alpha Numeric HTML placeholder data that contains a container for the Iframe and required javascript files.

EXAMPLES

JSON Output

HTTP CODE: 201 Created
{
    "AppId": 0,
    "AccountID": 0,
    "iframeCapturePayID": 10217,
    "IframeType": "redundant field",
    "SessionToken": "86bb9d27-8b0b-49b8-a5e4-fd7b72fb8fc3",
    "HashToken": "803c6c09-837d-488a-bd77-5950f1c8d12a",
    "ExtRef": "10002",
    "CurrencyCode": "USD",
    "DateCreated": "2018-07-06T14:26:41.0746654+02:00",
    "Expires": "2018-07-06T16:26:41.0746654+02:00",
    "VaultingType": "VaultGateway",
    "SaleType": "VaultSale",
    "isVaultOnlyOnSuccess": false,
    "Amount": 40,
    "gatewayID": 0,
    "GatewayToken": "ed111c6d-4cdc-435c-aed9-0ceff5f384d2",
    "AuthDomain": "{Domain hosting IFrame}",
    "paymentMethodID": null,
    "paymentMethodToken": null,
    "transactionID": null,
    "Description": "Some Sale Descripion",
    "Html": null
}

Returns a string containing Iframe Child Container and linking required javascript files

URL

GET https://api.billagain.com/v1/widgets/capturepaymethod/build/{SessionToken}

URL PARAMETERS (1 Field)

Parameter Format Description
SessionToken req Alpha Numeric Unique Session identifier

EXAMPLES

JSON Output

HTTP CODE: 200 OK