Class: CloudpaymentsRuby::Resources::Payments::Tokens
- Inherits:
-
Object
- Object
- CloudpaymentsRuby::Resources::Payments::Tokens
- Defined in:
- lib/cloudpayments_ruby/resources/payments/tokens.rb
Instance Method Summary collapse
-
#auth(account_id:, amount:, token:, tr_initiator_code:, currency: nil, description: nil, email: nil, invoice_id: nil, ip_address: nil, json_data: nil, payer: nil, payment_scheduled: nil, request_options: {}) ⇒ CloudpaymentsRuby::Models::Payments::TokenAuthResponse
Двухстадийная оплата по токену (рекарринг).
-
#charge(account_id:, amount:, token:, tr_initiator_code:, currency: nil, description: nil, email: nil, invoice_id: nil, ip_address: nil, json_data: nil, payer: nil, payment_scheduled: nil, request_options: {}) ⇒ CloudpaymentsRuby::Models::Payments::TokenChargeResponse
Одностадийная оплата по токену (рекарринг).
-
#initialize(client:) ⇒ Tokens
constructor
private
A new instance of Tokens.
Constructor Details
#initialize(client:) ⇒ Tokens
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Tokens.
104 105 106 |
# File 'lib/cloudpayments_ruby/resources/payments/tokens.rb', line 104 def initialize(client:) @client = client end |
Instance Method Details
#auth(account_id:, amount:, token:, tr_initiator_code:, currency: nil, description: nil, email: nil, invoice_id: nil, ip_address: nil, json_data: nil, payer: nil, payment_scheduled: nil, request_options: {}) ⇒ CloudpaymentsRuby::Models::Payments::TokenAuthResponse
Двухстадийная оплата по токену (рекарринг)
Выполняет авторизацию (холдирование средств) по сохранённому токену карты. Для списания необходимо вызвать метод confirm.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/cloudpayments_ruby/resources/payments/tokens.rb', line 43 def auth(params) parsed, = CloudpaymentsRuby::Payments::TokenAuthParams.dump_request(params) @client.request( method: :post, path: "payments/tokens/auth", body: parsed, model: CloudpaymentsRuby::Models::Payments::TokenAuthResponse, options: ) end |
#charge(account_id:, amount:, token:, tr_initiator_code:, currency: nil, description: nil, email: nil, invoice_id: nil, ip_address: nil, json_data: nil, payer: nil, payment_scheduled: nil, request_options: {}) ⇒ CloudpaymentsRuby::Models::Payments::TokenChargeResponse
Одностадийная оплата по токену (рекарринг)
Выполняет оплату в одну стадию по сохранённому токену карты. Токен выдаётся системой после первой оплаты по криптограмме.
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/cloudpayments_ruby/resources/payments/tokens.rb', line 90 def charge(params) parsed, = CloudpaymentsRuby::Payments::TokenChargeParams.dump_request(params) @client.request( method: :post, path: "payments/tokens/charge", body: parsed, model: CloudpaymentsRuby::Models::Payments::TokenChargeResponse, options: ) end |