Card Request Core

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{url}}/v2/transact',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "request_ref": "{{request-ref}}",
    "request_type": "open_account",
    "auth": {
        "type": null,
        "secure": null,
        "auth_provider": "Polaris",
        "route_mode": null
    },
    "transaction": {
        "mock_mode": "Live",
        "transaction_ref": "{{transaction-ref}}",
        "transaction_desc": "A random transaction",
        "transaction_ref_parent": null,
        "amount": 1000,
        "customer": {
            "customer_ref": "2348033000989",
            "firstname": "John",
            "surname": "Doe",
            "email": "john@doe.com",
            "mobile_no": "2348033000989"
        },
        "meta": {
            "a_key": "a_meta_value_1",
            "b_key": "a_meta_value_2"
        },
        "details": {
            "name_on_account": "John J. Doe",
            "middlename": "Jane",
            "dob": "2005-05-13",
            "gender": "M",
            "title": "Mr",
            "address_line_1": "23, Okon street, Ikeja",
            "address_line_2": "Ikeja",
            "city": "Mushin",
            "state": "Lagos State",
            "country": "Nigeria"
        }
    }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer {{api-key}}',
    'Signature: {{signature}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
SaveSave Discount
Logo
Shopping cart