Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array(
- 'userName' => 'test',
- 'password' => 'test',
- 'orderNumber' => '16_5',
- 'amount' => 1000,
- 'returnUrl' => SHOP_URL . '?wc-api=wc_acbapayment&acbapayment=result&order_id=' . $order_id . $extra_url_param,
- );
- $acbacurl = curl_init();
- if ($acbacurl) {$this->acba_logger('276curl-yes');}else{$this->acba_logger('276curl-no');};
- $c=curl_setopt_array($acbacurl, array(
- CURLOPT_URL => $action_adr,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_POST => true,
- CURLOPT_POSTFIELDS => http_build_query($args)
- ));
- if( ! $response = curl_exec($acbacurl))
- {
- $this->acba_logger('285curl_error:'.curl_error($acbacurl));exit('Error '.curl_error($acbacurl));
- }
- //$response = curl_exec($acbacurl);
- curl_close($acbacurl);
- $response = json_decode($response, true);
- https://ipaytest.arca.am:8445/payment/rest/register.do?userName=test&password=test&orderNumber=16_12&amount=1000&returnUrl=https%3A%2F%2Fblog.studentstesting.com%2F%3Fwc-api%3Dwc_acbapayment%26acbapayment%3Dresult%26order_id%3D16%26wc-callb%3Dcallback_function
- <form class="arca__form" action="https://ipaytest.arca.am:8445/payment/rest/register.do" method="post">
- <?php
- foreach ($args as $key => $value) {
- echo "<input type='text' nmae='{$key}' value='".urlencode($value)."' />";
- }
- ?>
- <input type='submit'/>
- </form>
- <script>
- $('.arca__form').on('submit',function(e){
- e.preventDfault();
- $.ajax({
- url: $(this).attr('action'),
- mthod: $(this).attr('method'),
- dataType: 'json',
- data: $(this).serializeArray(),
- success:function(data){
- console.log(data);
- }
- });
- });
- </script>
Add Comment
Please, Sign In to add comment