我们在php支付成功付款后重定向问题

时间:2017-12-28 07:29:56

标签: php url redirect payment wepay

付款成功后,我有一个问题需要重定向,这意味着如何在这个付费网址后重定向

https://stage.wepay.com/status/checkout_complete/1233455

这是我的代码

try { 
    $data['checkout']= $wepay->request('/checkout/create', array(
            'account_id' => $account_id, // ID of the account that you want the money to go to
            'amount' => 1, // dollar amount you want to charge the user
             'currency' => 'USD',
            'short_description' => "this is a test payment", // a short description of what the payment is for
            'type' => "goods", // the type of the payment - choose from GOODS SERVICE DONATION or PERSONAL              
        )
    );
    // print_r($data['checkout']);
} catch (WePayException $e) { // if the API call returns an error, get the error message for display later
    $data['error'] = $e->getMessage();
}

2 个答案:

答案 0 :(得分:1)

您可以在文档中查看完成结帐后如何重定向用户:https://developer.wepay.com/api/api-calls/checkout#create

您需要使用$data['checkout']= $wepay->request('/checkout/create', array( 'account_id' => $account_id, 'amount' => 1, 'currency' => 'USD', 'short_description' => "this is a test payment", 'type' => "goods", 'hosted_checkout' => array( // hosted checkout structure 'redirect_uri' => "http://google.com" // the url for redirect ) ) ); 结构。这仅在您使用WePay iFrame or Hosted page处理付款时才有效。

string

答案 1 :(得分:0)

尝试使用

$data['checkout']= $wepay->request('/checkout/create', array(
        'account_id' => $account_id, // ID of the account that you want the money to go to
        'amount' => 1, // dollar amount you want to charge the user
         'currency' => 'USD',
        'short_description' => "this is a test payment", // a short description of what the payment is for
        'type' => "goods", // the type of the payment - choose from GOODS SERVICE DONATION or PERSONAL
        'redirect_uri' => "http://google.com", // the url for redirect


    )
);
相关问题