【问题标题】:How to integrate dwolla payment API如何集成dwolla支付API
【发布时间】:2015-08-17 07:26:46
【问题描述】:

我正在尝试在我的网站中集成 dwolla 支付 API 代码。下面给出了我尝试过的内容.....输出为空 请检查代码...并帮助我 或者给我 dwolla API 集成的示例代码。

 $post_url = "https://www.dwolla.com/oauth/rest/offsitegateway/checkouts";
            $post_values = array(
  "client_id" => "PJ510OxKhn2dZKrwAnYDiEjqaEun6D62kzzDedzxb1wSqzCieG",
  "client_secret"=> "M9cy0Zw2ATuF8vRBRmyeSjmQ0SRCmwatA8YnKE8yX1Ikr6XKBi",
  "callback"=> "http://localhost/WC/christian/register/dwolla2",
  "redirect"=> "http://localhost/WC/christian/register/dwolla2",
  "allowGuestCheckout"=> "true",
  "checkoutWithApi"=> "false",
  "orderId"=> "foo123",
  "allowFundingSources"=> "true",
  "additionalFundingSources"=> "true",
  "purchaseOrder"=> array(
        "orderItems"=> array(
                "name"=> "T-Shirt", 
                "description"=> "Size: Large - Graphic Tee", 
                "quantity"=> "1", 
                "price"=> "15.00"
        ),
    "destinationId"=> "812-134-9523",
    "total"=> 15.00,
    "tax"=> 0.00,
    "shipping"=> 0.00,
    "discount"=> 0.00,
    "notes"=> "blahhh",
    "facilitatorAmount"=> 0,
    "metadata"=> array(
        "orderNum"=> "363498639",
        "category"=> "thing2"
    )
  )
);
            $post_string=json_encode($post_values);
            $request = curl_init($post_url);
            curl_setopt($request, CURLOPT_HEADER, 0); 
            curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); 
            curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($post_string)));
            curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); 
            curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); 
            $post_response = curl_exec($request); 
            curl_close($request);

           echo $post_response;

【问题讨论】:

    标签: php codeigniter api dwolla


    【解决方案1】:

    检查您的凭据,它会给出“无效的应用程序凭据”错误消息。

    【讨论】:

      猜你喜欢
      • 2018-08-21
      • 2016-01-29
      • 1970-01-01
      • 2016-10-01
      • 2021-05-03
      • 2011-11-24
      • 1970-01-01
      • 2021-02-11
      • 2017-01-01
      相关资源
      最近更新 更多