Guest User

Untitled

a guest
Nov 24th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. $args = array(
  2. 'userName' => 'test',
  3. 'password' => 'test',
  4. 'orderNumber' => '16_5',
  5. 'amount' => 1000,
  6. 'returnUrl' => SHOP_URL . '?wc-api=wc_acbapayment&acbapayment=result&order_id=' . $order_id . $extra_url_param,
  7. );
  8. $acbacurl = curl_init();
  9. if ($acbacurl) {$this->acba_logger('276curl-yes');}else{$this->acba_logger('276curl-no');};
  10. $c=curl_setopt_array($acbacurl, array(
  11. CURLOPT_URL => $action_adr,
  12. CURLOPT_RETURNTRANSFER => true,
  13. CURLOPT_POST => true,
  14. CURLOPT_POSTFIELDS => http_build_query($args)
  15. ));
  16. if( ! $response = curl_exec($acbacurl))
  17. {
  18. $this->acba_logger('285curl_error:'.curl_error($acbacurl));exit('Error '.curl_error($acbacurl));
  19. }
  20. //$response = curl_exec($acbacurl);
  21. curl_close($acbacurl);
  22.  
  23. $response = json_decode($response, true);
  24.  
  25. 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
  26.  
  27. <form class="arca__form" action="https://ipaytest.arca.am:8445/payment/rest/register.do" method="post">
  28. <?php
  29. foreach ($args as $key => $value) {
  30. echo "<input type='text' nmae='{$key}' value='".urlencode($value)."' />";
  31. }
  32. ?>
  33. <input type='submit'/>
  34. </form>
  35.  
  36. <script>
  37. $('.arca__form').on('submit',function(e){
  38. e.preventDfault();
  39.  
  40. $.ajax({
  41. url: $(this).attr('action'),
  42. mthod: $(this).attr('method'),
  43. dataType: 'json',
  44. data: $(this).serializeArray(),
  45. success:function(data){
  46. console.log(data);
  47. }
  48. });
  49. });
  50. </script>
Add Comment
Please, Sign In to add comment