def authorize_on_billing_agreement(
      amazon_billing_agreement_id,
      authorization_reference_id,
      amount,
      currency_code: @currency_code,
      seller_authorization_note: nil,
      transaction_timeout: nil,
      capture_now: false,
      soft_descriptor: nil,
      seller_note: nil,
      platform_id: nil,
      custom_information: nil,
      seller_order_id: nil,
      store_name: nil,
      inherit_shipping_address: nil,
      supplementary_data: nil,
      merchant_id: @merchant_id,
      mws_auth_token: nil
    )

      parameters = {
        'Action' => 'AuthorizeOnBillingAgreement',
        'SellerId' => merchant_id,
        'AmazonBillingAgreementId' => amazon_billing_agreement_id,
        'AuthorizationReferenceId' => authorization_reference_id,
        'AuthorizationAmount.Amount' => amount,
        'AuthorizationAmount.CurrencyCode' => currency_code
      }

      optional = {
        'SellerAuthorizationNote' => seller_authorization_note,
        'TransactionTimeout' => transaction_timeout,
        'CaptureNow' => capture_now,
        'SoftDescriptor' => soft_descriptor,
        'SellerNote' => seller_note,
        'PlatformId' => platform_id,
        'SellerOrderAttributes.CustomInformation' => custom_information,
        'SellerOrderAttributes.SellerOrderId' => seller_order_id,
        'SellerOrderAttributes.StoreName' => store_name,
        'SellerOrderAttributes.SupplementaryData' => supplementary_data,
        'InheritShippingAddress' => inherit_shipping_address,
        'MWSAuthToken' => mws_auth_token
      }

      operation(parameters, optional)
    end
def authorize_on_billing_agreement(
      amazon_billing_agreement_id,
      authorization_reference_id,
      amount,
      currency_code: @currency_code,
      seller_authorization_note: nil,
      transaction_timeout: nil,
      capture_now: false,
      soft_descriptor: nil,
      seller_note: nil,
      platform_id: nil,
      custom_information: nil,
      seller_order_id: nil,
      store_name: nil,
      inherit_shipping_address: nil,
      supplementary_data: nil,
      merchant_id: @merchant_id,
      mws_auth_token: nil
    )

      parameters = {
        'Action' => 'AuthorizeOnBillingAgreement',
        'SellerId' => merchant_id,
        'AmazonBillingAgreementId' => amazon_billing_agreement_id,
        'AuthorizationReferenceId' => authorization_reference_id,
        'AuthorizationAmount.Amount' => amount,
        'AuthorizationAmount.CurrencyCode' => currency_code
      }

      optional = {
        'SellerAuthorizationNote' => seller_authorization_note,
        'TransactionTimeout' => transaction_timeout,
        'CaptureNow' => capture_now,
        'SoftDescriptor' => soft_descriptor,
        'SellerNote' => seller_note,
        'PlatformId' => platform_id,
        'SellerOrderAttributes.CustomInformation' => custom_information,
        'SellerOrderAttributes.SellerOrderId' => seller_order_id,
        'SellerOrderAttributes.StoreName' => store_name,
        'SellerOrderAttributes.SupplementaryData' => supplementary_data,
        'InheritShippingAddress' => inherit_shipping_address,
        'MWSAuthToken' => mws_auth_token
      }

      operation(parameters, optional)
    end
Reserves a specified amount against the payment method(s) stored in the
 billing agreement
 @see https://pay.amazon.com/documentation/apireference/201751630#201751940
 @param amazon_billing_agreement_id [String]
 @param authorization_reference_id [String]
 @param amount [String]
 @optional currency_code [String]
 @optional seller_authorization_note [String]
 @optional transaction_timeout [Integer]
 @optional capture_now [Boolean]
 @optional soft_descriptor [String]
 @optional seller_note [String]
 @optional platform_id [String]
 @optional custom_information [String]
 @optional seller_order_id [String]
 @optional store_name [String]
 @optional inherit_shipping_address [Boolean]
 @optional supplementary_data [String]
 @optional merchant_id [String]
 @optional mws_auth_token [String]