Getting Started

Version: 1.0.0

Using Solidpay API you can Receive Payment in any currency from you customers.

To use this API, you need an API KEY.Please create account or login into the Solidpay to get your owl API KEY from profile section.

                             
     #API Endpoint
     http://solidpay.trustyscript.com/payment/connection
                             
                         

GET PAYMENT CONNECTION

To get payment connection you need to make a POST call to the following url :

http://solidpay.trustyscript.com/payment/connection

Sandbox API Credentials :

Email: [email protected] Verification Code: 11223

HEADERS PARAMETER
Field Description
Accept application/json
x-api-key IvHcUZARLSHOJrt2EA7W8NcQAKwcHfGrGWkDyr2HY2wOwP5HUGlV8Wj9lJUc
QUERY PARAMETERS
Field Type Description
ref_code String The referral code will be used to identify your customer payment
amount decimal Your user payment amount
currency String Currency must be uppercase. like: USD,RUB,INR
ipn_url string Webhooks payment url instant payment notification
success_url String This url redirect when user payment successfully
cancel_url String This url redirect when user payment failed or cancel
customer_email string Your customer email address

    #Here is a curl example
    $parameters = [
        'ref_code' => 'DFU80XZIKS',
        'currency' => 'USD',
        'amount' => 50.00,
        'ipn_url' => 'https://webhook.site/49a36acb-dd05-4502-9c2c-72d4cc390f29',
        'cancel_url' => 'http://example.com/cancel_url.php',
        'success_url' => 'http://example.com/success_url.php',
        'customer_email' => '[email protected]',

    ];
    $headers = [
        'Accept: application/json',
        'x-api-key: IvHcUZARLSHOJrt2EA7W8NcQAKwcHfGrGWkDyr2HY2wOwP5HUGlV8Wj9lJUc',
    ];


    $ch = curl_init();

    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_URL, 'http://solidpay.trustyscript.com/payment/connection');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    curl_close($ch);
    print_r($response);


    #Success Response :
    {
        "success": true,
        "message": "Redirect to url for payment connection.",
        "redirect_url": "http://solidpay.trustyscript.com/payment/checkout?payment_id=xnbWryya1quM3caFWW8
                                    GCxGdHfAdowXhLqOTPYFzDjj55f72wshSHefIUvCi32AELH04w
                                    kcEHRsi1axeYcbUujd0M97z8jfopRnf"
    }
    #Invalid API Response :
    {
        "message": "Unauthenticated."
    }
                            
                        

PAYMENT VERIFICATION WITH WEBHOOKS IPN

This url use instant payment notification for your user


     #IPN functionality

    $signature = $request->header('signature');

    $yourSignature = hash_hmac('sha256', 'ref_code', 'Your Api secret Key');

    if ($_POST['status'] == 'success' && $signature == $yourSignature){
    // your user payment done. your logic apply this section
    }