To integrate with Blackbaud Checkout, include the bbCheckout.2.0.js
</body>
<script src='https://payments.blackbaud.com/Checkout/bbCheckout.2.0.js'></script>
<script src='https://payments.blackbaud.com/Checkout/bbCheckout.2.0.js'></script>
Then create a JSON object that contains your transaction parameters, including the Blackbaud Payment Service account's public key and merchant account ID. The public key is a unique ID that identifies the organization communicating with Blackbaud Secure Payments. The merchant account ID identifies the account to use to process the payment. For information about how to retrieve these keys, see the Public key and Payment configuration list endpoints.
var transactionData = { 'key': 'cf3cd5cc-43ef-4f89-9170-03c4fc55be61', 'payment_configuration_id': 'f086c1c9-5512-4386-a9a4-ecc6fe755f64', 'amount': 10.00 };
var transactionData = {
'key': 'cf3cd5cc-43ef-4f89-9170-03c4fc55be61',
'payment_configuration_id': 'f086c1c9-5512-4386-a9a4-ecc6fe755f64',
'amount': 10.00
};
To open the payment form, call the corresponding payment method by passing in your transaction configuration object.
Blackbaud_OpenPaymentForm(transactionData); // credit card transaction
Blackbaud_OpenPaymentForm(transactionData); // credit card transaction
Blackbaud_OpenPaymentForm()
Checkout also accepts additional optional configurations. For information about all parameters, see transaction parameters.
The following transaction types are currently supported by Blackbaud Checkout:
To trigger the form submission on a page that uses a <form>
data-formtype="bbCheckout"
<form>
<form action="/" method="post" data-formtype="bbCheckout"></form>
<form action="/" method="post" data-formtype="bbCheckout"></form>
By default, Blackbaud Checkout does not auto-submit forms without this attribute.
After you configure the client form and invoke the payment method, the Checkout form appears. If Checkout encounters an error, it triggers a checkoutError
Error code | Description |
---|---|
1001 | General network failure |
1003 | Missing Blackbaud Secure Payments public key. To view your key, see the Public key endpoint. |
1004 | A required field is missing or invalid. For required fields by transaction type, see the transaction parameters. |
1005 | Network failure reported by Checkout transaction endpoint |
1006 | Unsupported browser |
The calling application can handle errors by subscribing to the checkoutError
document.addEventListener('checkoutError', function (event) { console.log('errorText: ', event.detail.errorText); console.log('errorCode: ', event.detail.errorCode); });
document.addEventListener('checkoutError', function (event) {
console.log('errorText: ', event.detail.errorText);
console.log('errorCode: ', event.detail.errorCode);
});
The Blackbaud Checkout process can trigger the following events.
Event | Description | Returns |
---|---|---|
checkoutReady | bbCheckout.js file downloaded and ready | |
checkoutLoaded | payment form was requested and is displayed | |
checkoutComplete | Payment successfully processed and form closed | [Transaction Token] |
checkoutCancel | Payment form closed by user | |
checkoutError | Error occurred while processing. | [Error Message], [Error Code] |
Sample usage:
document.addEventListener('checkoutComplete', function (event) { console.log('Token: ', event.detail.transactionToken); });
document.addEventListener('checkoutComplete', function (event) {
console.log('Token: ', event.detail.transactionToken);
});
After donors complete transactions on the Blackbaud Checkout payment page, a hidden input with the transaction token (named transactiontoken
bbCheckout
<input type="hidden" name="transactiontoken" value="34d65a59-4e5f-4913-ab18-03d33b874455" />
<input type="hidden" name="transactiontoken" value="34d65a59-4e5f-4913-ab18-03d33b874455" />
A custom event is also triggered indicating a successful transaction. This can be handled by subscribing to the checkoutComplete
document.addEventListener("checkoutComplete", function(event) { console.log('Token:', event.detail.transactionToken); });
document.addEventListener("checkoutComplete", function(event) {
console.log('Token:', event.detail.transactionToken);
});
If a <form>
data-formtype="bbCheckout"
After you receive the checkoutComplete
To stop Blackbaud Checkout from submitting the form, the data-disable-submit
bbCheckout
true
Blackbaud Checkout supports mobile devices through responsive design, but the underlying page that launches Checkout can affect its display. To ensure proper rendering, we recommend the following:
Web pages that integrate with Blackbaud Checkout should include the appropriate meta tags for responsive design.
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Web pages that integrate with Blackbaud Checkout should disable vertical scrolling when loading the payment form. This prevents additional scrollbars from being added to the UI and potentially confusing users.