답글 내용:
공식 SDK를 다운로드한 후 URL을 반환하려면 Native.php의 메서드를 사용해야 할까요, 아니면 Native_notify.php의 메서드를 사용해야 할까요? ? 어느쪽으로 가야할지 모르겠어요
native.php
열어서 살펴보세요. 알고 계실 겁니다
code_url을 통해 2 생성 WeChat에서 QR 코드를 스캔하면 결제 페이지가 나타납니다
위는 iOS용 Mode 2 WeChat 스캔 코드 결제를 제공하는 PHP에 대한 내용입니다. .더 많은 관련 내용은 PHP 중국어 홈페이지(www.php .cn)를 참고해주세요!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
$notify = new NativePay();
$url1 = $notify ->GetPrePayUrl( "123456789" );
$input = new WxPayUnifiedOrder();
$input ->SetBody( "test" );
$input ->SetAttach( "test" );
$input ->SetOut_trade_no(WxPayConfig::MCHID. date ( "YmdHis" ));
$input ->SetTotal_fee( "1" );
$input ->SetTime_start( date ( "YmdHis" ));
$input ->SetTime_expire( date ( "YmdHis" , time() + 600));
$input ->SetGoods_tag( "test" );
$input ->SetNotify_url( "http://paysdk.weixin.qq.com/example/notify.php" );
$input ->SetTrade_type( "NATIVE" );
$input ->SetProduct_id( "123456789" );
$result = $notify ->GetPayUrl( $input );
$url2 = $result [ "code_url" ];
|
로그인 후 복사