phpwepay 支付成功后的重定向问题
redirect issue after wepay payment success in php
我在wepay支付成功后重定向有问题意味着我如何在这个wepay后重定向url
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();
}
尝试使用
$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
)
);
您可以在文档中了解如何在结帐完成后重定向用户:https://developer.wepay.com/api/api-calls/checkout#create。
您需要使用hosted_checkout
结构。这仅在您使用 WePay iFrame or Hosted page 处理付款时有效。
$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支付成功后重定向有问题意味着我如何在这个wepay后重定向url
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();
}
尝试使用
$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
)
);
您可以在文档中了解如何在结帐完成后重定向用户:https://developer.wepay.com/api/api-calls/checkout#create。
您需要使用hosted_checkout
结构。这仅在您使用 WePay iFrame or Hosted page 处理付款时有效。
$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
)
)
);