簡體   English   中英

如何集成dwolla支付API

[英]How to integrate dwolla payment API

我正在嘗試將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;

檢查您的憑據,它會顯示“無效的應用程序憑據”錯誤消息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM