コード例 #1
0
ファイル: Client.php プロジェクト: siparker/gocardless-whmcs
 /**
  * Generate mandatory payment parameters: client_id, nonce and timestamp
  *
  * @return array Mandatory payment parameters
  */
 public function generate_mandatory_params()
 {
     // Create new UTC date object
     $date = new DateTime(null, new DateTimeZone('UTC'));
     return array('client_id' => $this->account_details['app_id'], 'nonce' => GoCardless_Client::generate_nonce(), 'timestamp' => $date->format('Y-m-d\\TH:i:s\\Z'));
 }
コード例 #2
0
    $merchant = $gocardless_client->merchant();
    print_r($merchant);
    echo '</pre></blockquote>';
    echo 'echo $gocardless_client->merchant()->pre_authorizations()';
    echo '<blockquote><pre>';
    $preauths = $gocardless_client->merchant()->pre_authorizations();
    print_r($preauths);
    echo '</pre></blockquote>';
    echo '$gocardless_client->create_bill($pre_auth_details)';
    echo '<blockquote><pre>';
    $pre_auth_details = array('pre_authorization_id' => '014PS77JW3', 'amount' => '5.00');
    $bill = $gocardless_client->create_bill($pre_auth_details);
    print_r($bill);
    echo '</pre></blockquote>';
    $account_details = array('app_id' => null, 'app_secret' => null, 'access_token' => null, 'merchant_id' => null);
    $gocardless_client2 = new GoCardless_Client($account_details);
    echo 'echo $gocardless_client2->merchant()';
    echo '<blockquote><pre>';
    $merchant = $gocardless_client2->merchant();
    print_r($merchant);
    echo '</pre></blockquote>';
    echo '$gocardless_client2->merchant()->pre_authorizations()';
    echo '<blockquote><pre>';
    $preauths = $gocardless_client2->merchant()->pre_authorizations();
    print_r($preauths);
    echo '</pre></blockquote>';
} else {
    // No access token so show new authorization link
    echo '<h2>Partner authorization</h2>';
    $authorize_url_options = array('redirect_uri' => 'http://localhost/examples/demo_partner.php');
    $authorize_url = $gocardless_client->authorize_url($authorize_url_options);