代码拉取完成,页面将自动刷新
同步操作将从 wslxj/paypal 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package paypal
/*
* 付款
* https://developer.paypal.com/docs/api/payments/v2/#authorizations
*/
import (
"fmt"
"paypal/model"
)
// GetAuthorizedPaymentDetails 获取付款授权详情
func (p *Client) GetAuthorizedPaymentDetails(req *model.ReqGetAuthorizedPaymentDetails) (res model.ResGetAuthorizedPaymentDetails, err error) {
api := fmt.Sprintf(AuthorizedPaymentDetailsAPI, req.AuthorizationId)
if err = p.CallApiRequest(HttpMethodGet, api, nil, &res); err != nil {
return
}
return
}
// CaptureAuthorizedPayment 付款授权捕获
func (p *Client) CaptureAuthorizedPayment(req *model.ReqCaptureAuthorizedPayment) (res model.ResCaptureAuthorizedPayment, err error) {
api := fmt.Sprintf(CaptureAuthorizedPaymentAPI, req.AuthorizationId)
if err = p.CallApiRequest(HttpMethodPost, api, req, &res); err != nil {
return
}
return
}
// ReauthorizeAuthorizedPayment 付款重新授权
func (p *Client) ReauthorizeAuthorizedPayment(req *model.ReqReauthorizeAuthorizedPayment) (res model.ResReauthorizeAuthorizedPayment, err error) {
api := fmt.Sprintf(ReauthorizeAuthorizedPaymentAPI, req.AuthorizationId)
if err = p.CallApiRequest(HttpMethodPost, api, req, &res); err != nil {
return
}
return
}
// VoidAuthorizedPayment 无效的授权付款
func (p *Client) VoidAuthorizedPayment(req *model.ReqVoidAuthorizedPayment) (err error) {
api := fmt.Sprintf(VoidAuthorizedPaymentAPI, req.AuthorizationId)
if err = p.CallApiRequest(HttpMethodPost, api, req, nil); err != nil {
return
}
return
}
// GetCapturedPaymentDetails 获取捕获的付款详情
func (p *Client) GetCapturedPaymentDetails(req *model.ReqGetCapturedPaymentDetails) (res model.ResGetCapturedPaymentDetails, err error) {
api := fmt.Sprintf(CapturedPaymentDetailsAPI, req.CaptureId)
if err = p.CallApiRequest(HttpMethodGet, api, nil, &res); err != nil {
return
}
return
}
// RefundCapturedPayment 退还被捕获的付款
func (p *Client) RefundCapturedPayment(req *model.ReqRefundCapturedPayment) (res model.ResRefundCapturedPayment, err error) {
api := fmt.Sprintf(RefundCapturedPaymentAPI, req.CaptureId)
if err = p.CallApiRequest(HttpMethodPost, api, req, &res); err != nil {
return
}
return
}
// GetRefundDetails 获取退款详情
func (p *Client) GetRefundDetails(req *model.ReqGetRefundDetails) (res model.ResGetRefundDetails, err error) {
api := fmt.Sprintf(RefundDetailsAPI, req.RefundId)
if err = p.CallApiRequest(HttpMethodPost, api, nil, &res); err != nil {
return
}
return
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。