conekta / conekta-ruby

Ruby Bindings for Conekta
https://www.conekta.com
MIT License
31 stars 28 forks source link

How to use Conekta in tests? #95

Closed CCLJ closed 5 years ago

CCLJ commented 5 years ago

I'm not sure if this is the right place, but I can't seem to find any information on how to use the Conekta API inside the integration tests. Hoped someone can direct me in the right direction.

Scoup commented 5 years ago

You can use the attribute livemode false. here a sample using ruby:

  def order_data
    {
      livemode: Rails.env.production?, # true => production, false = sandbox
      currency: currency,
      customer_info: {
        customer_id: user.conekta_customer_id
      },
      line_items: conekta_items_data,
      discount_lines: conekta_discounts_data,
      charges: [{
        payment_method: {
          payment_source_id: conekta_payment_method.remote_id,
          type: external_remote_type,
          expires_at: expires_on
        }
      }]
    }
  end
edenriquez commented 5 years ago

@CCLJ was @Scoup answer good for you?, can we close this issue ?

CCLJ commented 5 years ago

@Scoup thanks for the answerm I'll try it out. @eduenriquez I haven't have time to try this, but we can close the issue for now and reopen it if this doesn't work when I try it.

edenriquez commented 5 years ago

ok @CCLJ sounds good to me and yes feel free to reopen this issue or if you prefer ask via support@conekta.com

CCLJ commented 5 years ago

@eduenriquez will do if I need, thanks:)