장바구니를 만들고 있습니다. 지불 게이트웨이로 가기 전에 주문을 저장하고 싶습니다. 결제 게이트웨이를 사용하려면 외부 주소로 POST를 보내야하지만 컨트롤러 작업에서이를 수행하는 방법은 필요하지 않습니다.POST 변수를 외부 URL로 보내는 방법은 무엇입니까?
public function executeBuy(sfWebRequest $request)
{
sfProjectConfiguration::getActive()->loadHelpers('Url');
// save the order
$this->order = new Order();
$this->save
//etc....
//go to TPV Payment gateway
$dsAmount = (float)$order->getPriceWithShipping() * 100;
$dsOrder = (int)$order->getId() * 400;
$dsMerchantCode = (int)sfConfig::get('app_tpv_merchant_code');
$dsCurrency = (int)sfConfig::get('app_tpv_merchant_currency');
$dsMerchantURL = url_for('cart/ipn', true, array(
'sf_culture' => $this->getUser()->getCulture(),
));
$options = array(
'Ds_Merchant_Amount' => $dsAmount,
'Ds_Merchant_Currency' => $dsCurrency,
'Ds_Merchant_Order' => $dsOrder,
'Ds_Merchant_Titular' => $order->getAddress()->getCustomer()->getNameAndLastName(),
'Ds_Merchant_MerchantCode' => $dsMerchantCode,
'Ds_Merchant_MerchantURL' => $dsMerchantURL,
'Ds_Merchant_MerchantSignature' => $digest,
'Ds_Merchant_Terminal' => $dsCurrency
);
//how to send post $options variables to external url?
}
게시 변수가있는 URL을 열어야합니다! 태그 양식처럼 제출하고 withouth html – Mauro
컬은 당신을 위해 그것을 할 수 있습니다. – dubvfan87
같은 창에서 어떻게 열 수 있습니까? – Mauro