Sha256: e689e56f933925c01271eb56879851ebff89a8d05da15b97b6baa38bc57ba875
Contents?: true
Size: 1.29 KB
Versions: 9
Compression:
Stored size: 1.29 KB
Contents
# coding: utf-8 require_relative 'spec_helper' require_relative 'builder' RSpec.describe 'Iyzipay' do before :all do @options = Iyzipay::Options.new @options.api_key = SpecOptions::API_KEY @options.secret_key = SpecOptions::SECRET_KEY @options.base_url = SpecOptions::BASE_URL end context 'when create a payment for market place and then approve payment' do it 'should approve payment item' do sub_merchant = Builder::SubMerchantBuilder.new.create_personal_sub_merchant(@options) payment = Builder::PaymentBuilder.new.create_marketplace_payment(@options, sub_merchant['subMerchantKey']) request = { locale: Iyzipay::Model::Locale::TR, conversationId: '123456789', paymentTransactionId: payment['itemTransactions'][0]['paymentTransactionId'] } approval = Iyzipay::Model::Approval.new.create(request, @options) begin approval = JSON.parse(approval) expect(approval['status']).to eq('success') expect(approval['locale']).to eq('tr') expect(approval['systemTime']).not_to be_nil expect(approval['paymentTransactionId']).to eq(payment['itemTransactions'][0]['paymentTransactionId']) rescue $stderr.puts 'oops' raise end end end after :each do end end
Version data entries
9 entries across 9 versions & 3 rubygems