yoone-wc-moneris-payments/includes/interfaces/class-yoone-moneris-api-int...

41 lines
1.2 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if (! defined('ABSPATH')) {
exit;
}
/**
* Yoone Moneris API 接口定义
* 提供令牌化、扣款与退款的统一方法签名,便于后续替换/扩展实现。
*/
interface Yoone_Moneris_API_Interface
{
/**
* 令牌化卡片(添加到 Moneris Vault
*
* @param array{number:string,exp_month:string|int,exp_year:string|int,cvc?:string} $card
* @param int|null $customer_id
* @return array{success:bool,token?:string,last4?:string,brand?:string,exp_month?:string,exp_year?:string,error?:string}
*/
public function tokenize_card($card, $customer_id = null);
/**
* 使用令牌扣款。
*
* @param string $token
* @param float $amount
* @param string $currency
* @param int $order_id
* @param bool $capture
* @return array{success:bool,transaction_id?:string,error?:string}
*/
public function charge_token($token, $amount, $currency, $order_id, $capture = true);
/**
* 退款。
*
* @param string $transaction_id
* @param float $amount
* @return array{success:bool,error?:string}
*/
public function refund($transaction_id, $amount);
}