【问题标题】:Having an issue in moyasar payment APIsmoyasar 支付 API 出现问题
【发布时间】:2019-08-05 08:09:08
【问题描述】:

嗨朋友们,我正在研究 moyasar 支付 API。我在发布付款时遇到困难。我正在关注他们的 API 文档。 https://moyasar.com/docs/api/?shell#the-payment-object 我已按照文档进行操作,但仍未成功。

require_once 'vendor/autoload.php';    

Moyasar\Client::setApiKey("my secrete key");

$data = [
   "id"=> "d1d3-5f72-9056-191683f55872",
   "status"=> "paid",
   "amount"=> 88571,
   "fee"=> 1580,
   "currency"=> "SAR",
   "refunded"=> 0,
   "refunded_at"=> null,
   "description"=> null,
   "amount_format"=> "885.71 SAR",
   "fee_format"=> "15.80 SAR",
   "refunded_format"=> "0.00 SAR",
   "invoice_id"=> "a1be-5b13-a281-b27a4a6dad39",
   "ip"=> null,
   "callback_url"=> null,
   "created_at"=> "2016-05-11T17=>04=>17.000Z",
   "updated_at"=> "2016-05-12T17=>04=>19.633Z",
   "source"=> [
      "type"=> "creditcard",
      "company"=> "visa",
      "name"=> "Customer Name",
      "number"=> "xxxx-xxxx-xxxx-xxxx",
      "message"=> null,
      "transaction_url"=> null
   ]
];

try{
   $response = Moyasar\Client::post("https://api.moyasar.com/v1/payments", $data);
}
catch(Exception $ex){
   echo $ex->getMessage();
}

$data = json_decode($response);

echo '<pre>'.print_r($data, true).'</pre>';

我收到错误

客户端错误:POST https://api.moyasar.com/v1/payments 导致 404 Not Found 响应:{"type":"api_error","message":"Object not found","errors":null}

如果有人能提供帮助,我将非常感激。

【问题讨论】:

    标签: php api payment


    【解决方案1】:

    如果您返回 Moyasar 的 API 文档,您会发现以下引用:

    除非您满足 PCI DSS 合规性要求并且它适用于您,否则您无法通过包装库创建付款。查看通过 Moyasar 付款表单创建付款。

    最近已从库中删除创建付款

    要创建付款,您只能使用 Moyasar 表单,如下所述:https://moyasar.com/docs/payments/create-payment/mpf/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-04
      • 1970-01-01
      • 1970-01-01
      • 2014-12-31
      • 1970-01-01
      • 2011-02-25
      • 2015-12-27
      • 2012-01-02
      相关资源
      最近更新 更多