Class: UnivapayClientSdk::ChargesApi
- Defined in:
- lib/univapay_client_sdk/apis/charges_api.rb
Overview
ChargesApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#capture_charge(store_id, id, body, idempotency_key: nil) ⇒ ApiResponse
Captures a previously authorized charge (where
capturewas set to false during creation). -
#create_charge(idempotency_key: nil, body: nil) ⇒ ApiResponse
Creates a charge on a payment instrument (e.g. transaction token).
-
#create_customs_declaration(store_id, charge_id, body, idempotency_key: nil) ⇒ ApiResponse
Creates a customs declaration for a successful charge.
-
#get_charge(store_id, id, polling: nil) ⇒ ApiResponse
Retrieves the details of an existing charge.
-
#get_charge_issuer_token(store_id, id) ⇒ ApiResponse
Retrieves the necessary payment execution URL (for online payments) or bank account details (for bank transfers).
-
#get_charge_three_ds_issuer_token(store_id, id) ⇒ ApiResponse
Retrieves the 3-D Secure issuer token details required to authenticate a card charge.
-
#get_customs_declaration(store_id, charge_id, id, polling: false) ⇒ ApiResponse
Retrieves a customs declaration for a charge.
-
#list_all_charges(limit: 10, cursor: nil, cursor_direction: CursorDirectionQuery::DESC, last_four: nil, name: nil, exp_month: nil, exp_year: nil, from: nil, to: nil, email: nil, phone: nil, amount_from: nil, amount_to: nil, currency: nil, mode: nil, metadata: nil, transaction_token_id: nil) ⇒ ApiResponse
Lists all charges across all stores for the authenticated user.
-
#list_bank_transfer_ledgers(store_id, id) ⇒ ApiResponse
Retrieves bank transfer ledger entries associated with a charge.
-
#list_store_charges(store_id, limit: 10, cursor: nil, cursor_direction: CursorDirectionQuery::DESC, last_four: nil, name: nil, exp_month: nil, exp_year: nil, from: nil, to: nil, email: nil, phone: nil, amount_from: nil, amount_to: nil, currency: nil, mode: nil, metadata: nil, transaction_token_id: nil) ⇒ ApiResponse
Lists all charges for a specific store.
-
#patch_customs_declaration(store_id, charge_id, id, body, idempotency_key: nil) ⇒ ApiResponse
Updates a customs declaration and requeues processing.
-
#update_charge(store_id, id, idempotency_key: nil, body: nil) ⇒ ApiResponse
Use this request to add or modify arbitrary metadata on an existing charge.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from UnivapayClientSdk::BaseApi
Instance Method Details
#capture_charge(store_id, id, body, idempotency_key: nil) ⇒ ApiResponse
Captures a previously authorized charge (where capture was set to false
during creation). The capture amount must be less than or equal to the
authorized amount, and the currency must match.
of the store.
resource.
capturing an authorized charge.
idempotency key to prevent double charges and duplicate operations. We
recommend a randomly generated UUID (v4).
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 441 def capture_charge(store_id, id, body, idempotency_key: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/stores/{storeId}/charges/{id}/capture', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key')) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#create_charge(idempotency_key: nil, body: nil) ⇒ ApiResponse
Creates a charge on a payment instrument (e.g. transaction token). idempotency key to prevent double charges and duplicate operations. We recommend a randomly generated UUID (v4). creating a charge.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 16 def create_charge(idempotency_key: nil, body: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/charges', Server::DEFAULT) .header_param(new_parameter('application/json', key: 'Content-Type')) .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(Charge.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#create_customs_declaration(store_id, charge_id, body, idempotency_key: nil) ⇒ ApiResponse
Creates a customs declaration for a successful charge. Backend only accepts this request for WeChat Online and WeChat MPM charges. If a declaration already exists and is no longer pending, the backend updates its identity fields and restarts processing instead of creating a new record. of the store. of the charge. payload for creating a customs declaration. idempotency key to prevent double charges and duplicate operations. We recommend a randomly generated UUID (v4).
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 698 def create_customs_declaration(store_id, charge_id, body, idempotency_key: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/stores/{storeId}/charges/{chargeId}/customs', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(charge_id, key: 'chargeId') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key')) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(CustomsDeclarationWebhookData.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#get_charge(store_id, id, polling: nil) ⇒ ApiResponse
Retrieves the details of an existing charge. of the store. resource. true, instructs the API to internally poll the charge status until it changes from 'pending' (the initial status) to another status.
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 306 def get_charge(store_id, id, polling: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/stores/{storeId}/charges/{id}', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .query_param(new_parameter(polling, key: 'polling')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(Charge.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#get_charge_issuer_token(store_id, id) ⇒ ApiResponse
Retrieves the necessary payment execution URL (for online payments) or
bank account details (for bank transfers).
⚠️ Prerequisite: The charge status must be awaiting before
requesting the issuer token. If requested while the charge is in any
other status, an error will be returned.
of the store.
resource.
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 508 def get_charge_issuer_token(store_id, id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/stores/{storeId}/charges/{id}/issuer_token', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(IssuerToken.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#get_charge_three_ds_issuer_token(store_id, id) ⇒ ApiResponse
Retrieves the 3-D Secure issuer token details required to authenticate a
card charge.
⚠️ Prerequisites: 1. The charge must be created with three_ds.mode
set to normal or force. 2. You must poll the charge until its status
becomes awaiting before making this request.
Execution Flow: Once retrieved, the client (browser) must execute an
http_post request to the issuer_token URL. The payload object must
be formatted according to the content_type (e.g., URL-encoded) and sent
in the body. You can execute this via a redirect or inside an iframe. If
using an iframe, continue polling the charge status in the background
until it reaches successful, failed, or error.
of the store.
resource.
575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 575 def get_charge_three_ds_issuer_token(store_id, id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/stores/{storeId}/charges/{id}/three_ds/issuer_token', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ThreeDsIssuerToken.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#get_customs_declaration(store_id, charge_id, id, polling: false) ⇒ ApiResponse
Retrieves a customs declaration for a charge. Supports long polling when
polling=true, returning once the declaration leaves its current state or
the polling timeout is reached.
of the store.
of the charge.
customs declaration.
request open while waiting for a status change.
768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 768 def get_customs_declaration(store_id, charge_id, id, polling: false) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/stores/{storeId}/charges/{chargeId}/customs/{id}', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(charge_id, key: 'chargeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .query_param(new_parameter(polling, key: 'polling')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(CustomsDeclarationWebhookData.method(:from_hash)) .is_api_response(true) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', ApiErrorException) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#list_all_charges(limit: 10, cursor: nil, cursor_direction: CursorDirectionQuery::DESC, last_four: nil, name: nil, exp_month: nil, exp_year: nil, from: nil, to: nil, email: nil, phone: nil, amount_from: nil, amount_to: nil, currency: nil, mode: nil, metadata: nil, transaction_token_id: nil) ⇒ ApiResponse
Lists all charges across all stores for the authenticated user.
return in one page.
resource after which pagination should continue.
Pagination direction relative to the supplied cursor.
of the card. Note: If specified, name, exp_month, and exp_year
must also be included.
Note: If specified, last_four, exp_month, and exp_year must also
be included.
included.
Note: If specified, last_four, name, and exp_month must also be
included.
this date (ISO-8601).
date (ISO-8601).
amount greater than or equal to this value.
strictly less than this value.
(ISO-4217).
transaction token ID.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 101 def list_all_charges(limit: 10, cursor: nil, cursor_direction: CursorDirectionQuery::DESC, last_four: nil, name: nil, exp_month: nil, exp_year: nil, from: nil, to: nil, email: nil, phone: nil, amount_from: nil, amount_to: nil, currency: nil, mode: nil, metadata: nil, transaction_token_id: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/charges', Server::DEFAULT) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(cursor, key: 'cursor')) .query_param(new_parameter(cursor_direction, key: 'cursor_direction')) .query_param(new_parameter(last_four, key: 'last_four')) .query_param(new_parameter(name, key: 'name')) .query_param(new_parameter(exp_month, key: 'exp_month')) .query_param(new_parameter(exp_year, key: 'exp_year')) .query_param(new_parameter(from, key: 'from')) .query_param(new_parameter(to, key: 'to')) .query_param(new_parameter(email, key: 'email')) .query_param(new_parameter(phone, key: 'phone')) .query_param(new_parameter(amount_from, key: 'amount_from')) .query_param(new_parameter(amount_to, key: 'amount_to')) .query_param(new_parameter(currency, key: 'currency')) .query_param(new_parameter(mode, key: 'mode')) .query_param(new_parameter(, key: 'metadata')) .query_param(new_parameter(transaction_token_id, key: 'transaction_token_id')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ChargeList.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#list_bank_transfer_ledgers(store_id, id) ⇒ ApiResponse
Retrieves bank transfer ledger entries associated with a charge. of the store. resource.
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 632 def list_bank_transfer_ledgers(store_id, id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/stores/{storeId}/charges/{id}/bank_transfer_ledgers', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(BankTransferLedgerList.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#list_store_charges(store_id, limit: 10, cursor: nil, cursor_direction: CursorDirectionQuery::DESC, last_four: nil, name: nil, exp_month: nil, exp_year: nil, from: nil, to: nil, email: nil, phone: nil, amount_from: nil, amount_to: nil, currency: nil, mode: nil, metadata: nil, transaction_token_id: nil) ⇒ ApiResponse
Lists all charges for a specific store.
of the store.
return in one page.
resource after which pagination should continue.
Pagination direction relative to the supplied cursor.
of the card. Note: If specified, name, exp_month, and exp_year
must also be included.
Note: If specified, last_four, exp_month, and exp_year must also
be included.
included.
Note: If specified, last_four, name, and exp_month must also be
included.
this date (ISO-8601).
date (ISO-8601).
amount greater than or equal to this value.
strictly less than this value.
(ISO-4217).
transaction token ID.
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 216 def list_store_charges(store_id, limit: 10, cursor: nil, cursor_direction: CursorDirectionQuery::DESC, last_four: nil, name: nil, exp_month: nil, exp_year: nil, from: nil, to: nil, email: nil, phone: nil, amount_from: nil, amount_to: nil, currency: nil, mode: nil, metadata: nil, transaction_token_id: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/stores/{storeId}/charges', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(cursor, key: 'cursor')) .query_param(new_parameter(cursor_direction, key: 'cursor_direction')) .query_param(new_parameter(last_four, key: 'last_four')) .query_param(new_parameter(name, key: 'name')) .query_param(new_parameter(exp_month, key: 'exp_month')) .query_param(new_parameter(exp_year, key: 'exp_year')) .query_param(new_parameter(from, key: 'from')) .query_param(new_parameter(to, key: 'to')) .query_param(new_parameter(email, key: 'email')) .query_param(new_parameter(phone, key: 'phone')) .query_param(new_parameter(amount_from, key: 'amount_from')) .query_param(new_parameter(amount_to, key: 'amount_to')) .query_param(new_parameter(currency, key: 'currency')) .query_param(new_parameter(mode, key: 'mode')) .query_param(new_parameter(, key: 'metadata')) .query_param(new_parameter(transaction_token_id, key: 'transaction_token_id')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ChargeList.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#patch_customs_declaration(store_id, charge_id, id, body, idempotency_key: nil) ⇒ ApiResponse
Updates a customs declaration and requeues processing. Backend patching
preserves the original customs, certificate_id, and certificate_name
values and only accepts a new merchant_customs_no. Pending declarations
cannot be patched.
of the store.
of the charge.
customs declaration.
payload for patching a customs declaration.
idempotency key to prevent double charges and duplicate operations. We
recommend a randomly generated UUID (v4).
841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 841 def patch_customs_declaration(store_id, charge_id, id, body, idempotency_key: nil) @api_call .request(new_request_builder(HttpMethodEnum::PATCH, '/stores/{storeId}/charges/{chargeId}/customs/{id}', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(charge_id, key: 'chargeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key')) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(CustomsDeclarationWebhookData.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |
#update_charge(store_id, id, idempotency_key: nil, body: nil) ⇒ ApiResponse
Use this request to add or modify arbitrary metadata on an existing charge. of the store. resource. idempotency key to prevent double charges and duplicate operations. We recommend a randomly generated UUID (v4). updating charge metadata.
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 |
# File 'lib/univapay_client_sdk/apis/charges_api.rb', line 371 def update_charge(store_id, id, idempotency_key: nil, body: nil) @api_call .request(new_request_builder(HttpMethodEnum::PATCH, '/stores/{storeId}/charges/{id}', Server::DEFAULT) .template_param(new_parameter(store_id, key: 'storeId') .is_required(true) .should_encode(true)) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('JWT_TOKEN'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(Charge.method(:from_hash)) .is_api_response(true) .local_error_template('400', 'HTTP 400 Bad Request: {$response.body#/code}', ApiErrorException) .local_error_template('401', 'HTTP 401 Unauthorized: {$response.body#/code}', ApiErrorException) .local_error_template('403', 'HTTP 403 Forbidden: {$response.body#/code}', ApiErrorException) .local_error_template('404', 'HTTP 404 Not Found: {$response.body#/code}', ApiErrorException) .local_error_template('429', 'HTTP 429 Rate Limited: {$response.body#/code}', APIException) .local_error_template('409', 'HTTP 409 Conflict: {$response.body#/code}', APIException) .local_error_template('500', 'HTTP 500 Server Error: {$response.body#/code}', APIException) .local_error_template('503', 'HTTP 503 Unavailable: {$response.body#/code}', APIException) .local_error_template('504', 'HTTP 504 Timeout: {$response.body#/code}', APIException) .local_error_template('default', 'HTTP {$statusCode}: {$response.body#/code}', APIException)) .execute end |