Payment Widget Support

Payment Widget Integration

You can easily integrate Alternative Payments' Payment Widget which enables all the necessary processes for making a fast, secure, simple and personalized checkout.

Click on "Pay with Alternative Payments" to see our Payment Widget in live mode. If you want to see how it works, you need to fill out the required fields to complete the transaction.

Tokenization

Payments processed by Alternative Payments® are Tokenized and use SSL Encryption. Sensitive payment information is automatically converted to a uniqe token which is sent to our secure servers for validation. All sensitive consumer data that should not be stored, transferred or logged on your server for security reasons is securely processed by our company with the highest PCI security standards.

Widget Flow

Local Payments Widget Flow

Supported Payment Options

SEPA Direct Debit
ideal payment method
giropay payment method
eps payment method
przelewy24 payment method
POLi Payment Method

How to implement

After creating a test account download and extract ap-php-sdk to your server.

Locate the ap-php-sdk/AlternativePayments.php file and insert your Public and Secret API keys.

You must insert your API keys. After the registration process you will be provided with the API Test Keys and API Production Keys, the parameters needed to start accepting payments through our payment system.

NOTE: Production API Keys are avaliable once you are verified, and are used to proccess live transactions.

Insert the script below before the opening tag of your webpage, ie
<!DOCTYPE html>
<html>


        <?php require_once 'ap-php-sdk/AlternativePayments.php';

        $product_data = (object) array(

                'currency' => "USD";
                'amount' => "125.00";
                'productDescription' => "Red T-shirt";
                'formPost' => isset($_POST) ? $_POST : '', 
                'successUrl' => "https://alternativepayments.com/message/success.html";
                'cancelUrl' => "https://alternativepayments.com/message/failure.html";
                );
        $transaction_status = $AlternativePayment->transaction($product_data);
        ?>
        

Insert the script below before the closing </head> tag of your webpage

                                   
            <script>
            var AP_BUTTONS = ['PaymentButton1'];
            </script>
        
    

You are required to embed the payment widget code to your page.



        <form method="post">
            <div 
            data-ap-amount="<?php echo $product_data->amount; ?>"
            data-ap-button-text="Pay using Alternative Payments Widget"
            data-ap-company-name="Alternative Payments"
            data-ap-currency="<?php echo $product_data->currency; ?>"
            data-ap-description="<?php echo $product_data->productDescription; ?>"
            data-ap-extra="extra desc area"
            data-ap-public-key="<?php echo $AlternativePayment->getPublicKey(); ?>"
            data-ap-setup="SET_FORM_VALUES"
            data-ap-theme="dark"
            id="PaymentButton1"
            </div 
        </form>

    

We have also additional widget theme that can be set using additional paramater:

data-ap-theme="light"

In your webpage include folowing javascript file:

<script src="https://widget.alternativepayments.com/v2AP/js/payment-button.js" type="text/javascript"></script>
                                                

After line 178 in ap-php-sdk/lib/AlternativePayments/request.php you will see:

$curl = curl_init($url);
/* Begin windows ssl line. This next line is for windows ssl. remove if not on windows using ssl */
/* curl_setopt($curl, CURLOPT_CAINFO, 'C:\Program Files (x86)\PHP\v5.6\extras\ssl\curl-ca-bundle.crt'); */
/* end windows using ssl */

Line 180 needs to be enabled and pointing to your .crt file if you are in a Windows hosting environment and using SSL.

V1 Support Page