Skip to content

保险商户受理保险自动续费扣款

商户调用「预约保险自动续费」接口预约成功后,可调用本接口发起委托代扣扣款。系统受理扣款请求后,异步进行扣款,并通过商户指定的回调地址通知扣费结果。

请求参数类型描述
jsonobject声明请求的JSON数据结构
appidstring应用ID
out_trade_nostring商户订单号
descriptionstring商品描述
transaction_notify_urlstring通知地址
contract_idstring委托代扣协议ID
policy_period_idnumber保单的扣费周期编号
amountobject扣费金额信息
totalnumber金额
currencystring货币类型
goods_tagstring订单优惠标记
attachstring附加数据
php
$instance->v3->papay->insurancePay->transactions->apply->postAsync([
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'out_trade_no' => '1217752501201407033233368018',
    'description' => 'Image形象店-深圳腾大-QQ公仔',
    'transaction_notify_url' => 'https://www.qq.com/',
    'contract_id' => '123124412412423431',
    'policy_period_id' => 1,
    'amount' => [
      'total' => 1,
      'currency' => 'CNY',
    ],
    'goods_tag' => 'DISCOUNTS',
    'attach' => '自定义数据',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/papay/insurance-pay/transactions/apply')->postAsync([
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'out_trade_no' => '1217752501201407033233368018',
    'description' => 'Image形象店-深圳腾大-QQ公仔',
    'transaction_notify_url' => 'https://www.qq.com/',
    'contract_id' => '123124412412423431',
    'policy_period_id' => 1,
    'amount' => [
      'total' => 1,
      'currency' => 'CNY',
    ],
    'goods_tag' => 'DISCOUNTS',
    'attach' => '自定义数据',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/papay/insurance-pay/transactions/apply']->postAsync([
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'out_trade_no' => '1217752501201407033233368018',
    'description' => 'Image形象店-深圳腾大-QQ公仔',
    'transaction_notify_url' => 'https://www.qq.com/',
    'contract_id' => '123124412412423431',
    'policy_period_id' => 1,
    'amount' => [
      'total' => 1,
      'currency' => 'CNY',
    ],
    'goods_tag' => 'DISCOUNTS',
    'attach' => '自定义数据',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->papay->insurancePay->transactions->apply->post([
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'out_trade_no' => '1217752501201407033233368018',
    'description' => 'Image形象店-深圳腾大-QQ公仔',
    'transaction_notify_url' => 'https://www.qq.com/',
    'contract_id' => '123124412412423431',
    'policy_period_id' => 1,
    'amount' => [
      'total' => 1,
      'currency' => 'CNY',
    ],
    'goods_tag' => 'DISCOUNTS',
    'attach' => '自定义数据',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/papay/insurance-pay/transactions/apply')->post([
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'out_trade_no' => '1217752501201407033233368018',
    'description' => 'Image形象店-深圳腾大-QQ公仔',
    'transaction_notify_url' => 'https://www.qq.com/',
    'contract_id' => '123124412412423431',
    'policy_period_id' => 1,
    'amount' => [
      'total' => 1,
      'currency' => 'CNY',
    ],
    'goods_tag' => 'DISCOUNTS',
    'attach' => '自定义数据',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/papay/insurance-pay/transactions/apply']->post([
  'json' => [
    'appid' => 'wxd678efh567hg6787',
    'out_trade_no' => '1217752501201407033233368018',
    'description' => 'Image形象店-深圳腾大-QQ公仔',
    'transaction_notify_url' => 'https://www.qq.com/',
    'contract_id' => '123124412412423431',
    'policy_period_id' => 1,
    'amount' => [
      'total' => 1,
      'currency' => 'CNY',
    ],
    'goods_tag' => 'DISCOUNTS',
    'attach' => '自定义数据',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_trade_nostring商户订单号
amountobject扣费金额信息
totalnumber金额
currencystring货币类型

参阅 官方文档

Published on the GitHub by TheNorthMemory