【问题标题】:How to Send Gravity Form Entry Data to aspx third party url如何将重力表单条目数据发送到 aspx 第三方 url
【发布时间】:2019-01-08 18:27:14
【问题描述】:

这不是一个重复的问题。我有这个重力表单插件,可以将数据发送到第三方 URL。一切都在准备提交条目数据。第三方 URL 为 ASPX,数据为 XML,编码为 base64。所以我尝试使用$request = new WP_Http(); $response = $request->post( $post_url, array( 'body' => $data ) ); 并检查日志文件中的输出,我知道它有效,唯一的问题是它不会重定向到 aspx url。

我尝试curl 的结果也一样。

我尝试使用简码,但问题是无论我如何尝试,数据都不包含在表单中。

这是我的代码

Gravityforms code

【问题讨论】:

    标签: php xml api soap gravityforms


    【解决方案1】:

    我终于找到了这个问题的答案,所以这里有解决方案。

    首先创建一个 WordPress 过滤器

    add_filter( 'gform_confirmation_1', array( $this, 'paynamics_confirmation' ), 10, 3 );
    

    然后创建一个函数paynamics_confirmation 具有3 个属性$confirmation, $form, $entry

    public function paynamics_confirmation( $confirmation, $form, $entry) { 
    // From Settings
    $paynamics_url  = $this->get_plugin_setting( 'paynamics_endpoint_url');
    $data = $this->paynamics_data($entry, $form, $feed);
    $confirmation = '<form name="paynamics_send" id="paynamics_send" method="post" name="paynamics_payment" action="'.$paynamics_url.'">
                            <input type="hidden" name="paymentrequest" id="paymentrequest" value="'.$data.'">
                            <div class="paynamics_button_wrapper" style="text-align: center;margin: 0 auto;">
                                <input type="submit" value="Send To Paynamics" class="paynamics_button" id="paynamics_submit_button" style="background-color: #E46824;border: none;color: white;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;font-size: 16px;margin: 4px 2px;cursor: pointer;border-radius: 99px;">
                            </div>
    
                        </form>';
    return $confirmation;
    
    }
    

    【讨论】:

      猜你喜欢
      • 2016-11-15
      • 2020-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-30
      • 1970-01-01
      相关资源
      最近更新 更多